Brushstroke Tools: Initial Version #328
@ -149,7 +149,11 @@ def set_active_context_brushstrokes_index(self, value):
|
|||||||
bs_ob = bpy.data.objects.get(self.context_brushstrokes[value].name)
|
bs_ob = bpy.data.objects.get(self.context_brushstrokes[value].name)
|
||||||
if not bs_ob:
|
if not bs_ob:
|
||||||
return
|
return
|
||||||
|
view_layer = bpy.context.view_layer
|
||||||
|
if bpy.context.object.visible_get(view_layer = view_layer):
|
||||||
|
bpy.ops.object.mode_set(mode='OBJECT')
|
||||||
bpy.context.view_layer.objects.active = bs_ob
|
bpy.context.view_layer.objects.active = bs_ob
|
||||||
|
if bs_ob.visible_get(view_layer = view_layer):
|
||||||
bpy.ops.object.mode_set(mode='OBJECT')
|
bpy.ops.object.mode_set(mode='OBJECT')
|
||||||
for ob in bpy.data.objects:
|
for ob in bpy.data.objects:
|
||||||
ob.select_set(False)
|
ob.select_set(False)
|
||||||
@ -157,7 +161,7 @@ def set_active_context_brushstrokes_index(self, value):
|
|||||||
ob['BSBST_active'] = False
|
ob['BSBST_active'] = False
|
||||||
bs_ob.select_set(True)
|
bs_ob.select_set(True)
|
||||||
bs_ob['BSBST_active'] = True
|
bs_ob['BSBST_active'] = True
|
||||||
if settings.edit_toggle:
|
if settings.edit_toggle and bs_ob.visible_get(view_layer = view_layer):
|
||||||
utils.edit_active_brushstrokes(bpy.context)
|
utils.edit_active_brushstrokes(bpy.context)
|
||||||
if 'BSBST_material' in bs_ob.keys():
|
if 'BSBST_material' in bs_ob.keys():
|
||||||
settings.context_material = bs_ob['BSBST_material']
|
settings.context_material = bs_ob['BSBST_material']
|
||||||
|
Loading…
Reference in New Issue
Block a user