Page MenuHome

FBX Export: Add Limit To > Visible Objects checkbox to match GLTF export
ClosedPublic

Authored by Thomas Hope (thomashope) on Apr 4 2022, 2:33 AM.

Details

Summary

FBX Export: Option to exclude hidden objects

This change adds options to FBX Export intended to mirror existing
options available in GLTF export, namely:
Include > Limit To > Visible Objects.

The GLTF options were discussed and agreed on in this discussion:
https://github.com/KhronosGroup/glTF-Blender-IO/issues/1139

And implemented in this change:
https://github.com/KhronosGroup/glTF-Blender-IO/pull/1361/commits/f39e14c1ba1310576614eed919e08950f68793fb


This patch adds an option to the FBX exporter that excludes hidden
objects while exporting.

This change has been tested by myself and two other artists on my team
and appears to be working correctly in our Unity asset pipeline.
We are all running windows.

The above GLTF discussion + change also included a checkbox for
Renderable Objects however I opted not to introduce that in this
patch for simplicity Since I am new. If other developers are happy with
this patch then I could create a second patch to introduce the
Renderable Objects checkbox.

This is my first contribution to Blender. I did my best to read and
understand the guidance but if there is anything I can imporve about
the code or the submission please let me know!

Diff Detail

Event Timeline

Thomas Hope (thomashope) requested review of this revision.Apr 4 2022, 2:33 AM
Thomas Hope (thomashope) created this revision.
Bastien Montagne (mont29) requested changes to this revision.Apr 4 2022, 5:38 PM

Generally LGTM, just a note below.

io_scene_fbx/export_fbx_bin.py
3221

Would rather have generator expression here, also, better a proper container, than an expression that only generates an iterator (since an iterator can only be consumed once, this can have unexpected side effects):

tuple(obj for obj in ctx_object if obj.visible_get())
This revision now requires changes to proceed.Apr 4 2022, 5:38 PM

Switched to the generator expression as suggested, thanks for the input.

Thanks, looks good now, will commit.

This revision is now accepted and ready to land.Apr 5 2022, 12:32 PM