Skip to content

Artifacts when Exporting Scenes with Objects Hidden from Viewport #2102

Description

@Xaldew

Describe the bug
Hello!

I've noticed that attempting to export scenes which contains objects that have
hide_viewport == True yields some strange looking artifacts when re-imported
(see screenshots below).

I'm currently working around this by having a small export script that
essentially does this:

for obj in bpy.data.objects:
    if obj.hide_viewport:
        obj.hide_viewport = False
bpy.ops.export_scene.gltf(filepath=f'{output}.gltf',
                          export_cameras=True,
                          export_lights=True,
                          export_format='GLTF_SEPARATE')

This works, but for large scenes (e.g., San Miguel from issue #2101) this can take
a full day to complete.

To Reproduce
Steps to reproduce the behavior:

  1. Open included "arcsphere-50.blend" file.
  2. Export the scene to glb or glTF.
  3. Open a new instance of Blender
  4. Import the previously exported scene.

Expected behavior
The exported scene should match the "arsphere_expected.glb" file.
(i.e., all objects, including the ones marked with hide_viewport = True,
should be included, and at their correct position).

Screenshots
Scene with the artifact, presumably from the "hidden" instances:
blender-artifact
Scene exported with no objects with hide_viewport == True.
blender-no-artifact

.blend file/ .gltf (mandatory)
The zipped file includes a .blend file with half of all objects/instances "hidden" with hide_viewport = True,
as well as a zip with the expected export result and the received result.
arcsphere-50.zip

Version

  • OS: Linux
  • Blender Versions 3.6, 4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions