Something to help you all with multiple blender mesh exports

Hi everyone,

As you all know, and are struggling with, mesh exporting from blender to obj files can take quite some time and effort, since we are needing to divide up our models into x pieces and then needing to export them one-by-one and naming them while at it. So, until we get multi-import in studio we can use this sweet add-on I assembled (found the syntax somewhere, and plugged it into a .py file). It basically allows you to make an .obj export “batch,” and cycles through each model selected (very important, you have to select all the parts you want exported) and exports it to one file place (that you choose), and the names for the files are named after the actual object names in the 3D space, so thats another sweet feature.

To install this addon in blender, go to User Preferences > Addons > Install from file > select the downloaded file and click the checkmark next to it when it appears, and click save user settings.

image

:slight_smile: Hope that helps, enjoy!

61 Likes

Where’s the code you use for this? The dropbox link only has .fbx files.

When I was having this problem as well, I searched online and wrote this script:

import bpy;


SCALE_FACTOR = 0.0328; # 1 cm in feet


def exportAllFbx(exportFolder):
	bpy.ops.object.mode_set(mode = "OBJECT");
	objects = bpy.data.objects;
	
	projectName = bpy.path.basename(bpy.data.filepath).replace(".blend", "");
	baseName = exportFolder + projectName + "_";
	
	for object in objects:
		bpy.ops.object.select_all(action = "DESELECT");
		object.select = True;
		exportName = baseName + object.name + ".fbx";
		bpy.ops.export_scene.fbx(filepath = exportName, use_selection = True, global_scale = SCALE_FACTOR);


exportAllFbx(bpy.path.abspath("//"));
1 Like

So sorry, had linked the wrong file >_<

I updated the link to the proper one, it should work now :slight_smile:

3 Likes

That’s a pretty cool trick… Thanks!

2 Likes

Heya! I tried to use this and it’s really helpful but somehow when I exported stuff as obj in batch, it doesn’t seem to export the sharp edges I’ve made on the mesh. I tried and exporting one mesh as an obj and it exported the sharp edges.

I hope it’s possible for you to fix this.

@nurgenius

When you export, there are settings on the side, such as these:

image

If you have sharp edges, I believe selecting “Include Edges” will do the trick. Let me know if it works!

Edit: “Write normals” is the option that fixed the sharp edge stuff up!

3 Likes

Heya!

It was on by default when I am exporting them and I’d just want to say that even when I reconfirm the selection, the results is still the same.

Images

Edit/Update:

So I tried to copy your setting in the image you uploaded and it seems that “Write Normals” does the trick. Thanks.

4 Likes

Does this add-on support 2.8 aswell?

1 Like

Hey, sorry for bumping the old thread.

Blender 2.8 is getting to the point where it’s pretty stable to work with it, so I was wondering whether this plugin compatible with it and if not, do you plan on updating it?
(Tested, but it doesn’t seem to work)

1 Like

No idea if this plugin works with 2.8 or not. I haven’t personally tested it, but it seems like most people are seeing that it doesn’t function.

1 Like

Hey everyone. I was browsing around BlenderArtists and found their thread on addons updated for 2.8. Someone was asking for an .obj batch exporter to be updated. Someone delivered and it’s the same format in this thread’s but functioning for 2.8. As usual, just install the python script through the file.

https://blenderartists.org/uploads/default/original/4X/8/8/e/88e02a836d86ca9f79b8db655ba13dc0bac08454.py

12 Likes

After exporting, is there a way to fast importing fourhundreds meshes? :joy:

To Studio? There’s actually a Bulk Import widget!

1 Like

Well, yes but after I have to create a part for every mesh

I know this is such a late reply, but I just love this. It helps me so much when importing. :smiley:

2 Likes