I’ve been trying to create some basic shortcut buttons for actions I perform a lot in Blender.
I have a custom panel in the 3D view with a collection of buttons that perform various basic actions.
However, one thing has eluded me so far which I would like to get working.
For example, I have a button that adds a Dynamic Paint modifier like so:
class maClass(bpi.type.operator):
bl_idname = XXXX
def execute(self, context):
Do what you want here!
context.object.modifier_add(type='DYNAMIC_PAINT')
class Ui_Class(bpy.type.Panel)
def draw(self, context):
row.operator(maclass.bl_idname, text="DP Canvas VW", icon="MOD_DYNAMICPAINT")