I am registering a global variable and I need it to be ignored by UNDO and I need functionality like:
do some operators
get some information from the operations
add the information to the variable
undo to before the operators
keep the information in the variable
import bpy
class test_vars(bpy.types.PropertyGroup):
val_1 = bpy.props.StringProperty(
name = "val_1",
description = "1",
default = "")
class DoSomethingWithVal(bpy.types.Operator):
bl_idname = "test.dosomethingwithval"
bl_label = "test"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
# do something
pass
return {'FINISHED'}
def register():
bpy.utils.register_class(DoSomethingWithVal)
bpy.utils.register_class(test_vars)
bpy.types.Scene.do_something_vars = bpy.props.PointerProperty(type = test_vars)
def unregister():
bpy.utils.unregister_class(DoSomethingWithVal)
del bpy.types.Scene.do_something_vars
if __name__ == "__main__":
register()
is it possible?