- py-drivers were not using the name lookup cache.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 23 Feb 2010 16:40:55 +0000 (16:40 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 23 Feb 2010 16:40:55 +0000 (16:40 +0000)
- use manager context for keymap script.

release/scripts/ui/space_userpref.py
source/blender/python/intern/bpy_driver.c

index 329f795af89360204dfc984951621a94a588842e..ed0a1a429b15b4ff7480f68df46f8fbb391f3bb5 100644 (file)
@@ -1689,7 +1689,7 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
 
         __import__(config_name)
 
-        wm = bpy.data.window_managers[0]
+        wm = bpy.context.manager
         wm.active_keyconfig = wm.keyconfigs[config_name]
 
         return {'FINISHED'}
@@ -1731,7 +1731,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
         f.write("# Configuration %s\n" % name)
 
         f.write("import bpy\n\n")
-        f.write("wm = bpy.data.window_managers[0]\n")
+        f.write("wm = bpy.context.manager\n")
         f.write("kc = wm.add_keyconfig('%s')\n\n" % name)
 
         for km in kc.keymaps:
index 356abeeb40f32736b8eff812a63132b00236fc86..288b6edf87d5063316fc8d63fa4def8a6e92f65f 100644 (file)
@@ -207,6 +207,8 @@ float BPY_pydriver_eval (ChannelDriver *driver)
                for (dvar= driver->variables.first, i=0; dvar; dvar= dvar->next) {
                        PyTuple_SET_ITEM(expr_vars, i++, PyUnicode_InternFromString(dvar->name));
                }
+               
+               driver->flag &= ~DRIVER_FLAG_RENAMEVAR;
        }
        else {
                expr_vars= PyTuple_GET_ITEM(((PyObject *)driver->expr_comp), 1);