Something to help you all with multiple blender mesh exports


#1

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!


Import Multiple Meshes
Import Multiple Meshes
#2

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("//"));

#3

So sorry, had linked the wrong file >_<

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


#4

That’s a pretty cool trick… Thanks!


#5

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


#6

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!


#7

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.