Seems lots of ppl don’t use blender <—> unity for saying export as this, never use that… XD lol
WORKFLOW is the master word when creating 3D. and the right way of doing things is to make then as smooth as possible. Imagine if every 10 meters, you should stop your car, get outta it, close the doors, wait 17 seconds, open the doors get into it, start engine, make 10 more meters and redo the whole shit ?
lol
hopefully U3D team and Blender team did things in a much more intelligent way ( than the common one: NEVER USE BLENDS… lol )
There’s a lil script written in python bundled with unity. it is called
Unity-BlenderToFBX.py
and is located on a win machine
in programfiles/unity/hub/editor/theVersionYouUse/data/tools
you who ( with no doubt ) write some lil scripts in unity will be aware of what to do for editing this script and change it for your specific needs in importing your work into unity.
for example, i model with blender and create some light/shadow/mist/etc meshes that are used in texture bakes, but that i NEVER want in unity. I just don’t want to see them in unity as they are annoying and useless. but i need them in blender…
imagine you can put a thing in blender saying ‘i dont want this in unity’…
YES YOU CAN !!!
lets assume that you exclude objects in unity from a char in their name
in your blend you got 2 objects:
one named cube
and
one named _sphere
the ‘_’ will be the object excluder in unity3D import.
for this you just have to change the
Unity-BlenderToFBX.py
at the end and replace:
# 2.59 and later
kwargs = io_scene_fbx.export_fbx.defaults_unity3d()
io_scene_fbx.export_fbx.save(FakeOp(), bpy.context, filepath=outfile, **kwargs)
# HQ normals are not supported in the current exporter
print("Finished blender to FBX conversion " + outfile)
with :
# 2.59 and later
# HACK SELECTIVE BLENDER IMPORT
for obj in bpy.data.objects:
obj.select = False if obj.name[0] in '_.' else True
#end HACK
kwargs = io_scene_fbx.export_fbx.defaults_unity3d()
# HACK SELECTIVE BLENDER IMPORT
kwargs["use_selection"] = True
#end HACK
io_scene_fbx.export_fbx.save(FakeOp(), bpy.context, filepath=outfile, **kwargs)
# HQ normals are not supported in the current exporter
print("Finished blender to FBX conversion " + outfile)
and voila
in unity you’ll only retrieve the cube ! the sphere will be discarded !
happy blending and unitying !!!