Skip to content

Commit 5dbec56

Browse files
TMHSDigitalclaude
andcommitted
docs(examples): eval-mesh-datablock-name README says who hits it and why name tests never worked
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
1 parent 907cd48 commit 5dbec56

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

‎examples/eval-mesh-datablock-name/README.md‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,55 @@ which is red on every binary.
3939

4040
No `SMOKE_SKIP`. Every matrix leg exercises the contract.
4141

42+
## Who hits this
43+
44+
Exporters, bakers and measurement scripts that receive "some mesh" and
45+
decide whether it is the evaluated result or the original by comparing
46+
names: `if mesh.name != obj.data.name: # evaluated`. On 5.2 that branch
47+
never fires for a modified object, and nothing raises. The script
48+
silently treats evaluated geometry as original: it writes the
49+
modifier-free count into a report, or skips a `to_mesh_clear()` it
50+
thinks it does not owe.
51+
52+
**It was never a reliable test.** Re-measured with the modifier removed,
53+
`evaluated_get().data.name` equals the source name on **all three**
54+
binaries, 4.5.11 included. On 4.5 and 5.1 the inequality held only for
55+
objects whose modifiers produced a new mesh. The 5.2 change removed the
56+
last case where it happened to work.
57+
58+
**What to do instead.** Do not infer "evaluated" from the datablock. The
59+
caller knows which object it evaluated: keep that reference and branch on
60+
where the mesh came from, not on what it is called. Two obvious ID
61+
properties are no substitute. In a probe on the same SUBSURF cube,
62+
`ID.is_evaluated` read `False` on the evaluated mesh, and `ID.original`
63+
did not compare equal to the source mesh, on 4.5.11, 5.1.2 and 5.2.1
64+
alike. Neither is offered here as a replacement.
65+
66+
## Re-verified
67+
68+
| Measurement | 4.5.11 | 5.1.2 | 5.2.1 |
69+
| --- | --- | --- | --- |
70+
| `evaluated_get().data.name`, SUBSURF | `Mesh` | `Mesh` | `SourceMesh` |
71+
| `evaluated_get().data.name`, no modifier | `SourceMesh` | `SourceMesh` | `SourceMesh` |
72+
| `to_mesh().name` | `SourceMesh` | `SourceMesh` | `SourceMesh` |
73+
| Evaluated verts (SUBSURF / none) | 26 / 8 | 26 / 8 | 26 / 8 |
74+
| default exit | 0 | 0 | 0 |
75+
| `--assume-distinct-names` exit | 0 | 0 | 6 |
76+
77+
Exiting 0 on 4.5.11 and 5.1.2 under the falsifier is correct by design.
78+
The naive assumption holds there for this modified cube, so there is
79+
nothing to catch. The falsifier exists to fail where the assumption
80+
broke.
81+
82+
## API reference
83+
84+
- [`Object.evaluated_get`](https://docs.blender.org/api/current/bpy.types.Object.html#bpy.types.Object.evaluated_get)
85+
([4.5 LTS](https://docs.blender.org/api/4.5/bpy.types.Object.html#bpy.types.Object.evaluated_get))
86+
- [`Object.to_mesh`](https://docs.blender.org/api/current/bpy.types.Object.html#bpy.types.Object.to_mesh)
87+
and [`Object.to_mesh_clear`](https://docs.blender.org/api/current/bpy.types.Object.html#bpy.types.Object.to_mesh_clear)
88+
- [`ID.is_evaluated`](https://docs.blender.org/api/current/bpy.types.ID.html#bpy.types.ID.is_evaluated),
89+
[`ID.original`](https://docs.blender.org/api/current/bpy.types.ID.html#bpy.types.ID.original)
90+
4291
## Run
4392

4493
```bash

0 commit comments

Comments
 (0)