Page MenuHome

Shape keys get out of sync with Basis shape
Open, NormalPublic

Description

Hi! I've attached a file where you run a script that copies the vertex coordinates from a second mesh into the Basis shape key of the object.

The copy operation works well, the thing is that the the existing shapekeys don't take into account the changes of the Basis shape.

You may find that perhaps I'm missing something in the script, but I'm reporting this cause I've seen this same behavior in my everyday modelling workflow, only that I could never recreate the bug. Sometimes when going in and out Edit mode or Sculpt mode, I realize that the existing shapekeys have gone out of sync with the changes I was doing to the Basis shape... It's like if the changes of the Basis shape didn't propagate to the rest of the shapes.

So please, give a little check to the shape keys code, perhaps you'll find out why this could happen.

Details

Type
Bug

Event Timeline

Juan Pablo Bouza (jpbouza) created this task.
Juan Pablo Bouza (jpbouza) raised the priority of this task from to Needs Triage by Developer.
Bastien Montagne (mont29) triaged this task as Normal priority.

Grumph… Something strange is going on here… Thing is, in theory, you do not edit Basis (i.e. first relative skey), it’s supposed to be exact same as actual mesh. But all this is a bit flacky :|

Also, got a nice crash while playing with your file, will check that first…

Hi Bastien!

Thanks for looking into this!

Yes, I also thought that what should be edited was the actual mesh and not the basis. Therefore I also did the test to transfer the vertex locations to the mesh vertices (vert.co), but the result was the same regarding the propagation to the other shape keys.

Ok… So here is the issue. 'relative' shape keys are actually fake-relative, in that they do not really build on top of their basis. Rather, they all store absolute vertex coordinates. Then, when you edit a skey and leave Edit mode, Blender will search for all keys using edited one as basis, and apply to them the offset resulting from that basis’ edition.

That very simple and robust process (sarcastic) is not done when setting values from RNA - and for now I do not see how it could be, not without a huge overhead at least…

Let’s see what Campbell says here.

Oh, that's interesting!

Well, about my script then, I could just ask Campbell how to do that propagation manually, or perhaps I should copy the vertex locations within edit mode?

The other issue here is that many times I see this exact same problem, but when toggling between Edit mode, Sculpt and Object mode. I can't really tell when it happens, cause it's just a random thing (random for user, hehe). So, my guess is that there must be some kind of flaw or exception in the propagation process, maybe some checks missing or something, cause this really happens.

The other week while modelling the sheep flock for Gooseberry, it happened several times, and I had to throw my changes to trash and begin all over again, cause the changes to the Basis had not propagated to all the other shapes. But really, can't tell when exactly it happens, cause I did some test, doing apparently the same thing, and some times it worked ok, sometimes it didn't.

I must also say that every time this happens, I'm editing an objects that has several modifiers... so perhaps it would be a good idea to check if modifiers could somehow cause the propagation process to not work properly?

OK, I think I've found the bug!

Well, at least for the GUI workflow part, not for the script I submitted.

So, I found the reason why changes to the Basis shape will not always propagate to the rest of the shapes. It's because of UNDO.

Procedure:

_Create a cube
_Add a Basis shape
_Add another shape and set it to 1
_Go to the Basis shape and enter edit mode.
_Move one vertex.
_Move it again and UNDO
_Go to object mode and play with key 1 slider, you'll notice that the vertex movement that was introduced to the Basis shape has not propagated to Key 1. Instead, Key 1 is no bringing back the original shape of the cube.

If yo happen to solve this, perhaps the report could be closed, but then ideasman should give me a hand with the shape propagation in my script!

Hi, I just wanted to point out that this bug still exists in 2.79. :( I just lost 30 minutes of work because some edits didn't apply to shape keys while some others did. Apparently using UNDO while editing basis is not safe.