Page MenuHome

Curve shape keys python data gets mixed up and extra points added
Closed, ResolvedPublic


System Information
Operating system: Windows 10
Graphics card: Nvidia 1050

Blender Version
Broken: 2.8 Hash: 26d5a3625ed
Worked: (optional) 2.79c

Short description of error
When adding a shape key to a curve object and accessing the data of the shape_keys.key_blocks[].data there are extra data points added and the .co, .handle_left, .handle_right of each point after the 0 index data are mixed up. (example: index 2 will have the .co of index 3 and the .handle_left of index 4 etc.)

Exact steps for others to reproduce the error
Based on the default startup or an attached .blend file (as simple as possible).

With a default file:

  1. Add in a bezier curve object
  2. In editmode extrude another curve point
  3. Add any number of shape keys to the curve object
  4. In the python console or the text editor compare the len() of[0].data and it will have more data points then bezier points as well as the data will be jumbled up

Event Timeline

Philipp Oeser (lichtwerk) triaged this task as Confirmed, Medium priority.Dec 5 2018, 12:00 PM

Can confirm.
Even not extruding, just moving a point will mess up the values [in this case there are no extra data points added though...]

Curve shapekey data is more complicated than coordinates, and even more so in 2.8 after rB12788906. I suspect python API wrappers don't take that into account.

Shape keys are stored as an unstructured array of floats, and all code that works with them has to independently interpret the layout, so it's easy to miss some places that need updating when changing something...