Brushstroke Tools: Initial Version #328
@ -79,6 +79,23 @@ def set_brushstroke_name(self, value):
|
||||
|
||||
return
|
||||
|
||||
def get_active_context_brushstrokes_index(self):
|
||||
return self["active_context_brushstrokes_index"]
|
||||
|
||||
def set_active_context_brushstrokes_index(self, value):
|
||||
prev = self.get('active_context_brushstrokes_index')
|
||||
self["active_context_brushstrokes_index"] = value
|
||||
if prev == value:
|
||||
return
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
bs_ob = bpy.data.objects.get(self.context_brushstrokes[value].name)
|
||||
if not bs_ob:
|
||||
return
|
||||
bpy.context.view_layer.objects.active = bs_ob
|
||||
for ob in bpy.data.objects:
|
||||
ob.select_set(False)
|
||||
bs_ob.select_set(True)
|
||||
|
||||
class BSBST_link_context_setting(bpy.types.PropertyGroup):
|
||||
name: bpy.props.StringProperty(default='')
|
||||
link_context: bpy.props.BoolProperty(default=False, name='Link to Context')
|
||||
@ -126,7 +143,10 @@ class BSBST_Settings(bpy.types.PropertyGroup):
|
||||
('CURVES', 'Curves', 'Use hair curves (Full Support)', 'CURVES_DATA', 1),
|
||||
])
|
||||
context_brushstrokes: bpy.props.CollectionProperty(type=BSBST_context_brushstrokes)
|
||||
active_context_brushstrokes_index: bpy.props.IntProperty(default = 0, update=update_active_brushstrokes)
|
||||
active_context_brushstrokes_index: bpy.props.IntProperty( default = 0,
|
||||
update=update_active_brushstrokes,
|
||||
get=get_active_context_brushstrokes_index,
|
||||
set=set_active_context_brushstrokes_index)
|
||||
|
||||
classes = [
|
||||
BSBST_link_context_setting,
|
||||
|
Loading…
Reference in New Issue
Block a user