Skip to content

Commit f0bfe71

Browse files
committed
small bug fix
1 parent a3b93e6 commit f0bfe71

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

bseq/messenger.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33

44
def selected_callback():
5-
if not bpy.context.view_layer.objects.active:
6-
return
5+
6+
# seems like that this is not necessary
7+
# if not bpy.context.view_layer.objects.active:
8+
# return
9+
710
name = bpy.context.active_object.name
811
idx = bpy.data.objects.find(name)
912
if idx >= 0:

bseq/panels.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,15 @@ def draw(self, context):
196196
split = layout.split()
197197
col1 = split.column()
198198
col2 = split.column()
199+
200+
# check if edit_obj exist
201+
# if not exist any more, then delete the object manually
202+
# see here https://blender.stackexchange.com/a/164835 for more details
203+
# I personally think this implementation is not a good design,
204+
# but can't think of any better ways now
205+
if importer_prop.edit_obj and context.scene.objects.get(importer_prop.edit_obj.name) == None:
206+
bpy.data.objects.remove(importer_prop.edit_obj)
207+
199208
col1.prop_search(importer_prop, 'edit_obj', bpy.data, 'objects', text="")
200209
col2.operator("sequence.edit")
201210

0 commit comments

Comments
 (0)