diff options
author | Jacques Guignot <guignot@wanadoo.fr> | 2004-06-08 11:27:37 +0400 |
---|---|---|
committer | Jacques Guignot <guignot@wanadoo.fr> | 2004-06-08 11:27:37 +0400 |
commit | 21580bf21c033c58477924df2c9852c16e107b68 (patch) | |
tree | e8b4689b630be66dc720c1671e2279a2e478d473 /source/blender/python/api2_2x/Object.c | |
parent | 25a0df8b711c4b7841342a069975681cba14fb33 (diff) |
new function for the Metaball objects : addMetaelem, which allows users to create Metaballs from python.
modified doc/Metaball.py to add this function
modified Object.c to allow the creation of Metaball objects
Diffstat (limited to 'source/blender/python/api2_2x/Object.c')
-rw-r--r-- | source/blender/python/api2_2x/Object.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index b0081cd046a..f828980257c 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -300,7 +300,7 @@ PyObject *M_Object_New(PyObject *self, PyObject *args) /* else if (strcmp (str_type, "Ika") == 0) type = OB_IKA; */ else if (strcmp (str_type, "Lamp") == 0) type = OB_LAMP; else if (strcmp (str_type, "Lattice") == 0) type = OB_LATTICE; -/* else if (strcmp (str_type, "Mball") == 0) type = OB_MBALL; */ + else if (strcmp (str_type, "Mball") == 0) type = OB_MBALL; else if (strcmp (str_type, "Mesh") == 0) type = OB_MESH; else if (strcmp (str_type, "Surf") == 0) type = OB_SURF; /* else if (strcmp (str_type, "Wave") == 0) type = OB_WAVE; */ @@ -627,6 +627,9 @@ int EXPP_add_obdata(struct Object *object) object->data = (void *)add_lattice(); object->dt = OB_WIRE; break; + case OB_MBALL: + object->data = add_mball(); + break; /* TODO the following types will be supported later case OB_SURF: @@ -636,9 +639,6 @@ int EXPP_add_obdata(struct Object *object) case OB_FONT: object->data = add_curve(OB_FONT); break; - case OB_MBALL: - object->data = add_mball(); - break; case OB_IKA: object->data = add_ika(); object->dt = OB_WIRE; @@ -1092,6 +1092,8 @@ static PyObject *Object_link (BPy_Object *self, PyObject *args) data = (void *)Mesh_FromPyObject (py_data, self->object); if (Lattice_CheckPyObject (py_data)) data = (void *)Lattice_FromPyObject (py_data); + if (Metaball_CheckPyObject (py_data)) + data = (void *)Metaball_FromPyObject (py_data); /* have we set data to something good? */ if( !data ) @@ -1148,6 +1150,13 @@ static PyObject *Object_link (BPy_Object *self, PyObject *args) "The 'link' object is incompatible with the base object")); } break; + case ID_MB: + if (self->object->type != OB_MBALL) + { + return (EXPP_ReturnPyObjError (PyExc_AttributeError, + "The 'link' object is incompatible with the base object")); + } + break; default: return (EXPP_ReturnPyObjError (PyExc_AttributeError, "Linking this object type is not supported")); |