import_3dm icon indicating copy to clipboard operation
import_3dm copied to clipboard

Adds option to set how materials are linked + small fix

Open rockjail opened this issue 1 year ago • 3 comments

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

rockjail avatar Oct 14 '24 08:10 rockjail

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:

  1. Create a box
  2. Set box material to By Object Parent
  3. Create a block out of the box
  4. Add a copy of the instance
  5. Set one instance to material 1 (say green)
  6. 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.

jesterKing avatar Oct 14 '24 10:10 jesterKing

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.

rockjail avatar Oct 14 '24 15:10 rockjail

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.

jesterKing avatar Oct 17 '24 20:10 jesterKing

This is now merged into master. Thank you!

jesterKing avatar Nov 04 '24 07:11 jesterKing