Doc for the world module. Got rid of some unuseful fields in World module.

The last doc  ;-))
This commit is contained in:
2003-07-12 20:48:56 +00:00
parent 6046d05a7e
commit 65237d2936
2 changed files with 233 additions and 187 deletions

View File

@@ -265,8 +265,6 @@ static PyObject *World_setName(BPy_World *self, PyObject *args)
"expected string argument")); "expected string argument"));
puts(name); puts(name);
snprintf(buf, sizeof(buf), "%s", name); snprintf(buf, sizeof(buf), "%s", name);
puts("mlmlml");
rename_id(&self->world->id, buf); rename_id(&self->world->id, buf);
Py_INCREF(Py_None); Py_INCREF(Py_None);
@@ -274,76 +272,6 @@ static PyObject *World_setName(BPy_World *self, PyObject *args)
} }
/**
* \brief World PyMethod getColormodel
*
* \return int : The World Data colormodel.
*/
static PyObject *World_getColormodel(BPy_World *self)
{
PyObject *attr = PyInt_FromLong((long)self->world->colormodel);
if (attr) return attr;
return (EXPP_ReturnPyObjError (PyExc_RuntimeError,
"couldn't get World.colormodel attribute"));
}
/**
* \brief World PyMethod setColormodel
*
* \return int : The World Data colormodel.
*/
static PyObject *World_setColormodel(BPy_World *self, PyObject *args )
{
int colormodel;
if (!PyArg_ParseTuple(args, "i", &colormodel))
return (EXPP_ReturnPyObjError (PyExc_TypeError,
"expected int argument"));
self->world->colormodel = colormodel;
Py_INCREF(Py_None);
return Py_None;
}
/**
* \brief World PyMethod getFastcol
*
* \return int : The World Data fastcol.
*/
static PyObject *World_getFastcol(BPy_World *self)
{
PyObject *attr = PyInt_FromLong((long)self->world->fastcol);
if (attr) return attr;
return (EXPP_ReturnPyObjError (PyExc_RuntimeError,
"couldn't get World.fastcol attribute"));
}
/**
* \brief World PyMethod setFastcol
*
* \return int : The World Data fastcol.
*/
static PyObject *World_setFastcol(BPy_World *self, PyObject *args )
{
int fastcol;
if (!PyArg_ParseTuple(args, "i", &fastcol))
return (EXPP_ReturnPyObjError (PyExc_TypeError,
"expected int argument"));
self->world->fastcol = fastcol;
Py_INCREF(Py_None);
return Py_None;
}
@@ -431,87 +359,6 @@ static PyObject *World_setMode(BPy_World *self, PyObject *args )
/**
* \brief World PyMethod getTotex
*
* \return int : The World Data totex.
*/
static PyObject *World_getTotex(BPy_World *self)
{
PyObject *attr = PyInt_FromLong((long)self->world->totex);
if (attr) return attr;
return (EXPP_ReturnPyObjError (PyExc_RuntimeError,
"couldn't get World.totex attribute"));
}
/**
* \brief World PyMethod setTotex
*
* \return int : The World Data totex.
*/
static PyObject *World_setTotex(BPy_World *self, PyObject *args )
{
int totex;
if (!PyArg_ParseTuple(args, "i", &totex))
return (EXPP_ReturnPyObjError (PyExc_TypeError,
"expected int argument"));
self->world->totex = totex;
Py_INCREF(Py_None);
return Py_None;
}
/**
* \brief World PyMethod getTexact
*
* \return int : The World Data texact.
*/
static PyObject *World_getTexact(BPy_World *self)
{
PyObject *attr = PyInt_FromLong((long)self->world->texact);
if (attr) return attr;
return (EXPP_ReturnPyObjError (PyExc_RuntimeError,
"couldn't get World.texact attribute"));
}
/**
* \brief World PyMethod setTexact
*
* \return int : The World Data texact.
*/
static PyObject *World_setTexact(BPy_World *self, PyObject *args )
{
int texact;
if (!PyArg_ParseTuple(args, "i", &texact))
return (EXPP_ReturnPyObjError (PyExc_TypeError,
"expected int argument"));
self->world->texact = texact;
Py_INCREF(Py_None);
return Py_None;
}
/** /**
* \brief World PyMethod getMistype * \brief World PyMethod getMistype
* *
@@ -551,10 +398,6 @@ static PyObject *World_setMistype(BPy_World *self, PyObject *args )
static PyObject *World_getHor(BPy_World *self) static PyObject *World_getHor(BPy_World *self)
{ {
PyObject *attr = PyList_New(0); PyObject *attr = PyList_New(0);
@@ -679,36 +522,6 @@ static PyObject *World_setStar(BPy_World *self, PyObject *args )
static PyObject *World_getDof(BPy_World *self)
{
PyObject *attr = PyList_New(0);
if (!attr)
return (EXPP_ReturnPyObjError (PyExc_RuntimeError, "couldn't create list"));
PyList_Append(attr, PyFloat_FromDouble(self->world->dofsta));
PyList_Append(attr, PyFloat_FromDouble(self->world->dofend));
PyList_Append(attr, PyFloat_FromDouble(self->world->dofmin));
PyList_Append(attr, PyFloat_FromDouble(self->world->dofmax));
return attr;
}
static PyObject *World_setDof(BPy_World *self, PyObject *args )
{
PyObject *listargs=0;
if (!PyArg_ParseTuple(args, "O", &listargs))
return (EXPP_ReturnPyObjError (PyExc_TypeError,"expected list argument"));
if (!PyList_Check(listargs))
return (EXPP_ReturnPyObjError (PyExc_TypeError,"expected list argument"));
if (PyList_Size(listargs)!=4)
return (EXPP_ReturnPyObjError (PyExc_TypeError,"wrong list size"));
self->world->dofsta = PyFloat_AsDouble(PyList_GetItem(listargs,0));
self->world->dofend = PyFloat_AsDouble(PyList_GetItem(listargs,1));
self->world->dofmin = PyFloat_AsDouble(PyList_GetItem(listargs,2));
self->world->dofmax= PyFloat_AsDouble(PyList_GetItem(listargs,3));
Py_INCREF(Py_None);
return Py_None;
}

View File

@@ -0,0 +1,233 @@
# Blender.World module and the World PyType
"""
The Blender.World submodule
INTRODUCTION
The module world allows you to access all the data of an world.
Example::
import Blender
w = Blender.Get('World') #assume there exists a world named "world"
print w.GetName()
w.hor = [1,1,.2]
print w.Gethor()
"""
def New (name):
"""
Creates a new World.
@type name: string
@param name: World's name (optionnal).
@rtype: Blender World
@return: The created World. If the "name" paraeter has not been provided, it will be automatically be set by blender.
"""
def Get (name):
"""
Get an World from Blender.
@type name: string
@param name: The name of the world to retrieve.
@rtype: Blender World or a list of Blender Worlds
@return:
- (name): The World corresponding to the name
- (): A list with all Worlds in the current scene.
"""
class World:
"""
The World object
================
This object gives access to generic data from all worlds in Blender.
Its attributes depend upon its type.
@cvar name: the name of the world.
@cvar skytype: type of the sky. Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
@cvar mode:
@cvar mistype: type of mist : O : quadratic; 1 : linear; 2 : square
@cvar hor: the horizon color of a world object.
@cvar zen: the zenith color of a world object.
@cvar amb: the ambient color of a world object.
@cvar star: the star parameters of a world object. See getStar for the semantics of these parameters.
@cvar mist: the mist parameters of a world object. See getMist for the semantics of these parameters.
"""
def getName():
"""
Retreives the name of an world object
@rtype: string
@return: the name of the world object.
"""
def setName(name):
"""
Sets the name of a world object.
@type name: string
@param name : the new name.
@rtype: PyNone
@return: PyNone
"""
def getSkytype():
"""
Retreives the skytype of a world object.
The skytype is a combination of 3 bits : Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
@rtype: int
@return: the skytype of the world object.
"""
def setSkytype(skytype):
"""
Sets the skytype of a world object.
See getSkytype for the semantics of the parameter.
@type skytype: int
@param skytype : the new skytype.
@rtype: PyNone
@return: PyNone
"""
def getMode():
"""
Retreives the mode of a world object.
The mode is a combination of 3 bits : Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
@rtype: int
@return: the mode of the world object.
"""
def setMode(mode):
"""
Sets the mode of a world object.
See getMode for the semantics of the parameter.
@type mode: int
@param mode : the new mode.
@rtype: PyNone
@return: PyNone
"""
def getMistype():
"""
Retreives the mist type of a world object.
The mist type is an integer 0 : quadratic; 1 : linear; 2 : square.
@rtype: int
@return: the mistype of the world object.
"""
def setMistype(mistype):
"""
Sets the mist type of a world object.
See getMistype for the semantics of the parameter.
@type mistype: int
@param mistype : the new mist type.
@rtype: PyNone
@return: PyNone
"""
def getHor():
"""
Retreives the horizon color of a world object.
This color is a list of 3 floats.
@rtype: list of three floats
@return: the horizon color of the world object.
"""
def setHor(hor):
"""
Sets the horizon color of a world object.
@type hor: list of three floats
@param hor : the new hor.
@rtype: PyNone
@return: PyNone
"""
def getZen():
"""
Retreives the zenith color of a world object.
This color is a list of 3 floats.
@rtype: list of three floats
@return: the zenith color of the world object.
"""
def setZen(zen):
"""
Sets the zenith color of a world object.
@type zen: list of three floats
@param zen : the new zenith color.
@rtype: PyNone
@return: PyNone
"""
def getAmb():
"""
Retreives the ambient color of a world object.
This color is a list of 3 floats.
@rtype: list of three floats
@return: the ambient color of the world object.
"""
def setAmb(amb):
"""
Sets the ambient color of a world object.
@type amb: list of three floats
@param amb : the new ambient color.
@rtype: PyNone
@return: PyNone
"""
def getStar():
"""
Retreives the star parameters of a world object.
It is a list of nine floats :
red component of the color
green component of the color
blue component of the color
size of the stars
minimal distance between the stars
average distance between the stars
variations of the stars color
@rtype: list of nine floats
@return: the star parameters
"""
def setStar(star):
"""
Sets the star parameters of a world object.
See getStar for the semantics of the parameter.
@type star: list of 9 floats
@param star : the new star parameters.
@rtype: PyNone
@return: PyNone
"""
def getMist():
"""
Retreives the mist parameters of a world object.
It is a list of four floats :
intensity of the mist
start of the mist
end of the mist
height of the mist
@rtype: list of four floats
@return: the mist parameters
"""
def setMist(mist):
"""
Sets the mist parameters of a world object.
See getMist for the semantics of the parameter.
@type mist: list of 4 floats
@param mist : the new mist parameters.
@rtype: PyNone
@return: PyNone
"""