From 1d468c75e708bd992d507db12925e0b185556791 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 22 Nov 2010 17:21:18 +0000 Subject: bugfix [#24805] bpy operator runs in wrong order or is ignored at all --- release/scripts/modules/bpy/ops.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'release/scripts/modules/bpy/ops.py') diff --git a/release/scripts/modules/bpy/ops.py b/release/scripts/modules/bpy/ops.py index 5b4adbdb23e..3d4156d0ca2 100644 --- a/release/scripts/modules/bpy/ops.py +++ b/release/scripts/modules/bpy/ops.py @@ -134,6 +134,16 @@ class bpy_ops_submodule_op(object): return C_dict, C_exec + @staticmethod + def _scene_update(context): + scene = context.scene + if scene: # None in backgroud mode + scene.update() + else: + for scene in bpy.data.scenes: + scene.update() + + __doc__ = property(_get_doc) def __init__(self, module, func): @@ -159,6 +169,9 @@ class bpy_ops_submodule_op(object): # Get the operator from blender wm = context.window_manager + # run to account for any rna values the user changes. + __class__._scene_update(context) + if args: C_dict, C_exec = __class__._parse_args(args) ret = op_call(self.idname_py(), C_dict, kw, C_exec) @@ -166,12 +179,7 @@ class bpy_ops_submodule_op(object): ret = op_call(self.idname_py(), None, kw) if 'FINISHED' in ret and context.window_manager == wm: - scene = context.scene - if scene: # None in backgroud mode - scene.update() - else: - for scene in bpy.data.scenes: - scene.update() + __class__._scene_update(context) return ret -- cgit v1.2.3