Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke widget when reloading scene #6

Open
gpogorzelski opened this issue Nov 19, 2020 · 7 comments
Open

Invoke widget when reloading scene #6

gpogorzelski opened this issue Nov 19, 2020 · 7 comments

Comments

@gpogorzelski
Copy link

gpogorzelski commented Nov 19, 2020

Hi, great tool. Instead of invoking the widget with a key combination I would like for it to happen whenever addon is loaded and I reload a scene. I tried to run it via Operator Search in the gui and by executing bpy.ops.object.dp_ot_draw_operator('EXEC_DEFAULT') in a persistent handler that I add in the register method - no success there. Any ideas? Thanks

@jayanam
Copy link
Owner

jayanam commented Nov 19, 2020 via email

@gpogorzelski
Copy link
Author

Hi, thanks for the answer but unfortunately when I call bpy.ops.object.dp_ot_draw_operator('EXEC_DEFAULT') in a persistent handler as in the documentation link you providede it doesn't work.

@jayanam
Copy link
Owner

jayanam commented Nov 20, 2020 via email

@jayanam
Copy link
Owner

jayanam commented Nov 20, 2020 via email

@gpogorzelski
Copy link
Author

Hi, please find a minimal working example here:
https://github.com/gpogorzelski/reload_scene_blender.git
I create a new dir in the addons dir and then copy it all there followed by addon install in blender and then simply start it with ctrl+shift+k. First button spawns the table, the second deletes all objects and reloads a scene (so you have to save a scene before pressing it). After the reload the widget does not appear.

And yes I did try INVOKE_DEFAULT. Still no success

@gpogorzelski
Copy link
Author

Also, how would you change the value of the text label in the DP_OT_draw_operator, from outside of the class? Say I want to change the label to the number of the currently displayed frame, how would I access the operator instance and its members?

@jayanam
Copy link
Owner

jayanam commented Nov 20, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants