Adds option to set how materials are linked + small fix
Adds option to set how materials are linked + small fix
Adds an option to set how materials are linked to a mesh object (use preferences, object or object data) Also fixes an issue where materials accumulate on consecutive imports of the same file/mesh
This looks like a nice PR. Before landing though I'd like to briefly discuss the need for data.
For block instances we'll be needing to set materials always to object, since each instance can have a different material assigned with the contained geometry set to By Object Parent.
For instance in Rhino:
- Create a box
- Set box material to By Object Parent
- Create a block out of the box
- Add a copy of the instance
- Set one instance to material 1 (say green)
- Set other instance to material 2 (say blue)
In Blender you'll have one mesh, but they still need to be differently colored - which can be done via object materials instead of data materials.
I see. For context, in our workflow, we don't use materials from Rhino (at least at the moment) and would like to stick to the preference set in blender (or define the behaviour). I thought this would be helpful for others as well.
What you describe is the intent to bring all of Rhino's data in blender as best as possible.
These are two different intends. Not sure how best to handle this in the importer. I also do not have a good grasp on all the different ways to set materials in Rhino atm. So I'm lacking a bit of context right now.
Nevertheless, best would be to be able to cover all of the above.
EDIT: I do have some more changes in our fork. One of them is the option to (not) update materials. I saw that, that is (partially?) implemented in one of the recent commits, but haven't had time to work through that to fully understand it.
I did not take into account not wanting to use the materials from Rhino.
In that sense it indeed is good to have this PR.
This is now merged into master. Thank you!