Page MenuHome

Animated mesh UVs, vertex groups, vertex colors don’t update on time change
Closed, ResolvedPublic

Description

System Information
Operating system: Ubuntu 18.10
Graphics card: Nvidia GeForce GTX 660M

Blender Version
Broken: 2.81 (5489611e5317)
Worked: 2.79

After adding keyframes to a mesh object data, mesh UVs, vertex groups and vertex colors don’t get updated when changing the time.

Exact steps for others to reproduce the error

  • Open blend file
  • Both planes have keyframes on their UVs. The one on the left also has keyframes on vertex locations.
  • Scrub the timeline to set the time
  • The UVs of the object on the right don’t get updated.

Test file and bug as originally reported by @Rombout Versluijs (rombout) in T68332.

Event Timeline

Philipp Oeser (lichtwerk) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.

Confirmed, will check on this...

Philipp Oeser (lichtwerk) raised the priority of this task from Confirmed, Medium to Confirmed, High.Aug 15 2019, 10:07 AM

Started looking into this.
Some first notes:

This is what we get on frame change:

graph_id_tag_update: id=SCScene flags=AUDIO_SEEK source=USER_EDIT
graph_id_tag_update: id=SCScene flags=AUDIO_SEEK source=USER_EDIT
graph_id_tag_update: id=SCScene flags=TIME source=USER_EDIT
graph_id_tag_update: id=SCScene flags=TIME source=USER_EDIT
[SCScene :: View Layer]: Operation is entry point for update: ANIMATION_EVAL()
[SCScene :: View Layer]: Operation is entry point for update: ANIMATION_EVAL()
[SCScene :: View Layer]: Operation is entry point for update: ANIMATION_EVAL()
[SCScene :: View Layer]: Operation is entry point for update: SOUND_EVAL()
[SCScene :: View Layer]: Operation is entry point for update: COPY_ON_WRITE()
[SCScene :: View Layer]: Accumulated recalc bits for SCScene: 4235264
[SCScene :: View Layer]: Accumulated recalc bits for OBPoints_UVS: 7
[SCScene :: View Layer]: Accumulated recalc bits for MEPlane: 6
[SCScene :: View Layer]: Accumulated recalc bits for ACPlaneAction.001: 4
[SCScene :: View Layer]: Accumulated recalc bits for ACPlaneAction.002: 4
[SCScene :: View Layer]: Accumulated recalc bits for OBUVs_only: 0
[SCScene :: View Layer]: Accumulated recalc bits for MEPlane.001: 4
[SCScene :: View Layer]: Accumulated recalc bits for ACPlane.001Action: 4
[SCScene :: View Layer]: deg_evaluate_copy_on_write on SCScene (0x7f8788532c08)
[SCScene :: View Layer]: layer_eval_view_layer on View Layer (0x7f87884b1f88)
[SCScene :: View Layer]: BKE_animsys_eval_animdata on OBPoints_UVS (0x7f8788598208) at time 7.000000
[SCScene :: View Layer]: BKE_animsys_eval_animdata on MEPlane (0x7f87884b4e08) at time 7.000000
[SCScene :: View Layer]: BKE_animsys_eval_animdata on MEPlane.001 (0x7f878d3f9908) at time 7.000000
[SCScene :: View Layer]: BKE_object_eval_local_transform on OBPoints_UVS (0x7f8788598208)
[SCScene :: View Layer]: BKE_object_eval_transform_final on OBPoints_UVS (0x7f8788598208)
[SCScene :: View Layer]: BKE_object_eval_eval_base_flags on OBPoints_UVS (0x7f8788598208)
[SCScene :: View Layer]: BKE_object_eval_eval_base_flags on OBUVs_only (0x7f8788597c08)
[SCScene :: View Layer]: BKE_mesh_eval_geometry on MEPlane (0x7f87884b4e08)
[SCScene :: View Layer]: BKE_object_eval_uber_data on OBPoints_UVS (0x7f8788598208)
[SCScene :: View Layer]: BKE_object_handle_data_update on OBPoints_UVS (0x7f8788598208)
Depsgraph updated in 0.000820 seconds.

If one has a look at DepsgraphNodeBuilder::build_animdata it can be observed that:

  • the UV case, seemingly only the mesh ID has a adt->action
  • thus BKE_animsys_eval_animdata is correctly evaluated for the mesh later on framechange, BUT
  • the object ID misses a adt->action thus no BKE_animsys_eval_animdata on the object ID
  • still need to check if this is already the cause (so BKE_object_eval_uber_data / BKE_object_handle_data_update are responsible for correct updates) OR
  • why we are missing BKE_mesh_eval_geometry from the mesh ID

Also BKE_mesh_eval_geometry is bound in DepsgraphNodeBuilder::build_object_data_geometry_datablock for the UV mesh, but not called on framechange...

Stay tuned...

Thank you for looking into it.
I forgot to mention that the same lack of update also happens with lattice points’ locations. The issue with the lattices can’t be demonstrated with a blend file though, because the workaround found by Rombout Versluijs can’t apply since even the location isn’t updated.
I don’t know if I should open a new bug report for this, as it seems related.

To test lattice points, you may use the animation_animall add-on to insert keys on lattice points.

Also note that even if this works with image textures in the file provided, there is still an issue with procedural textures... [these dont update as well]

I'm afraid I wont have time to really look into this further (concentrating on housekeeping/triaging/tagging reports [not that much fixing...sniff] in the tracker for the time being), so I will step down for now to not block progress on this [imho important] issue.
Maybe @Sergey Sharybin (sergey) can have a look?

I will also point to the following T68332#763573, since there is more information of what is failing at the current state of affairs...

The AnimAll workaround probably caused T69509, so I still think this is a High priority...

@Sergey Sharybin (sergey) : I have added this to 2.81 milestone (since it was set to "High"), mind checking?

quick note: works as soon as you insert a "regular" keyframe on the mesh datablock [e.g. a keyframe on mesh.texspace_location[0] or something totally unrelated as mesh.use_customdata_vertex_bevel]

UVs and vertex colors should now be fixed.
But in order to fix the vertex groups case I need to have a demo file.

That enough?

Hi @Sergey Sharybin (sergey), thank you.
UVs appear fixed, but I’m not sure about the vertex colors. In the test file below, one vertex of the mesh labeled V-Cols is supposed to go from blue to white on playback.
The one labeled V-groups has one vertex shift to the right with a Displace modifier.
The lattice Points are also animated.

This seems to do it

1
2
3diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc
4index 3620c82d4b3..e6938a8d303 100644
5--- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc
6+++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc
7@@ -282,7 +282,8 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr,
8 RNA_struct_is_a(ptr->type, &RNA_Spline) || RNA_struct_is_a(ptr->type, &RNA_TextBox) ||
9 RNA_struct_is_a(ptr->type, &RNA_GPencilLayer) ||
10 RNA_struct_is_a(ptr->type, &RNA_MeshUVLoop) ||
11- RNA_struct_is_a(ptr->type, &RNA_MeshLoopColorLayer)) {
12+ RNA_struct_is_a(ptr->type, &RNA_MeshLoopColor) ||
13+ RNA_struct_is_a(ptr->type, &RNA_VertexGroupElement)) {
14 /* When modifier is used as FROM operation this is likely referencing to
15 * the property (for example, modifier's influence).
16 * But when it's used as TO operation, this is geometry component. */
17diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
18index 61c8eec7a72..cefc5aded7c 100644
19--- a/source/blender/makesrna/RNA_access.h
20+++ b/source/blender/makesrna/RNA_access.h
21@@ -392,6 +392,7 @@ extern StructRNA RNA_Mesh;
22 extern StructRNA RNA_MeshCacheModifier;
23 extern StructRNA RNA_MeshColor;
24 extern StructRNA RNA_MeshColorLayer;
25+extern StructRNA RNA_MeshLoopColor;
26 extern StructRNA RNA_MeshDeformModifier;
27 extern StructRNA RNA_MeshEdge;
28 extern StructRNA RNA_MeshFloatProperty;

Thanks a whole lot for taking care @Sergey Sharybin (sergey), was looking at it again today a bit (but had my eyes in the wrong corners...), great this is back!

updated paste with vcol fix...

@Philipp Oeser (lichtwerk), looks correct. Mind adding RNA_LatticePoint to the same exceptions and commit?