silverslade / aframe_blender_exporter

Blender Exporter for A-Frame VR
MIT License
104 stars 17 forks source link

objects from linked collections fail on export #9

Open s-light opened 3 years ago

s-light commented 3 years ago

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:

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.

test_linked_collection.zip

s-light commented 2 years ago

should be fixed with #17 - in combination with blender 3.1. - if it contains the vtree branch of the gltf exporter.

julienduroure commented 2 years ago

@s-light vtree branch will not be on 3.1, but in 3.2

s-light commented 2 years ago

hmm ok! thanks for the heads up.

s-light commented 2 years ago

just tested this - fixed with official blender 3.1.0 and #17

phil123456 commented 2 years ago

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")