3
$\begingroup$

I'd like to create an addon, which has some properties and a button. The addon should only does the scene modification when the button is clicked.

Currently my addon is placed into the specials menu of the curve. When I select it, its properties are displayed on the side panel and its execute() method is executed immediately.

I'd like to have a button under the properties on the side panel and to do the scene modification only when the button is clicked.

Where can I find an example for this use case?

$\endgroup$
4
$\begingroup$

You can also add an invoke method and call WindowManager.invoke_props_dialog:

def invoke(self, context, event):
    return context.window_manager.invoke_props_dialog(self)
$\endgroup$
  • $\begingroup$ I prefer this solution currently, because it was easy to adapt :) Ok it is not on the side panel but on a dialog, but it seems to be good for my case. $\endgroup$ – Endre Jul 16 '15 at 10:31
  • $\begingroup$ There is an issue with this. When I press OK on the dialog, the operator and its properties are also displayed on the side panel. Is it possible to deny it? $\endgroup$ – Endre Jul 16 '15 at 10:39
  • $\begingroup$ Don't use the REGISTER option in bl_options of your operator. See docs $\endgroup$ – pink vertex Jul 16 '15 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.