added a [get/set]Range function.
Updated documentation accordingly. (suggested by Stephane SOPPERA, tks!)
This commit is contained in:
@@ -229,6 +229,21 @@ PyObject *World_Init (void)
|
||||
/*****************************************************************************/
|
||||
/* Python BPy_World methods: */
|
||||
/*****************************************************************************/
|
||||
static PyObject *World_getRange(BPy_World *self)
|
||||
{
|
||||
return PyFloat_FromDouble(self->world->range);
|
||||
}
|
||||
|
||||
static PyObject *World_setRange(BPy_World *self, PyObject *args)
|
||||
{
|
||||
float range=0.f;
|
||||
if (!PyArg_ParseTuple(args, "f", &range))
|
||||
return (EXPP_ReturnPyObjError (PyExc_TypeError,"expected a float argument"));
|
||||
self->world->range = range;
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
|
||||
static PyObject *World_getIpo(BPy_World *self)
|
||||
{
|
||||
|
||||
@@ -80,6 +80,8 @@ struct PyMethodDef M_World_methods[] = {
|
||||
/*****************************************************************************/
|
||||
/* Python BPy_World methods declarations: */
|
||||
/*****************************************************************************/
|
||||
static PyObject *World_getRange(BPy_World *self);
|
||||
static PyObject *World_setRange(BPy_World *self, PyObject *args);
|
||||
static PyObject *World_getIpo(BPy_World *self);
|
||||
static PyObject *World_setIpo(BPy_World *self, PyObject *args);
|
||||
static PyObject *World_clearIpo(BPy_World *self);
|
||||
@@ -104,6 +106,10 @@ static PyObject *World_setMist(BPy_World *self, PyObject *args );
|
||||
/* Python BPy_World methods table: */
|
||||
/*****************************************************************************/
|
||||
static PyMethodDef BPy_World_methods[] = {
|
||||
{"getRange", (PyCFunction)World_getRange, METH_NOARGS,
|
||||
"() - Return World Range"},
|
||||
{"setRange", (PyCFunction)World_setRange, METH_VARARGS,
|
||||
"() - Change this World's range"},
|
||||
{"getIpo", (PyCFunction)World_getIpo, METH_NOARGS,
|
||||
"() - Return World Ipo"},
|
||||
{"setIpo", (PyCFunction)World_setIpo, METH_VARARGS,
|
||||
|
||||
@@ -55,6 +55,22 @@ class World:
|
||||
@type ipo: Blender Ipo
|
||||
@cvar ipo: The world type ipo linked to this world object.
|
||||
"""
|
||||
|
||||
def getRange():
|
||||
"""
|
||||
Retrieves the range parameter of a world object.
|
||||
@rtype: float
|
||||
@return: the range
|
||||
"""
|
||||
|
||||
def setRange(range):
|
||||
"""
|
||||
Sets the range parameter of a world object.
|
||||
@type range: float
|
||||
@param range: the new range parameter
|
||||
@rtype: PyNone
|
||||
@return: PyNone
|
||||
"""
|
||||
|
||||
def getName():
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user