Draws grease pencil lines around your selected object bundles.
Sets the pivot points of selected objects to the ground of the bounding box of the bundle.
The addon comes with an Unity Editor script which automatically resets the -90 degree rotations and assigns existing materials automatically if the name assigned in blender matches any material name in your Unity project. This script is completely optional and not mandatory at all.
The Unity Editor script can automatically assign existing materials if the material names between Blender and the Unity project match.
This is an addon that I always wanted for 3dsMax or Blender, a painless stupid simple way to export and update existing FBX files in a project. I have been using variants of this script in the past at work on commercial projects and it saves so much time, all you do is select your objects and press 'Export'.
Replies
If you work on tiling modules it can be very annoying if your pivot floats around each time you export.
Just an idea, cool stuff
could you change for unreal preset?:
apply_scale_options = 'FBX_SCALE_ALL',
to
apply_scale_options = 'FBX_SCALE_NONE',
You've really been taking off with the blender scripting stuff.
I've been thinking of learning blender specifically for the tool scripting side of it since I hear lots of nice things about it.
How would you rate blenders "script-ability" compared to max? Seems like everything about blender is designed around the idea that it can be scripted/automated which is a novel idea.
Keep up the great work so I can come along and look at your code and learn something
If you work on tiling modules it can be very annoying if your pivot floats around each time you export.
Idlero
apply_scale_options = 'FBX_SCALE_ALL',
to apply_scale_options = 'FBX_SCALE_NONE',
On another note I have started creating a logo design for this addon, to give it a bit visual love
For an upcoming version I am looking into a LOD pipeline or something to save variants of bundles with modifiers applied that are copied from a target object.
I agree with @Nosslak on his first point. After some testing with objects with multiple children, I was unable to to set the pivot of the exported mesh to be aligned to the topmost parent object in the hierarchy.
Also, there seems to be a minor rotation issue with the child objects when testing in Unity 2018.1.7 as can be seen in the screenshots below:
When exported into Unity, all the child objects are rotated by -90 degrees along X-axis by default.
This can be quickly fixed by resetting the rotation of all the child objects in the editor.
https://bitbucket.org/renderhjs/blender-addon-fbx-bundle/pull-requests/3/added-set-pivot-at-parent-location/diff
It's known issue. I was waiting for response from @renderhjs with any fixes or changes.
any way I will fix that today on my branch
update:
https://bitbucket.org/renderhjs/blender-addon-fbx-bundle/pull-requests/3/added-set-pivot-at-parent-location/diff
@Nosslak
changed behavior should be fine now
mesh_smooth_type should be set to FACE on export
I fixed that in my repo, committed that to pull request:
https://bitbucket.org/renderhjs/blender-addon-fbx-bundle/pull-requests/3/added-set-pivot-at-parent-location/diff
mesh_smooth_type should be set to FACE on export
Version 1.2.0 is out!!
For this version I received 3 pull requests by members from this forum and outside. They are:Pull Requests
Changes
Upcoming feature: Modifiers
Does a binary packing on the selected bundles (not just per object but per bundle). This GIF shows a batch import on assets and then a packing to arrange them in the scene. I am using the 'by parent' sorting mode as none of them have a parent to isolate them by object.
Also would be handy for me to have a button to export all objects in current scene instead of having to select them.
I'll see how it compares with Capsule from Takanu Kyriako.
Edit: Some progress this evening
Will have to add a warning if the glTF addon is not installed.
The export/open folder buttons are triggering this error with v1.2.0 release
Traceback (most recent call last):
File "/Users/df/Library/Application Support/Blender/2.79/scripts/addons/FBXBundleExporter/op_file_export.py", line 32, in execute
export(self, bpy.context.scene.FBXBundleSettings.target_platform)
File "/Users/df/Library/Application Support/Blender/2.79/scripts/addons/FBXBundleExporter/op_file_export.py", line 162, in export
bake_space_transform = bake_transform
File "/Applications/blender.app/Contents/Resources/2.79/scripts/modules/bpy/ops.py", line 189, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
File "/Applications/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/__init__.py", line 620, in execute
return export_fbx_bin.save(self, context, **keywords)
File "/Applications/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 3113, in save
ret = save_single(operator, context.scene, filepath, **kwargs_mod)
File "/Applications/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 3020, in save_single
fbx_objects_elements(root, scene_data)
File "/Applications/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 2819, in fbx_objects_elements
fbx_data_mesh_elements(objects, me_obj, scene_data, done_meshes)
File "/Applications/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 941, in fbx_data_mesh_elements
me.polygons.foreach_get("use_smooth", t_ps)
TypeError: couldn't access the py sequence
location: /Applications/blender.app/Contents/Resources/2.79/scripts/modules/bpy/ops.py:189
location: <unknown location>:-1
Traceback (most recent call last):
File "/Users/df/Library/Application Support/Blender/2.79/scripts/addons/FBXBundleExporter/op_file_export.py", line 32, in execute
export(self, bpy.context.scene.FBXBundleSettings.target_platform)
File "/Users/df/Library/Application Support/Blender/2.79/scripts/addons/FBXBundleExporter/op_file_export.py", line 162, in export
bake_space_transform = bake_transform
File "/Applications/blender.app/Contents/Resources/2.79/scripts/modules/bpy/ops.py", line 189, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
File "/Applications/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/__init__.py", line 620, in execute
return export_fbx_bin.save(self, context, **keywords)
File "/Applications/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 3113, in save
ret = save_single(operator, context.scene, filepath, **kwargs_mod)
File "/Applications/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 3020, in save_single
fbx_objects_elements(root, scene_data)
File "/Applications/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 2819, in fbx_objects_elements
fbx_data_mesh_elements(objects, me_obj, scene_data, done_meshes)
File "/Applications/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/export_fbx_bin.py", line 941, in fbx_data_mesh_elements
me.polygons.foreach_get("use_smooth", t_ps)
TypeError: couldn't access the py sequence
location: /Applications/blender.app/Contents/Resources/2.79/scripts/modules/bpy/ops.py:189
location: <unknown location>:-1
Traceback (most recent call last):
File "/Users/df/Library/Application Support/Blender/2.79/scripts/addons/FBXBundleExporter/op_file_open_folder.py", line 33, in execute
os.startfile(path)
AttributeError: module 'os' has no attribute 'startfile'
location: <unknown location>:-1
This way you can actually offset rotations, apply scales etc. automatically.
Upcoming Update
A big update for FBX Bundle is around the corner with a lot of new features and a big overhaul on how different target platforms are supported (much more modular). In the last few days I have been creating a new website to document the new featuresThe idea is that you can modify either the path / folder and the file name using dynamic variables and any string you feel like. Once functional you would be able to create folders per bundle that way.
The following variables I am working on:
- {path} the original output path
- {bundle} the bundle name
- {scene} the current scene name
It will preview in realtime the new bundle names within the modifier UIFBX Bundle 1.5.0 is out!
new website & download
http://renderhjs.net/fbxbundle/
Changes
New Modifiers
LOD levels are previewed in the modifier panel with the compression ratio and LOD level.
Vertex colors require shaders to fully utilize them.
With 2.8 around the corner it would be nice to also implement sorting or converting to collections, e.g. bundle objects by collection. And with 2.8 the GlTF addon will be part of Blender which makes it easier for me to include the support (it already does now but requires a manual install of the addon).
eidt: turns out I need downgrade blender in order to use it (