Brushstroke Tools: Initial Version #328
@ -451,7 +451,6 @@ class BSBST_OT_select_surface(bpy.types.Operator):
|
||||
return {"FINISHED"}
|
||||
|
||||
def set_brushstrokes_deformable(bs_ob, deformable):
|
||||
|
||||
flow_ob = utils.get_flow_object(bs_ob)
|
||||
|
||||
for mod in bs_ob.modifiers:
|
||||
@ -465,6 +464,8 @@ def set_brushstrokes_deformable(bs_ob, deformable):
|
||||
mod['Socket_27'] = deformable
|
||||
elif mod.node_group.name == '.brushstroke_tools.surface_draw':
|
||||
mod['Socket_15'] = deformable
|
||||
|
||||
mod.node_group.interface_update(bpy.context)
|
||||
utils.set_deformable(bs_ob, deformable)
|
||||
if not flow_ob:
|
||||
return
|
||||
@ -480,7 +481,7 @@ class BSBST_OT_switch_deformable(bpy.types.Operator):
|
||||
|
||||
deformable: bpy.props.BoolProperty( default=True,
|
||||
name="Deformable",)
|
||||
switch_all: bpy.props.BoolProperty( default=True,
|
||||
switch_all: bpy.props.BoolProperty( default=False,
|
||||
name="All Brushstrokes",
|
||||
description="Switch all Brushstroke Layers of Current Surface Object.")
|
||||
|
||||
@ -501,7 +502,7 @@ class BSBST_OT_switch_deformable(bpy.types.Operator):
|
||||
return {"CANCELLED"}
|
||||
|
||||
for ob in bs_objects:
|
||||
set_brushstrokes_deformable(ob, self.switch_all)
|
||||
set_brushstrokes_deformable(ob, self.deformable)
|
||||
|
||||
context.view_layer.depsgraph.update()
|
||||
|
||||
|
@ -241,11 +241,12 @@ class BSBST_Settings(bpy.types.PropertyGroup):
|
||||
('BRUSHSTROKES', 'Brushstrokes', 'Specify the style of the currently active brushstrokes', 'BRUSH_DATA', 1),
|
||||
('AUTO', 'Auto', 'Specify the style of either the active brushstrokes or the preset depending on the context', 'AUTO', 2),
|
||||
])
|
||||
view_tab: bpy.props.EnumProperty(default='MODIFIERS',
|
||||
view_tab: bpy.props.EnumProperty(default='SHAPE',
|
||||
name='Context',
|
||||
items= [
|
||||
('MODIFIERS', 'Modifiers', 'View Modifiers Settings', 'MODIFIER', 0),
|
||||
('SHAPE', 'Shape', 'View Modifiers Settings', 'MODIFIER', 0),
|
||||
('MATERIAL', 'Material', 'View Material Settings', 'MATERIAL', 1),
|
||||
('SETTINGS', 'Settings', 'View Additional Settings', 'PREFERENCES', 2),
|
||||
])
|
||||
|
||||
try:
|
||||
|
@ -348,7 +348,7 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
|
||||
if settings.context_material:
|
||||
if getattr(settings.context_material, '["BSBST"]', False):
|
||||
draw_material_settings(material_panel, settings.context_material, surface_object=surface_object)
|
||||
elif settings.view_tab == 'MODIFIERS':
|
||||
elif settings.view_tab == 'SHAPE':
|
||||
if style_object:
|
||||
for mod in style_object.modifiers:
|
||||
mod_info = mod.id_data.modifier_info.get(mod.name)
|
||||
@ -394,6 +394,10 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
|
||||
# expose add modifier operator for preset context
|
||||
if is_preset:
|
||||
style_panel.operator('brushstroke_tools.preset_add_mod', icon='ADD')
|
||||
elif settings.view_tab == 'SETTINGS':
|
||||
deform = utils.get_deformable(style_object)
|
||||
op = style_panel.operator('brushstroke_tools.switch_deformable', text='Deforming Surface', depress=deform, icon='MOD_SIMPLEDEFORM')
|
||||
op.deformable = not deform
|
||||
|
||||
class BSBST_MT_PIE_brushstroke_data_marking(bpy.types.Menu):
|
||||
bl_idname= "BSBST_MT_PIE_brushstroke_data_marking"
|
||||
|
Loading…
Reference in New Issue
Block a user