Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions blender_nerf_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,15 @@ def save_splats_ply(self, scene, directory):
init_selected_objects = bpy.context.selected_objects
bpy.ops.object.select_all(action='DESELECT')

# select only visible meshes
view_layer_objects = bpy.context.view_layer.objects

# select only visible meshes **that are in the active view layer**
for obj in scene.objects:
if obj.type == 'MESH' and self.is_object_visible(obj):
if (
obj.type == 'MESH'
and self.is_object_visible(obj)
and obj.name in view_layer_objects
):
obj.select_set(True)

# save ply file
Expand Down Expand Up @@ -267,4 +273,4 @@ def save_log_file(self, scene, directory, method='SOF'):
logdata['Outwards'] = scene.outwards
logdata['Dataset Name'] = scene.cos_dataset_name

self.save_json(directory, filename='log.txt', data=logdata)
self.save_json(directory, filename='log.txt', data=logdata)