Hello guys, I would like to ask you something that most definitely you came across. I have created a panel in which i have several operators. They all act at the same object so i define global variables inside the operators for convenience. The problem i am facing is the following.
Lets suppose that in operator “Op1” i have:
Then i run “Op2” that uses the variable x and it runs with no error but i don’t like the result.
I click undo.
Finally, i try rerunning “Op2” but x is no longer a defined variable so i receive an error. Both operators have in bl_options UNDO.
A quick solution would be to define a function as:
if “some object” in bpy.context.scene.objects:
and call the function from every operator but that does not work with numbers for example.
How can i avoid that?