* Fix compilation errors on Windows hopefully. Implemented the suggestion done

by Aphex - thanks.
* Added the doc strings to the Object module.
* Added more functionality to the Object module.
This commit is contained in:
2003-06-02 20:15:50 +00:00
parent 271dc5aaf1
commit a127b38760
24 changed files with 326 additions and 96 deletions

View File

@@ -36,6 +36,8 @@
#include <stdio.h>
#include <BDR_editobject.h>
#include <BKE_armature.h>
#include <BKE_curve.h>
#include <BKE_global.h>
#include <BKE_library.h>
#include <BKE_main.h>
@@ -44,6 +46,7 @@
#include <BKE_scene.h>
#include <BLI_arithb.h>
#include <BLI_blenlib.h>
#include <DNA_armature_types.h>
#include <DNA_ID.h>
#include <DNA_ika_types.h>
#include <DNA_listBase.h>
@@ -155,53 +158,73 @@ static PyObject *Object_shareFrom (C_Object *self, PyObject *args);
static PyMethodDef C_Object_methods[] = {
/* name, method, flags, doc */
{"clrParent", (PyCFunction)Object_clrParent, METH_VARARGS,
"(x) - "},
"Clears parent object. Optionally specify:\n\
mode\n\t2: Keep object transform\nfast\n\t>0: Don't update scene \
hierarchy (faster)"},
{"getData", (PyCFunction)Object_getData, METH_NOARGS,
"(x) - "},
"Returns the datablock object containing the object's data, \
e.g. Mesh"},
{"getDeformData", (PyCFunction)Object_getDeformData, METH_NOARGS,
"(x) - "},
"Returns the datablock object containing the object's deformed \
data.\nCurrently, this is only supported for a Mesh"},
{"getDeltaLocation", (PyCFunction)Object_getDeltaLocation, METH_NOARGS,
"(x) - "},
"Returns the object's delta location (x, y, z)"},
{"getDrawMode", (PyCFunction)Object_getDrawMode, METH_NOARGS,
"(x) - "},
"Returns the object draw modes"},
{"getDrawType", (PyCFunction)Object_getDrawType, METH_NOARGS,
"(x) - "},
"Returns the object draw type"},
{"getEuler", (PyCFunction)Object_getEuler, METH_NOARGS,
"(x) - "},
"Returns the object's rotation as Euler rotation vector\n\
(rotX, rotY, rotZ)"},
{"getInverseMatrix", (PyCFunction)Object_getInverseMatrix, METH_NOARGS,
"(x) - "},
"Returns the object's inverse matrix"},
{"getLocation", (PyCFunction)Object_getLocation, METH_VARARGS,
"(x) - "},
"Returns the object's location (x, y, z)"},
{"getMaterials", (PyCFunction)Object_getMaterials, METH_NOARGS,
"(x) - "},
"Returns list of materials assigned to the object"},
{"getMatrix", (PyCFunction)Object_getMatrix, METH_NOARGS,
"(x) - "},
"Returns the object matrix"},
{"getParent", (PyCFunction)Object_getParent, METH_NOARGS,
"(x) - "},
"Returns the object's parent object"},
{"getTracked", (PyCFunction)Object_getTracked, METH_NOARGS,
"(x) - "},
"Returns the object's tracked object"},
{"getType", (PyCFunction)Object_getType, METH_NOARGS,
"(x) - "},
"Returns type of string of Object"},
{"link", (PyCFunction)Object_link, METH_VARARGS,
"(x) - "},
"Links Object with data provided in the argument. The data must \n\
match the Object's type, so you cannot link a Lamp to a Mesh type object."},
{"makeParent", (PyCFunction)Object_makeParent, METH_VARARGS,
"(x) - "},
"Makes the object the parent of the objects provided in the \n\
argument which must be a list of valid Objects. Optional extra arguments:\n\
mode:\n\t0: make parent with inverse\n\t1: without inverse\n\
fase:\n\t0: update scene hierarchy automatically\n\t\
don't update scene hierarchy (faster). In this case, you must\n\t\
explicitely update the Scene hierarchy."},
{"materialUsage", (PyCFunction)Object_materialUsage, METH_VARARGS,
"(x) - "},
"Determines the way the material is used and returs status.\n\
Possible arguments (provide as strings):\n\
\tData: Materials assigned to the object's data are shown. (default)\n\
\tObject: Materials assigned to the object are shown."},
{"setDeltaLocation", (PyCFunction)Object_setDeltaLocation, METH_VARARGS,
"(x) - "},
"Sets the object's delta location which must be a vector triple."},
{"setDrawMode", (PyCFunction)Object_setDrawMode, METH_VARARGS,
"(x) - "},
"Sets the object's drawing mode. The argument can be a sum of:\n\
2: axis\n4: texspace\n8: drawname\n16: drawimage\n32: drawwire"},
{"setDrawType", (PyCFunction)Object_setDrawType, METH_VARARGS,
"(x) - "},
"Sets the object's drawing type. The argument must be one of:\n\
1: Bounding box\n2: Wire\n3: Solid\n4: Shaded\n5: Textured"},
{"setEuler", (PyCFunction)Object_setEuler, METH_VARARGS,
"(x) - "},
"Set the object's rotation according to the specified Euler\n\
angles. The argument must be a vector triple"},
{"setLocation", (PyCFunction)Object_setLocation, METH_VARARGS,
"(x) - "},
"Set the object's location. The first argument must be a vector\n\
triple."},
{"setMaterials", (PyCFunction)Object_setMaterials, METH_VARARGS,
"(x) - "},
"Sets materials. The argument must be a list of valid material\n\
objects."},
{"shareFrom", (PyCFunction)Object_shareFrom, METH_VARARGS,
"(x) - "},
"Link data of self with object specified in the argument. This\n\
works only if self and the object specified are of the same type."},
};
/*****************************************************************************/
@@ -218,7 +241,7 @@ static PyObject* ObjectRepr (C_Object *obj);
/*****************************************************************************/
PyTypeObject Object_Type =
{
PyObject_HEAD_INIT(&PyType_Type)
PyObject_HEAD_INIT(NULL)
0, /* ob_size */
"Object", /* tp_name */
sizeof (C_Object), /* tp_basicsize */