Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blender 2.8]Selected object export - Collection disabled - Error - not in view #517

Closed
oxplay2 opened this issue Jun 1, 2019 · 2 comments · Fixed by #582
Closed

[Blender 2.8]Selected object export - Collection disabled - Error - not in view #517

oxplay2 opened this issue Jun 1, 2019 · 2 comments · Fixed by #582
Labels
bug Something isn't working exporter This involves or affects the export process Mesh_&_Object

Comments

@oxplay2
Copy link

oxplay2 commented Jun 1, 2019

did not found related issue, please close if there is one.

Description:
For exporter Selected object param ONLY:

In my Scene view list when i have hidden Collection(disabled checkbox) with bezier curves(i got them for hair construct) it throw error like below.

if i have it visible, no error is thrown and everything is properly exported.

expect it work for hidden Collection too.

error:

Traceback (most recent call last):
File "C:\Home\tools\Windows\blender-2.80.0-git.9bae9b634ec6-windows64\2.80\scripts\addons\io_scene_gltf2_init_.py", line 412, in execute
return gltf2_blender_export.save(context, export_settings)
File "C:\Home\tools\Windows\blender-2.80.0-git.9bae9b634ec6-windows64\2.80\scripts\addons\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 40, in save
json, buffer = __export(export_settings)
File "C:\Home\tools\Windows\blender-2.80.0-git.9bae9b634ec6-windows64\2.80\scripts\addons\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 54, in __export
__gather_gltf(exporter, export_settings)
File "C:\Home\tools\Windows\blender-2.80.0-git.9bae9b634ec6-windows64\2.80\scripts\addons\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 69, in __gather_gltf
scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings)
File "C:\Home\tools\Windows\blender-2.80.0-git.9bae9b634ec6-windows64\2.80\scripts\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather.py", line 34, in gather_gltf2
scenes.append(__gather_scene(blender_scene, export_settings))
File "C:\Home\tools\Windows\blender-2.80.0-git.9bae9b634ec6-windows64\2.80\scripts\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather_cache.py", line 51, in wrapper_cached
result = func(*args)
File "C:\Home\tools\Windows\blender-2.80.0-git.9bae9b634ec6-windows64\2.80\scripts\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather.py", line 52, in __gather_scene
node = gltf2_blender_gather_nodes.gather_node(blender_object, export_settings)
File "C:\Home\tools\Windows\blender-2.80.0-git.9bae9b634ec6-windows64\2.80\scripts\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather_cache.py", line 51, in wrapper_cached
result = func(*args)
File "C:\Home\tools\Windows\blender-2.80.0-git.9bae9b634ec6-windows64\2.80\scripts\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather_nodes.py", line 35, in gather_node
if not __filter_node(blender_object, export_settings):
File "C:\Home\tools\Windows\blender-2.80.0-git.9bae9b634ec6-windows64\2.80\scripts\addons\io_scene_gltf2\blender\exp\gltf2_blender_gather_nodes.py", line 76, in __filter_node
if export_settings[gltf2_blender_export_keys.SELECTED] and blender_object.select_get() is False:
RuntimeError: Error: Object 'BezierCurve.001' not in View Layer 'View Layer'!

location: :-1

Screenshots:

https://i.imgur.com/LPVv2ec.png
https://i.imgur.com/uLj0kK2.png
https://i.imgur.com/SEEmd71.png

  • OS: Windows (dont be confused with Home dir)
  • Blender Version: 2.8
@oxplay2 oxplay2 changed the title Error - not in view [Blender 2.8]Collection hidden Error - not in view Jun 1, 2019
@oxplay2 oxplay2 changed the title [Blender 2.8]Collection hidden Error - not in view [Blender 2.8]Selected object export - Collection hidden Error - not in view Jun 1, 2019
@oxplay2 oxplay2 changed the title [Blender 2.8]Selected object export - Collection hidden Error - not in view [Blender 2.8]Selected object export - Collection disabled - Error - not in view Jun 1, 2019
@julienduroure julienduroure added bug Something isn't working exporter This involves or affects the export process Mesh_&_Object labels Jun 2, 2019
@genbod
Copy link

genbod commented Jun 4, 2019

I just experienced the same bug but the object that is "not in the View Layer" is not hidden. In my case I linked a scene and tried to copy and paste an object and I would get the same error. All the existing objects export to glb just fine if I hide everything else and only export selected. I finally deleted the copied object and recreated it in the original scene, but I get the same error. If I don't choose selected and hide everything else, it works but ends up exporting everything from the linked scene. It is almost like the bug is related to the multiple scenes and view layer. I am not sure how to mess with the view layer, so I can't debug any more. Here is my .blend if that helps. The Object that keeps failing is Edge in the default scene.

@genbod
Copy link

genbod commented Jun 4, 2019

I played with it some more and it looks like creating additional scenes breaks the exporter. Basically I could only export from the second scene. Any time I tried to deslect everything from the second scene and export a selection from the original scene I would get this error. Once I moved everything into the original scene and then deleted the second scene I was able to once again export any selection and hide any collection without any problem. I hope that helps at all.

julienduroure added a commit that referenced this issue Jul 11, 2019
Fixes #517 . `blender_object.select_get()` will error if its collection is disabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter This involves or affects the export process Mesh_&_Object
Projects
None yet
3 participants