Curve shape keys python data gets mixed up and extra points added #58391

Closed
opened 2018-12-01 03:06:49 +01:00 by Cody Winchester · 7 comments

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).Curve Error.blend
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 bpy.context.active_object.data.shape_keys.key_blocks- .data and it will have more data points then bezier points as well as the data will be jumbled up
**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).[Curve Error.blend](https://archive.blender.org/developer/F5774527/Curve_Error.blend) 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 bpy.context.active_object.data.shape_keys.key_blocks- [x].data and it will have more data points then bezier points as well as the data will be jumbled up

Added subscriber: @CodyWinchester

Added subscriber: @CodyWinchester
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

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...]

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...]

Added subscriber: @angavrilov

Added subscriber: @angavrilov
Alexander Gavrilov self-assigned this 2018-12-05 12:56:59 +01:00

Curve shapekey data is more complicated than coordinates, and even more so in 2.8 after blender/blender@12788906. 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...

Curve shapekey data is more complicated than coordinates, and even more so in 2.8 after blender/blender@12788906. 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...

This issue was referenced by blender/blender@16aa7dfa19

This issue was referenced by blender/blender@16aa7dfa196df376f5c23f8892b172128b38bb52

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No project
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#58391
No description provided.