Linking material as object (MaterialSlot.link) prevents shape keys from export #72859

Open
opened 2020-01-02 21:59:09 +01:00 by Filipp · 6 comments

System Information
Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: GeForce GTX 980 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.12

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-12-04 11:32, hash: blender/blender@f1aa4d18d4

Short description of error
If object with shape keys has material linked as object (MaterialSlot.link is Object instead of Data), then shape keys don't export (tested for .fbx), wherein they work correctly for original object.

Exact steps for others to reproduce the error

  1. Open attached .blend. test.blend
  2. Export as .fbx (one file) both deformed cubes.
    Export configuration doesn't seem to affect the bug, used configuration attached as .png. config.png
  3. Import created .fbx with default configuration.
  4. Imported cube that was copied from "Cube_Bad" (one with material as object) doesn't have shape keys nor actions with them.
**System Information** Operating system: Windows-10-10.0.17763 64 Bits Graphics card: GeForce GTX 980 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.12 **Blender Version** Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-12-04 11:32, hash: `blender/blender@f1aa4d18d4` **Short description of error** If object with shape keys has material linked as object (`MaterialSlot.link` is `Object` instead of `Data`), then shape keys don't export (tested for .fbx), wherein they work correctly for original object. **Exact steps for others to reproduce the error** 1. Open attached .blend. [test.blend](https://archive.blender.org/developer/F8256885/test.blend) 2. Export as .fbx (one file) both deformed cubes. Export configuration doesn't seem to affect the bug, used configuration attached as .png. ![config.png](https://archive.blender.org/developer/F8256887/config.png) 3. Import created .fbx with default configuration. 4. Imported cube that was copied from "Cube_Bad" (one with material as object) doesn't have shape keys nor actions with them.
Author

Added subscriber: @DANTEpolaris

Added subscriber: @DANTEpolaris
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Can confirm, checking...

Can confirm, checking...
Philipp Oeser changed title from Linking material as object prevents shape keys from export to Linking material as object (MaterialSlot.link) prevents shape keys from export 2020-01-03 12:11:06 +01:00
Member

Added subscriber: @mont29

Added subscriber: @mont29
Member

Looks like this is because in that case [Material linked to object instead ob data], the FBX exporter will create a new mesh, see this comment:

We cannot use default mesh in that case, or material would not be the right ones...

So then we end up doing

tmp_me = bpy.data.meshes.new_from_object(ob_to_convert, preserve_all_data_layers=True, depsgraph=depsgraph)

And new_from_object doesnt seem to preserve shape_keys (despite preserve_all_data_layers)

I havent looked into the details yet, but maybe @mont29 knows right away?

Looks like this is because in that case [Material linked to object instead ob data], the FBX exporter will create a new mesh, see this comment: > # We cannot use default mesh in that case, or material would not be the right ones... So then we end up doing ``` tmp_me = bpy.data.meshes.new_from_object(ob_to_convert, preserve_all_data_layers=True, depsgraph=depsgraph) ``` And `new_from_object` doesnt seem to preserve shape_keys (despite `preserve_all_data_layers`) I havent looked into the details yet, but maybe @mont29 knows right away?
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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#72859
No description provided.