aframe_blender_exporter
aframe_blender_exporter copied to clipboard
objects from linked collections fail on export
if i link a collection from another file the export crashes at contained objects:
$ ./blender
Read prefs: /home/stefan/.config/blender/2.90/config/userpref.blend
found bundled python: /home/stefan/mydata/tools/blender/blender-2.90.1-linux64/2.90/python
Read blend: /home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection.blend
Info: Saved "test_linked_collection.blend"
Info: Saved "test_linked_collection.blend"
[AFRAME EXPORTER] Exporting project...
[AFRAME EXPORTER] Target Dir = /home/stefan/mydata/github/blender/aframe_blender_exporter
--- DEST [/home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection] [/home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection/.] {.}
--- DEST [/home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection] [/home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection/assets/] {assets/}
--- DEST [/home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection] [/home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection/resources/] {resources/}
--- DEST [/home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection] [/home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection/media/] {media/}
--- DEST [/home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection] [/home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection/env/] {env/}
--- DEST [/home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection] [/home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection/js/] {js/}
--- DEST [/home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection] [/home/stefan/mydata/blender/tests/aframe_exporter/test_linked_collection/lightmaps/] {lightmaps/}
[AFRAME EXPORTER] loop object CollectionTorus
Warning: 1 object(s) not centered, 0 changed:
Warning: |1 linked library object(s)
[AFRAME EXPORTER] loop object Cube
[LIGHTMAP] Searching Lightmap for object [Cube_baked]
'/home/stefan/mydata/tools/blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/site-packages/libextern_draco.so' exists, draco mesh compression is available
12:26:50 | INFO: Starting glTF 2.0 export
12:26:50 | INFO: Extracting primitive: Cube
12:26:50 | INFO: Primitives created: 1
12:26:50 | INFO: Finished glTF 2.0 export in 0.0018973350524902344 s
[AFRAME EXPORTER] loop object Light
[AFRAME EXPORTER] loop object Torus
Traceback (most recent call last):
File "/home/stefan/.config/blender/scripts/addons/aframe_blender_exporter/__init__.py", line 575, in execute
obj.select_set(state=True)
RuntimeError: Error: Object 'Torus' can't be selected because it is not in View Layer 'View Layer'!
location: <unknown location>:-1
location: <unknown location>:-1
Error: Traceback (most recent call last):
File "/home/stefan/.config/blender/scripts/addons/aframe_blender_exporter/__init__.py", line 575, in execute
obj.select_set(state=True)
RuntimeError: Error: Object 'Torus' can't be selected because it is not in View Layer 'View Layer'!
location: <unknown location>:-1
on a quick search i found some maybe related thinks:
- Trying to select updated mesh, but get: Object 'Plane' can't be selected because it is not in View Layer 'View Layer'!
- Object not in View Layer error when trying to select a new object in a new scene from a panel.
- Select Hierarchy (Child) error, when object is not on view layer
with linked objects this does not happen. so somehow this seems to be only happening with linked collection / child things...
i have attached the two test files.
should be fixed with #17 - in combination with blender 3.1. - if it contains the vtree branch of the gltf exporter.
@s-light vtree branch will not be on 3.1, but in 3.2
hmm ok! thanks for the heads up.
just tested this - fixed with official blender 3.1.0 and #17
still have the issue with 3.1.2
Error: Object 'Bridge' can't be selected because it is not in View Layer 'View Layer'!
obj.select_set(obj.type == "MESH")