Skip to content

Commit

Permalink
fix(tools/gltf_auto_export): correctly scan for sub collections in ma…
Browse files Browse the repository at this point in the history
…in 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
  • Loading branch information
kaosat-dev committed Jan 3, 2024
1 parent 97e8e8d commit 42c1c71
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tools/gltf_auto_export/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
@persistent
def deps_update_handler(scene, depsgraph):
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("-------------")
changed = scene.name or ""

Expand Down
5 changes: 2 additions & 3 deletions tools/gltf_auto_export/helpers_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
from .helpers import traverse_tree

# 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):
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()
used_collections = []
for object in scene_objects:
Expand Down Expand Up @@ -117,7 +116,7 @@ def get_exportable_collections(main_scenes, library_scenes, addon_prefs):
children_per_collection = {}
flatten_collection_tree(root_node, children_per_collection)
#print("ROOT NODE", children_per_collection) #

return (all_collection_names, children_per_collection)

def get_collections_per_scene(collection_names, library_scenes):
Expand Down
3 changes: 0 additions & 3 deletions tools/gltf_auto_export/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ class AutoExportGltfAddonPreferences(AddonPreferences):
('GLB', 'glTF Binary (.glb)',
'Exports a single file, with all data packed in binary form. '
'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)',
'Exports multiple files, with separate JSON, binary and texture data. '
'Easiest to edit later')
Expand Down

0 comments on commit 42c1c71

Please sign in to comment.