So here is my current pie menu. It works quite well but only on one object sadly.
What would be the best way to design a poll function so that based on what modifier type I select in the pie it will be applied to all selected objects.
Meaning is there a way to define this with one universal command?
class PieManipulateObject_Ext(Menu):
bl_idname = "pie.manipulateobject_ext"
bl_label = "Add Modifier"
def draw(self, context):
layout = self.layout
scene = context.scene
pie = layout.menu_pie()
#4 - LEFT
pie.operator("object.modifier_add", text="Array", icon="MOD_ARRAY").type='ARRAY'
#6 - RIGHT
pie.operator("object.modifier_add", text="Sub-Surface", icon="MOD_SUBSURF").type='SUBSURF'
#2 - BOTTOM
box = pie.box()
col = box.column()
col.label("Deformations:")
col.operator("object.modifier_add", text="Shrinkwrap", icon="MOD_SHRINKWRAP").type='SHRINKWRAP'
col.operator("object.modifier_add", text="Curve", icon="MOD_CURVE").type='CURVE'
col.operator("object.modifier_add", text="Deform", icon="MOD_SIMPLEDEFORM").type='SIMPLE_DEFORM'
col.operator("object.modifier_add", text="Displace", icon="MOD_DISPLACE").type='DISPLACE'
col.operator("object.modifier_add", text="Lattice", icon="MOD_LATTICE").type='LATTICE'
#8 - TOP
pie.operator("object.modifier_add", text="Screw", icon="MOD_SCREW").type='SCREW'
#7 - TOP - LEFT
pie.operator("object.modifier_add", text="Solidify", icon="MOD_SOLIDIFY").type='SOLIDIFY'
#9 - TOP - RIGHT
pie.operator("object.modifier_add", text="Mirror", icon="MOD_SUBSURF").type='MIRROR'
#1 - BOTTOM - LEFT
pie.operator("object.modifier_add", text="Edge Split", icon="MOD_EDGESPLIT").type='EDGE_SPLIT'
#3 - BOTTOM - RIGHT
pie.operator("object.modifier_add", text="Bevel", icon="MOD_BEVEL").type='BEVEL'
dict? Note that all modifiers are not accessable for all object types. – p2or Jan 28 '16 at 08:00