2
$\begingroup$

I've been importing some somewhat complicated obj files for a project. I noticed that these models had different segments that would end with a line starting with 'o' followed by some name for that segment (I'm assuming 'o' stands for 'object'). The format I'm converting these obj models to is incredibly niche. It's a custom model format and afaik only one obj converter exists. All it can do is take the entire obj file as a single model with a single universal texture and convert it to other format which quite literally only contains a list of triangles as raw data.

This has produced an unusual issue for me. I have been forced (by my own insistence to not waste more time coding my own converter) multiple times now to hand-edit these obj models as a result of the model format. I'd have to copy the obj files X times according to however many internal objects there are and then hand delete the face elements corresponding to that object via a text editor.

Preferably it would be nice to just open a model and then click "save as individual pieces" or click save on each object if there is some spot in the editor that they are listed. Does Blender have such a feature? I've only ever used it to convert a few models to the obj format as the other converter didn't support those formats.

$\endgroup$
3
  • $\begingroup$ You can "Separate Loose Parts" in Edit mode and then use "Selection Only" in the .obj export options. $\endgroup$
    – rob
    Feb 8, 2019 at 11:21
  • $\begingroup$ @rob going to need a bit more specifics on location in the gui then that. $\endgroup$
    – user64742
    Feb 9, 2019 at 0:34
  • $\begingroup$ Somewhat related blender.stackexchange.com/questions/130841/… using obj export ofcourse. $\endgroup$
    – batFINGER
    Feb 15, 2019 at 11:25

1 Answer 1

2
$\begingroup$

I created a quick scene with a few basic Meshes Joined together to form a single Mesh

basic meshes

In Edit mode I selected everything and pressed P to bring up the Separation menu and selected "By loose parts"

meshes selected and separate menu shown

Now in Object mode you can see even the over lapping components are separate Meshes.

meshes separated

From the File->Export menu select Wavefront (.obj) export menu

And check "Selection Only"

selection only option checked

I did not look into it, but you may be able to use Python to select each Mesh in turn and call the Export module in a loop.

$\endgroup$
2
  • $\begingroup$ So is each mesh what the different segments of the obj file are defining? (I might be a bit too far in the low level implementation of the obj file. I only know the pieces by actually reading the file in a text editor.) $\endgroup$
    – user64742
    Feb 16, 2019 at 20:36
  • $\begingroup$ at this point I would just say, give it go. If all the vertices are linked together then they can not be separated without manual intervention, but most likely they are grouped together but are not attached together. $\endgroup$
    – rob
    Feb 18, 2019 at 9:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .