@nathanletwory jumping in here to ask a quick block/instance question (if that’s okay)
At the moment I import a model of a piece of furniture that’s built up of blocks in Rhino (its a modular system). Comes across perfectly in blender as empties and a collection of Instance Definitions. I texture the Instance Definition Collection and then render it out.
Problem comes when I wish to import a different configuration of the furniture model (same blocks/instances, just different arrangement). What I’ve been doing is creating a new Blender file, importing the new arrangement with its non-textured definitions and then appending the textured definitions from the previous Blender file, where I go through each component and then link the empty to match the appended textured instance definitions. Can get messy and time consuming.
Ideally I’d like to just import the new arrangement of blocks and have blender use the definitions I’ve already textured/edited? I’ve had a look at the instances.py from import_3dm and guess it would be a check to see if there was already a instance definition that matched within the Blender file and if so populate the empty with that definition rather than the block data from the Rhino file? I would attempt my own branch but my python knowledge is pretty basic (I might attempt a branch that just imports empties though…)
Is this something easy to do or actually quite complicated?
Hi @Lukxf, so if you import a new file that contains the same instance definitions, but layed out differently you’d have that file use the definitions you already have in the file under a different collection?
Ideally. The logic is: if there’s already an existing instance definition in the Blender file, ask to use that as the link to the empty instead of creating a new instance definition. The catch being if there isn’t an existing instance definition, to behave as normal.
I.e. I have 50 x bolt1empties linked to instance definitionbolt1_collection. When I import a new arrangement of bolt1, currently blender will create the new empties and link it to bolt1_collect.001. I would like it to instead link to the original bolt1_collection. At the moment I just go through and update the instance collection manually but it is quite time consuming for the number of different groupings of parts in the model (and I often change the arrangement of the parts as well…)
Yesterday I forked your add-on and hacked at it until it would import the blocks as empties but wouldn’t populate the definitions with geo from the rhino blocks. This didn’t work as I had hoped because it still created the instance definition collections (as a placeholder?) and so I still get the doubling up/duplication of instance collections…
Fantastic add-on by the way, have learnt quite a lot from digging into it!
@nathanletwory Is there a way to get the names of the object name to match the block name? All my parts are named Object.[###] which isn’t terribly useful.
I’d also prefer an option to create a parent structure for blocks, so you end up with an assembly structure something like:
HandleAsm>
HandleBodyAsm>
ScrewPt_15201
ScrewPt_15201
ArmL_4455
ArmR_4456
HandleHingedAsm>
ScrewPt_15201
ScrewPt_15201
BarrelPt_2244
The current block import, the parts intances are in collections, and the assembled part is a single instance. I’m not sure how to really do anything with that other than just say “make real” And every single part gets an empty. But when you make it real, they aren’t associated with anything. So I’m sure I’m doing something wrong there.
I am not sure I follow. When I name my blocks definitions after I’ve made sure that the geometry that I am going to instance have names then these carry over into Blender.
In the following I have a block definition called ABlockDefinition. It contains two geometry: NamedBox and NamedSphere:
This structure, including names, transfers to Blender:
When you don’t name your geometry you’ll get automatically named geometry according Blender standards, where objects are called Object, Object.001 etc.
Hmm, yeah, you’re right. I was importing a file that was Pretty much a straight step file import from SolidWorks (I think)
All I did was import, with blocks selected, and then Ctrl+A “make instances real”
I’m not sure if there’s another way to use the data, but it doesn’t seem I can really do anything before doing that?
But on a much smaller test file, the names are fine. Of course, I created that file myself right in rhino. So the objects all have names.
In the other file, none of the objects have names:
The “name” is the block name and that’s it. For normal step files created from SolidWorks, ProE etc, I think that’s how they come in? If I’m right about that, I think it would be nice, if the object has no name, to automatically name the object to match the Block rather than just object.[###]
So maybe if the block is named 619PL06_2 and the object inside it has no name, then just name it 619PL06_2.001, which would allow for consecutive naming of multiple objects within a block that have no name?
I ended up using STEPper instead. The mesh is a little funny because it uses a different method, BUT the mesh is joined. Rhino’s mesh isn’t joined at every surface/trim edge, so you end up with a Lot of duplicate vertices. Rhino’s mesh is better if you have to edit anything though. Both use custom split normals, but Rhino’s are a lot easier to fix afterward.
My unedited rhino file import is 1GB though. My STEPper import is 51MB. I’ve got a script that I can run on the rhino import that I’d guess would bring the size down to about 400MB, but that’s still pretty big. And that has everything to do with how Rhino does viewport mesh, and not your addon, which is awesome.
Hi. Have a question. When I import meshes into Blender, they always end up with a lot of non manifold edges. I always have to clean up/merge by distance in Blender. Otherwise Blender doesnt let me bevel. Maybe some import settings are wrong? Since the rendermesh inside Rhino doesnt have non manifold edges.
Especially hard edges, but also in polysurfaces you’ll find that mesh pieces aren’t welded. That is how Rhino meshes objects, and there is not much you can do about.
Adding a remove doubles based on distance is probably a postpro step I should add to the import_3dm addon.
I’ll make some fixes next week and make sure this gets added too.
Ah cool. Do you mean, Rhino unwields meshes at the export stage? Because Rhino’s Mesh checker tells me " Mesh does not have any non manifold edges."
A postproduction “merge by distance at import” option within Blender would be a huge timesaver if this can’t be solved before exporting.
Would this step occur on import (i.e. in a black box) or after the import is completed, so the results could be previewed? I presume the former, with a very low distance threshold?
It’d be part of the import, but as an option. The distance could be added as a setting as well. Disable it when you want to check the import results before running that yourself.
Hi Nathan. Another remark. if I import 3dms while working with multiple scenes in on blend file, they always end up in the first project scene (scene0), not the open scene. its a bit confusing until figured out.
Otherwise super nice importer!
I’ve been using your Rhino to Blender plugin at work (automotive) a lot lately to. It’s been great so far, even if just for not having to deal with messing around with scale setting when importing obj’s into blender. And the fact that it preserves the file structure and layers in the outliner is a godsend.
Did you install v0.0.10 of the plug-in? Ensure you have the ZIP for Python 3.9, which is the Python version used by Blender 3.0. You may have to restart Blender after installing the add-on.