Export Block Groups/Names to Obj


#1

Hey Peoples,

I’m a Cinema4D user that occasionally uses Rhino to convert Stp or other foreign formats to Obj or Fbx so I can import this into Cinema4D. Simply exporting any simple model to Obj is fine, however this time I want to take it a step further as the model I’ve received this time is a bit more complex and I just want to improve my workflow in general.

I’ve browsed the web quite a bit but I just can’t figure it out. What I want is the following.
When I go to BlockEdit I can see a whole list of parts of my model, everything is properly grouped and named.
See image: http://prntscr.com/fwxfph

However when I try to export the file to Obj it doesn’t include any of the block names/groups, it just leaves me with a massive list of object_xxxxxx.

So I’ve come here hoping to find someone who can help me out.
What I’d like is to be able to export to Obj while including the hierarchy of groups/names I’m not to worried about the mesh as I can just clean this up in C4D.

Many thanks in advance!


(Pascal Golay) #2

Hi Alain - I don’t know if there is an easier way, but it may help to run this plug-in that explodes all the parts of a block to separate layers - then export using layers as the organizer. . Note the command line option - my guess is that you want the non-default option but experiment…

ExplodeBlocksToLayers.rhp (14.5 KB)
Drag and drop onto Rhino and run the command ExplodeBlocksToLayers

-Pascal


Update on activity focused on Block Manager
#3

Hey Pascal,

Thanks! I’m running it as we speak, I’ll get back to you once it’s done converting.

  • Alain

#4

Hey @pascal

Sadly it still gives me a massive list of object_xxxx. Do you have any other tips/tricks?

Thanks in advance!

-Lipadoza


(Pascal Golay) #5

Hi Lipadoza - I’m not sure if this will be what you need but what comes to mind, if you blow all the parts onto layers, is to find parent layers that are the depth you’d like the parts to be, select one of these layers in the layer panel, right click and choose ‘Select sub-layer objects’ then right click again and choose ‘Change object layer’. Do that for all the parent layers you want and then export with layers as the organizer in the obj export…

-Pascal


#6

Hey @pascal

I’m still getting used to Rhino, I think I see what went wrong. it did explode everything to a layer, but the same layer sadly.
so I just have thousands of objects in a single layer. I’ve stumbled upon another forum post, which might more accurately describe my own issue: Distribute Blocks to Layers...?
So I’m going to try to run the script you wrote here, see of that works.


(Pascal Golay) #7

Hi Lipadoza - well, right, this may not be the right tool, if there is only one block - it’s useful when an assembly is made up of multiply-nested blocks, so to speak - if that is not what you’ve got, then it all ends up on one layer.

-Pascal


#8

Hey @pascal
I think I’ve managed to correctly explode all blocks to seperate layers, this is how it looks in my viewport http://prntscr.com/fxu9qo However if I export it, it still gives me 1 single layer. In your previous post you mentioned clicking all parent layers manually and then manually clicking change object layer, but that doesn’t seem to work. If i look at my layers then they should already be seperated right?


(Pascal Golay) #9

Hm… you can choose to export using layers as obj groups:

Here, round-tripping back to Rhino shows all the objects organized on the correct layers.
From V6/WIP, the same setting results in objects on the same layer being single objects - that is what I was thinking you may want. So in Rhino shove objects that you want to be the same thing in C4D onto a layer and export with that setting.

LayersToOBJ.zip (50.4 KB)
Does that have the organization that makes sense?
-Pascal


#10

Hey @pascal
I think I’ve gotten it to work, at least somewhat. I think C4D may be at fault for not importing the layer/group hierarchy, but at least I’ve gotten all naming intact.

So thanks once more for all your time and assistance you’ve been a great help! I’ll now focus on C4D