mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2024-11-21 19:44:18 +00:00
fix(tools/gltf_auto_export): correctly scan for sub collections in main scenes (#94)
* scans for 'in-use' collections now correctly looks inside sub collections as well * removed obsolete .gltf output (keeping only .glb & .gltf+bin+textures * closes #92 * closes #93
This commit is contained in:
parent
97e8e8d862
commit
42c1c71b03
@ -57,7 +57,7 @@ This is a workaround needed because of the way the settings are stored , perhaps
|
|||||||
@persistent
|
@persistent
|
||||||
def deps_update_handler(scene, depsgraph):
|
def deps_update_handler(scene, depsgraph):
|
||||||
if scene.name != "temp_scene": # actually do we care about anything else than the main scene(s) ?
|
if scene.name != "temp_scene": # actually do we care about anything else than the main scene(s) ?
|
||||||
print("depsgraph_update_post", scene.name)
|
#print("depsgraph_update_post", scene.name)
|
||||||
print("-------------")
|
print("-------------")
|
||||||
changed = scene.name or ""
|
changed = scene.name or ""
|
||||||
|
|
||||||
|
@ -2,11 +2,10 @@ import bpy
|
|||||||
from .helpers import traverse_tree
|
from .helpers import traverse_tree
|
||||||
|
|
||||||
# returns the list of the collections in use for a given scene
|
# returns the list of the collections in use for a given scene
|
||||||
# FIXME: this should also look into sub collections
|
|
||||||
def get_used_collections(scene):
|
def get_used_collections(scene):
|
||||||
root_collection = scene.collection
|
root_collection = scene.collection
|
||||||
|
|
||||||
scene_objects = [o for o in root_collection.objects]
|
scene_objects = [o for o in root_collection.all_objects]
|
||||||
collection_names = set()
|
collection_names = set()
|
||||||
used_collections = []
|
used_collections = []
|
||||||
for object in scene_objects:
|
for object in scene_objects:
|
||||||
|
@ -128,9 +128,6 @@ class AutoExportGltfAddonPreferences(AddonPreferences):
|
|||||||
('GLB', 'glTF Binary (.glb)',
|
('GLB', 'glTF Binary (.glb)',
|
||||||
'Exports a single file, with all data packed in binary form. '
|
'Exports a single file, with all data packed in binary form. '
|
||||||
'Most efficient and portable, but more difficult to edit later'),
|
'Most efficient and portable, but more difficult to edit later'),
|
||||||
('GLTF_EMBEDDED', 'glTF Embedded (.gltf)',
|
|
||||||
'Exports a single file, with all data packed in JSON. '
|
|
||||||
'Less efficient than binary, but easier to edit later'),
|
|
||||||
('GLTF_SEPARATE', 'glTF Separate (.gltf + .bin + textures)',
|
('GLTF_SEPARATE', 'glTF Separate (.gltf + .bin + textures)',
|
||||||
'Exports multiple files, with separate JSON, binary and texture data. '
|
'Exports multiple files, with separate JSON, binary and texture data. '
|
||||||
'Easiest to edit later')
|
'Easiest to edit later')
|
||||||
|
Loading…
Reference in New Issue
Block a user