Changeset View
Changeset View
Standalone View
Standalone View
doc/python_api/examples/bpy.types.Operator.4.py
| Show All 35 Lines | def draw(self, context): | ||||
| col.label(text="Custom Interface!") | col.label(text="Custom Interface!") | ||||
| row = col.row() | row = col.row() | ||||
| row.prop(self, "my_float") | row.prop(self, "my_float") | ||||
| row.prop(self, "my_bool") | row.prop(self, "my_bool") | ||||
| col.prop(self, "my_string") | col.prop(self, "my_string") | ||||
| # Only needed if you want to add into a dynamic menu | |||||
| def menu_func(self, context): | |||||
| self.layout.operator(CustomDrawOperator.bl_idname, text="Custom Draw Operator") | |||||
| # Register and add to the object menu | |||||
lichtwerk: please add the //(required to use F3 search....// part here as well | |||||
| bpy.utils.register_class(CustomDrawOperator) | bpy.utils.register_class(CustomDrawOperator) | ||||
| bpy.types.VIEW3D_MT_object.append(menu_func) | |||||
| # test call | # test call | ||||
| bpy.ops.object.custom_draw('INVOKE_DEFAULT') | bpy.ops.object.custom_draw('INVOKE_DEFAULT') | ||||
please add the (required to use F3 search.... part here as well