jesterKing / import_3dm

Blender importer script for Rhinoceros 3D files
MIT License
308 stars 38 forks source link

changes instance definition visibility states #71

Closed lfertig closed 4 years ago

lfertig commented 4 years ago

Creates a separate ViewLayer for instance definitions

The added code resolves the problem of overlapping instance definition objects in the main scene view, that could until now only be resolved by manually changing visibility states of all instance definition objects and collections.

fixes / resolves

Resolves #70.

lfertig commented 4 years ago

two images to illustrate the setup: idef_view scene_view

tsvilans commented 4 years ago

Looks good!

Helpful to have a separate View Layer just for blocks.

tsvilans commented 4 years ago

Can you remove the .3dm and .3dmbak files from the PR? Keeps the repository clean :)

lfertig commented 4 years ago

ahh of course, I'll put them on ignore

lfertig commented 4 years ago

@tsvilans @jesterKing : can i get an opinion from you guys? I'm still extending this and managed to cleanly lay out the block definitions to make editing them easier. this works well unless the blocks were defined with reference to the world origin and sit somewhere in 3d space (see example). I could wrestle them into the grid pattern, but i wonder if it's a good idea. it would work on reimport since the offsets are defined once when the collection definition is laid out the first time. It would break data consistency with the original file though... (which I'm doing anyways with the other blocks since I'm redefining the instance offset?)

image

other than that i think i can take the "experimental" tag of the import option, it handles relatively complex scenes with multiple levels of nested blocks without a problem..

image

tsvilans commented 4 years ago

@lfertig Looks awesome! So cool to have blocks as collections.

I'm wondering why you are laying out all the blocks in a grid pattern in the first place? Wouldn't you just center them around the block base point? I.e. block base point == world origin? Editing individual blocks then should just be a matter of isolating the corresponding collection, and, upon import, all the block collections could simply be turned off (unchecked)...

lfertig commented 4 years ago

i put them all to world origin in the beginning. yesterday i made an effort, took the sample project here and tried to recreate the scene as i rendered it in rhino. fact is, you end up toggling visibility in the outliner/hiding/unhiding/selecting by material/by collection all the time and its pretty tedious. if you have a small block, it might be hidden by overlapping larger geometry. laying them out like this seemed the most sensible option, since you can easily define the instance_offset in the collection.

i guess i would at least offer it as an option since it greatly facilitates working with the file

tsvilans commented 4 years ago

Yes, sounds like a good option to have. Isolating collection instances should be a Blender feature. There are so many times where that would be useful. Similar how you can press / to isolate a group of objects, you should be able to select a collection instance and isolate the objects in that collection.

tsvilans commented 4 years ago

This seems to address the issue with editing collection instances. Let's hope it gets implemented soon :) https://blender.community/c/rightclickselect/nkdbbc/

lfertig commented 4 years ago

ahh that'd be great. i don't see a timeline though? is this a proper bugreport?

anyway, this here seems robust enough after working with it for another day to merge it, unless there's any reason not to?

tsvilans commented 4 years ago

Looks good to me!