diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2003-07-13 20:28:17 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2003-07-13 20:28:17 +0400 |
commit | 9cb79c6534ae4a1c51571d59fe93d41706cd2dc3 (patch) | |
tree | 5c87e1c30b9efe4f778969dbcd51badaa347cb21 | |
parent | 08b6d716b0d09a95cd793f61736866e12f8dc01a (diff) |
Exppython:
- "last minute" updates to documentation and two modules.
-rw-r--r-- | source/blender/python/api2_2x/Material.c | 36 | ||||
-rw-r--r-- | source/blender/python/api2_2x/NMesh.c | 8 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Scene.c | 2 | ||||
-rw-r--r-- | source/blender/python/api2_2x/doc/Blender.py | 4 | ||||
-rw-r--r-- | source/blender/python/api2_2x/doc/Material.py | 17 | ||||
-rw-r--r-- | source/blender/python/api2_2x/doc/NMesh.py | 12 |
6 files changed, 34 insertions, 45 deletions
diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c index d6a42e17cda..28317600bbd 100644 --- a/source/blender/python/api2_2x/Material.c +++ b/source/blender/python/api2_2x/Material.c @@ -318,7 +318,7 @@ PyObject *Material_Init (void) static PyObject *Material_getName(BPy_Material *self); static PyObject *Material_getMode(BPy_Material *self); static PyObject *Material_getRGBCol(BPy_Material *self); -static PyObject *Material_getAmbCol(BPy_Material *self); +/*static PyObject *Material_getAmbCol(BPy_Material *self);*/ static PyObject *Material_getSpecCol(BPy_Material *self); static PyObject *Material_getMirCol(BPy_Material *self); static PyObject *Material_getAmb(BPy_Material *self); @@ -344,7 +344,7 @@ static PyObject *Material_setName(BPy_Material *self, PyObject *args); static PyObject *Material_setMode(BPy_Material *self, PyObject *args); static PyObject *Material_setIntMode(BPy_Material *self, PyObject *args); static PyObject *Material_setRGBCol(BPy_Material *self, PyObject *args); -static PyObject *Material_setAmbCol(BPy_Material *self, PyObject *args); +/*static PyObject *Material_setAmbCol(BPy_Material *self, PyObject *args);*/ static PyObject *Material_setSpecCol(BPy_Material *self, PyObject *args); static PyObject *Material_setMirCol(BPy_Material *self, PyObject *args); static PyObject *Material_setAmb(BPy_Material *self, PyObject *args); @@ -381,8 +381,8 @@ static PyMethodDef BPy_Material_methods[] = { "() - Return Material mode flags"}, {"getRGBCol", (PyCFunction)Material_getRGBCol, METH_NOARGS, "() - Return Material's rgb color triplet"}, - {"getAmbCol", (PyCFunction)Material_getAmbCol, METH_NOARGS, - "() - Return Material's ambient color"}, +/* {"getAmbCol", (PyCFunction)Material_getAmbCol, METH_NOARGS, + "() - Return Material's ambient color"},*/ {"getSpecCol", (PyCFunction)Material_getSpecCol, METH_NOARGS, "() - Return Material's specular color"}, {"getMirCol", (PyCFunction)Material_getMirCol, METH_NOARGS, @@ -432,8 +432,8 @@ static PyMethodDef BPy_Material_methods[] = { "([s[,s]]) - Set Material mode flag(s)"}, {"setRGBCol", (PyCFunction)Material_setRGBCol, METH_VARARGS, "(f,f,f or [f,f,f]) - Set Material's rgb color triplet"}, - {"setAmbCol", (PyCFunction)Material_setAmbCol, METH_VARARGS, - "(f,f,f or [f,f,f]) - Set Material's ambient color"}, +/* {"setAmbCol", (PyCFunction)Material_setAmbCol, METH_VARARGS, + "(f,f,f or [f,f,f]) - Set Material's ambient color"},*/ {"setSpecCol", (PyCFunction)Material_setSpecCol, METH_VARARGS, "(f,f,f or [f,f,f]) - Set Material's specular color"}, {"setMirCol", (PyCFunction)Material_setMirCol, METH_VARARGS, @@ -610,12 +610,12 @@ static PyObject *Material_getRGBCol(BPy_Material *self) { return rgbTuple_getCol(self->col); } - +/* static PyObject *Material_getAmbCol(BPy_Material *self) { return rgbTuple_getCol(self->amb); } - +*/ static PyObject *Material_getSpecCol(BPy_Material *self) { return rgbTuple_getCol(self->spec); @@ -928,12 +928,12 @@ static PyObject *Material_setRGBCol (BPy_Material *self, PyObject *args) { return rgbTuple_setCol(self->col, args); } - +/* static PyObject *Material_setAmbCol (BPy_Material *self, PyObject *args) { return rgbTuple_setCol(self->amb, args); } - +*/ static PyObject *Material_setSpecCol (BPy_Material *self, PyObject *args) { return rgbTuple_setCol(self->spec, args); @@ -1249,8 +1249,8 @@ static PyObject *Material_getAttr (BPy_Material *self, char *name) attr = PyInt_FromLong(self->material->mode); else if (strcmp(name, "rgbCol") == 0) attr = Material_getRGBCol(self); - else if (strcmp(name, "ambCol") == 0) - attr = Material_getAmbCol(self); +/* else if (strcmp(name, "ambCol") == 0) + attr = Material_getAmbCol(self);*/ else if (strcmp(name, "specCol") == 0) attr = Material_getSpecCol(self); else if (strcmp(name, "mirCol") == 0) @@ -1301,10 +1301,10 @@ static PyObject *Material_getAttr (BPy_Material *self, char *name) attr = PyInt_FromLong((long)self->material->ringc); else if (strcmp(name, "__members__") == 0) { - attr = /* 28 items */ - Py_BuildValue("[s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s]", - "name", "mode", "rgbCol", "ambCol", "specCol", "mirCol", - "R", "G", "B", "alpha", "amb", "emit", "ref", "spec", + attr = /* 27 items */ + Py_BuildValue("[s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s]", + "name", "mode", "rgbCol", "specCol", "mirCol", + "R", "G", "B", "alpha", "amb", "emit", "ref", "spec", "specTransp", "add", "zOffset", "haloSize", "haloSeed", "flareSize", "flareBoost", "flareSeed", "subSize", "hard", "nFlares", "nStars", "nLines", "nRings"); @@ -1351,8 +1351,8 @@ static int Material_setAttr (BPy_Material *self, char *name, PyObject *value) error = Material_setIntMode (self, valtuple); /* special case */ else if (strcmp (name, "rgbCol") == 0) error = Material_setRGBCol (self, valtuple); - else if (strcmp (name, "ambCol") == 0) - error = Material_setAmbCol (self, valtuple); +/* else if (strcmp (name, "ambCol") == 0) + error = Material_setAmbCol (self, valtuple);*/ else if (strcmp (name, "specCol") == 0) error = Material_setSpecCol (self, valtuple); else if (strcmp (name, "mirCol") == 0) diff --git a/source/blender/python/api2_2x/NMesh.c b/source/blender/python/api2_2x/NMesh.c index 6eb092593c3..8dfa75a8566 100644 --- a/source/blender/python/api2_2x/NMesh.c +++ b/source/blender/python/api2_2x/NMesh.c @@ -749,6 +749,10 @@ static PyObject *NMesh_getVertexInfluences(PyObject *self, PyObject *args) /* Get a reference to the mesh object wrapped in here. */ Mesh *me = ((BPy_NMesh*)self)->mesh; + if (!me) + return EXPP_ReturnPyObjError (PyExc_RuntimeError, + "unlinked nmesh: call its .update() method first"); + /* Parse the parameters: only on integer (vertex index) */ if (!PyArg_ParseTuple(args, "i", &index)) return EXPP_ReturnPyObjError (PyExc_TypeError, @@ -787,9 +791,7 @@ static PyObject *NMesh_getVertexInfluences(PyObject *self, PyObject *args) } else influence_list = PyList_New(0); - /* Return the list. !QUESTION! Should i reincrement the number of - * references like i'm doing? */ - return influence_list; /* No need to incref it */ + return influence_list; } Mesh *Mesh_fromNMesh(BPy_NMesh *nmesh) diff --git a/source/blender/python/api2_2x/Scene.c b/source/blender/python/api2_2x/Scene.c index cf5254601e2..573f797aa7e 100644 --- a/source/blender/python/api2_2x/Scene.c +++ b/source/blender/python/api2_2x/Scene.c @@ -24,7 +24,7 @@ * * This is a new part of Blender. * - * Contributor(s): Willian P. Germano + * Contributor(s): Willian P. Germano, Jacques Guignot * * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ diff --git a/source/blender/python/api2_2x/doc/Blender.py b/source/blender/python/api2_2x/doc/Blender.py index 1f715993cc5..9a104eda699 100644 --- a/source/blender/python/api2_2x/doc/Blender.py +++ b/source/blender/python/api2_2x/doc/Blender.py @@ -6,7 +6,8 @@ # epydoc -t Blender.py -n "Blender" --no-private --no-frames Blender.py \ # Camera.py Lamp.py Material.py BGL.py Window.py Text.py Image.py NMesh.py \ -# Scene.py Draw.py Armature.py Types.py Curve.py Effect.py Ipo.py Metaball.py +# Scene.py Draw.py Armature.py Types.py Curve.py Effect.py Ipo.py Metaball.py \ +# World.py """ This is the main Blender module. @@ -31,6 +32,7 @@ Blender Python - L{Effect} - L{Curve} - L{Ipo} + - L{World} - L{BGL} - L{Window} - L{Draw} diff --git a/source/blender/python/api2_2x/doc/Material.py b/source/blender/python/api2_2x/doc/Material.py index 9b42affb83f..07a5c6fa68c 100644 --- a/source/blender/python/api2_2x/doc/Material.py +++ b/source/blender/python/api2_2x/doc/Material.py @@ -85,7 +85,6 @@ class Material: @cvar mode: Mode flags as an or'ed int value. See the Modes dictionary keys and descriptions in L{Modes}. @cvar rgbCol: Material's RGB color triplet. - @cvar ambCol: Ambient color rgb triplet. @cvar specCol: Specular color rgb triplet. @cvar mirCol: Mirror color rgb triplet. @cvar R: Red component of L{rgbCol} - [0.0, 1.0]. @@ -172,22 +171,6 @@ class Material: - three floats as separate parameters: setRGBCol (r,g,b). """ - def getAmbCol(): - """ - Get the ambient color triplet. - @rtype: list of 3 floats - @return: [ambR, ambG, ambB] - """ - - def setAmbCol(rgb = None): - """ - Set the ambient color triplet. If B{rgb} is None, set the color to black. - @type rgb: three floats or a list of three floats - @param rgb: The rgb color values in [0.0, 1.0] as: - - a list of three floats: setAmbCol ([r, g, b]) B{or} - - three floats as separate parameters: setAmbCol (r,g,b). - """ - def getSpecCol(): """ Get the specular color triplet. diff --git a/source/blender/python/api2_2x/doc/NMesh.py b/source/blender/python/api2_2x/doc/NMesh.py index d1ffc0059c4..d0e4a903c3e 100644 --- a/source/blender/python/api2_2x/doc/NMesh.py +++ b/source/blender/python/api2_2x/doc/NMesh.py @@ -27,11 +27,11 @@ Example:: @type FaceFlags: readonly dictionary @type FaceModes: readonly dictionary @type FaceTranspModes: readonly dictionary -@var FaceFlags: The available face selection flags: +@var FaceFlags: The available face selection flags. - SELECT - selected. - HIDE - hidden. - ACTIVE - the active face. -@var FaceModes: The available face modes: +@var FaceModes: The available face modes. - ALL - set all modes at once. - BILLBOARD - always orient after camera. - HALO - halo face, always point to camera. @@ -45,8 +45,8 @@ Example:: - TEX - has texture image. - TILES - uses tiled image. - TWOSIDE - two-sided face. -@var FaceTranspModes: Note: these are ENUMS, they can't be combined (and'ed, - or'ed, etc) like a bit vector. The available face transparency modes: +@var FaceTranspModes: The available face transparency modes. Note: these are + ENUMS, they can't be combined (and'ed, or'ed, etc) like a bit vector. - SOLID - draw solid. - ADD - add to background (halo). - ALPHA - draw with transparency. @@ -270,7 +270,9 @@ class NMesh : def insertKey(frame = None): """ - Insert a mesh key at the given frame. + Insert a mesh key at the given frame. Remember to L{update} the nmesh + before doing this, or changes in the vertices won't be updated in the + Blender mesh. @type frame: int @param frame: The Scene frame where the mesh key should be inserted. If None, the current frame is used. |