def draw(self, context):
brush, path = self.init()
menu = utils_core.Menu(self)
menu.add_item().label(text="Stroke Method")
menu.add_item().separator()
if brush:
# add the menu items dynamicaly based on values in enum property
for tool in brush.bl_rna.properties['stroke_method'].enum_items:
if tool.identifier in [anchored, drag_dot] and \
utils_core.get_mode() in [utils_core.vertex_paint,
utils_core.weight_paint]:
continue
utils_core.menuprop(
menu.add_item(), tool.name, tool.identifier, path,
icon='RADIOBUT_OFF', disable=True,
disable_icon='RADIOBUT_ON'
)
else:
menu.add_item().label("No Stroke Method available", icon="INFO")
评论列表
文章目录