Mostly I need is an easy way to bind an operator, so I make this changes.
It can automatically get the info from the given operator idname and bind it to the button and allow input property settings.
And less code to define a simple button
Old
self.button3 = BL_UI_Button((btnX + ((btnW - 1 + btnG) * btnC)), btnY, btnW, btnH)
self.button3.style = 'RADIO'
self.button3.text = "ADD"
self.button3.text_size = 13
self.button3.rounded_corners = (0, 0, 0, 0)
self.button3.set_mouse_up(self.button3_click)
self.button3.set_button_pressed(self.button3_pressed)
self.button3.description = "Adds one little 'MONKEY' object to 3D View area"
self.button3.python_cmd = "bpy.ops.object.dp_ot_draw_operator.button3_click()"
if self.button3_pressed(self.button3):
self.button3.state = 3
Mostly I need is an easy way to bind an operator, so I make this changes. It can automatically get the info from the given operator idname and bind it to the button and allow input property settings. And less code to define a simple button
Old
New