Exporters (add-ons and compiled) need to be updated to support new fully dynamic material assignment possible from Geometry Nodes #96721
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
8 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#96721
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Blender Version
Broken: version: 3.1.0, branch: master, commit date: 2022-03-08 18:16, hash:
blender/blender@c77597cd0e
Worked: Uncertain
Short description of error
The apply modifiers doesn't work properly with geonodes in the instance of combining two geos with two separate materials. The combine object will only have one material assigned. However, if you apply the modifier and then export, the reimport will look correct with multiple materials.
Exact steps for others to reproduce the error
Set the material color on the default cube
Duplicate the default cube, create a new material on it and change its color.
Select the original and create geometry node network.
3a. Add a object info node and select the duplicate cube.
3b. Offset the object info geometry with a Transform geometry node with translation xyz vals.
3c. Join Geometry the original geometry and the transformed object info.
3d. Hide original duplicate cube.
Select geonodes cubes and export with export selected and apply modifiers to an fbx. (or gltf2)
Reimport into scene and observe the single material on the imported object (the bug)
Select the geonodes cubes, apply the modifier, export it and reimport it. Observe two materials on the imported geo (the way it should work if apply modifiers was working correctly).
Test File:
#96721.blend
Confirmed formats with the issue currently (there are most likely more):
893100d8e3
.Formats which exporters are already working fine with this new material assignment behavior:
Added subscriber: @Colin_Knu
Added subscriber: @PratikPB2123
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @dfelinto
I can reproduce the bug and it also happens with GLTF2.
Added subscriber: @mont29
Materials have always been handled as 'fixed' info available from the object/obdata, they were never really 'editable' by the modifier stack, at least not beyond re-assigning different material indices (i.e. shuffling around assignment of materials defined 'statically' in the object's material slots.
Now geometry nodes can add random materials in a fully dynamic way, that are totally unknown from original object/obdata. So all export code (add-ons, but also most likely all our shiny brand new C++-implemented formats) will have to undergo (sometimes significant) changes to support this new behavior.
Apply modifier on export breaks geonodes materialsto Exporters (add-ons and compiled) need to be updated to support new fully dynamic material assignment possible from Geometry NodesAdded subscriber: @scurest
So what's the correct way to fetch materials now? The old way was to read
ob.material_slots- [x].material
.I am not sure yet, I would hope that doing that on evaluated objects should give you the 'final' list of materials... But this needs to be investigated. Also need to check OBJ to understand why it's working there.
This is what the Python OBJ exporter does to get the materials
However, I notice that this does not handle materials that are overridden at the object level (
material_slots- [x].link == 'OBJECT'
).Added subscriber: @JulienDuroure
Added subscriber: @aras_p
Looking at the codebase, Collada is also likely to be affected (it uses
BKE_object_material_get
everywhere)@aras_p indeed, that's why I tagged the #collada project ;)
This issue was referenced by blender/blender@d3eef4d22a
Hello,
Any update on how this should be handled for python add exporters?
I believe this works for Python
which is basically just a Python port of BKE_object_material_get_eval.