forked from bartvdbraak/blender
avoid using exec()
This commit is contained in:
parent
43500c9e14
commit
2eddf083e1
@ -85,7 +85,9 @@ class ExecutePreset(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
# change the menu title to the most recently chosen option
|
# change the menu title to the most recently chosen option
|
||||||
exec("bpy.types.%s.bl_label=\'%s\'" % (self.properties.menu_idname, self.properties.preset_name))
|
preset_class = getattr(bpy.types, self.properties.menu_idname)
|
||||||
|
preset_class.bl_label = self.properties.preset_name
|
||||||
|
print(10)
|
||||||
|
|
||||||
# execute the preset using script.python_file_run
|
# execute the preset using script.python_file_run
|
||||||
bpy.ops.script.python_file_run(path=self.properties.path)
|
bpy.ops.script.python_file_run(path=self.properties.path)
|
||||||
|
Loading…
Reference in New Issue
Block a user