import all math funcs (sin/cos/tan/e... etc) by default into buttons and drivers
authorCampbell Barton <ideasman42@gmail.com>
Mon, 3 Dec 2007 16:43:58 +0000 (16:43 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 3 Dec 2007 16:43:58 +0000 (16:43 +0000)
source/blender/python/BPY_interface.c

index 9c8203cf3fdeadaaab01182aa5b8c90be28c2aff..a56a14b3db9a6cde2b1ae77743529b943832a712 100644 (file)
@@ -1071,10 +1071,15 @@ static int bpy_pydriver_create_dict(void)
 
        mod = PyImport_ImportModule("math");
        if (mod) {
+               PyDict_Merge(d, PyModule_GetDict(mod), 0); /* 0 - dont overwrite existing values */
+               
+               /* Only keep for backwards compat! - just import all math into root, they are standard */
                PyDict_SetItemString(d, "math", mod);
                PyDict_SetItemString(d, "m", mod);
                Py_DECREF(mod);
-       }
+       } 
+       
+       
 
        mod = PyImport_ImportModule("Blender.Noise");
        if (mod) {