Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillian Padovani Germano <wpgermano@gmail.com>2003-06-12 08:51:50 +0400
committerWillian Padovani Germano <wpgermano@gmail.com>2003-06-12 08:51:50 +0400
commit6cc45538efefe1062aa0bc0909903af3db5d338d (patch)
tree64cb07ec5761c70f06ac15c2d4633dd9602cbcb0 /source/blender/python/api2_2x/Types.c
parented6885d72891c63c39bb63a0eb936b454fef753c (diff)
* Small changes in many files:
- Trying to fix linking problems in OSX; - Making module .Get functions behave like the ones in Blender 2.25 - 2.27 (Guignot pointed the incompatibility); - Included more types to Blender.Types; - Found by luck and corrected two bugs that were making Blender crash; - Added/updated some simple functions.
Diffstat (limited to 'source/blender/python/api2_2x/Types.c')
-rw-r--r--source/blender/python/api2_2x/Types.c51
1 files changed, 33 insertions, 18 deletions
diff --git a/source/blender/python/api2_2x/Types.c b/source/blender/python/api2_2x/Types.c
index 7aa5c64ed14..2a22c59c014 100644
--- a/source/blender/python/api2_2x/Types.c
+++ b/source/blender/python/api2_2x/Types.c
@@ -40,35 +40,50 @@ PyObject *M_Types_Init (void)
{
PyObject *submodule, *dict;
- submodule = Py_InitModule3("Blender.Types", Null_methods, M_Types_doc);
+ /* These are only set when some object initializes them. But unless we
+ * do it now, we get two easy ways to crash Blender. Maybe we'd better
+ * have an Init function for all these internal types that more than one
+ * module can use. We could call it after setting the Blender dictionary */
+ vector_Type.ob_type = &PyType_Type;
+ rgbTuple_Type.ob_type = &PyType_Type;
+ constant_Type.ob_type = &PyType_Type;
- dict = PyModule_GetDict(submodule);
+ submodule = Py_InitModule3 ("Blender.Types", Null_methods, M_Types_doc);
+
+ dict = PyModule_GetDict(submodule);
/* The Blender Object Type */
- PyDict_SetItemString(dict, "ObjectType", (PyObject *)&Object_Type);
+ PyDict_SetItemString(dict, "ObjectType", (PyObject *)&Object_Type);
/* Blender Object Data Types */
- PyDict_SetItemString(dict, "NMeshType", (PyObject *)&NMesh_Type);
- PyDict_SetItemString(dict, "NMFaceType", (PyObject *)&NMFace_Type);
- PyDict_SetItemString(dict, "NMVertType", (PyObject *)&NMVert_Type);
- PyDict_SetItemString(dict, "NMColType", (PyObject *)&NMCol_Type);
+ PyDict_SetItemString(dict, "NMeshType", (PyObject *)&NMesh_Type);
+ PyDict_SetItemString(dict, "NMFaceType", (PyObject *)&NMFace_Type);
+ PyDict_SetItemString(dict, "NMVertType", (PyObject *)&NMVert_Type);
+ PyDict_SetItemString(dict, "NMColType", (PyObject *)&NMCol_Type);
+
+ PyDict_SetItemString(dict, "ArmatureType", (PyObject *)&Armature_Type);
+ PyDict_SetItemString(dict, "BoneType", (PyObject *)&Bone_Type);
+
+ PyDict_SetItemString(dict, "CurveType", (PyObject *)&Curve_Type);
+ PyDict_SetItemString(dict, "IpoType", (PyObject *)&Ipo_Type);
+ PyDict_SetItemString(dict, "MetaballType", (PyObject *)&Metaball_Type);
- PyDict_SetItemString(dict, "CameraType", (PyObject *)&Camera_Type);
- PyDict_SetItemString(dict, "ImageType", (PyObject *)&Image_Type);
- PyDict_SetItemString(dict, "LampType", (PyObject *)&Lamp_Type);
- PyDict_SetItemString(dict, "TextType", (PyObject *)&Text_Type);
+ PyDict_SetItemString(dict, "CameraType", (PyObject *)&Camera_Type);
+ PyDict_SetItemString(dict, "ImageType", (PyObject *)&Image_Type);
+ PyDict_SetItemString(dict, "LampType", (PyObject *)&Lamp_Type);
+ PyDict_SetItemString(dict, "TextType", (PyObject *)&Text_Type);
+ PyDict_SetItemString(dict, "MaterialType", (PyObject *)&Material_Type);
- PyDict_SetItemString(dict, "ButtonType", (PyObject *)&Button_Type);
- PyDict_SetItemString(dict, "MaterialType",(PyObject *)&Material_Type);
+ PyDict_SetItemString(dict, "ButtonType", (PyObject *)&Button_Type);
/* External helper Types available to the main ones above */
- PyDict_SetItemString(dict, "vectorType", (PyObject *)&vector_Type);
- PyDict_SetItemString(dict, "bufferType", (PyObject *)&buffer_Type);
- PyDict_SetItemString(dict, "constantType", (PyObject *)&constant_Type);
- PyDict_SetItemString(dict, "rgbTupleType", (PyObject *)&rgbTuple_Type);
+ PyDict_SetItemString(dict, "vectorType", (PyObject *)&vector_Type);
+ PyDict_SetItemString(dict, "bufferType", (PyObject *)&buffer_Type);
+ PyDict_SetItemString(dict, "constantType", (PyObject *)&constant_Type);
+ PyDict_SetItemString(dict, "rgbTupleType", (PyObject *)&rgbTuple_Type);
- return (submodule);
+ return submodule;
}