diff options
author | Jacques Guignot <guignot@wanadoo.fr> | 2003-07-27 17:53:29 +0400 |
---|---|---|
committer | Jacques Guignot <guignot@wanadoo.fr> | 2003-07-27 17:53:29 +0400 |
commit | 2222fc716812cfd2a5fab4d1a8eb6f775fced1dc (patch) | |
tree | 886a08fce547dcfa7cd7653ce3513a9dbb3f13e4 /source/blender/python/api2_2x/World.c | |
parent | c886b5a7bf4ebf25e5a6ed9995cbff9c61f4e9c3 (diff) |
added functions World_CheckPyObject World_FromPyObject World_CreatePyObject and World_compare
Diffstat (limited to 'source/blender/python/api2_2x/World.c')
-rw-r--r-- | source/blender/python/api2_2x/World.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/World.c b/source/blender/python/api2_2x/World.c index 9b5ac6e1450..c5d88293dc0 100644 --- a/source/blender/python/api2_2x/World.c +++ b/source/blender/python/api2_2x/World.c @@ -659,3 +659,40 @@ static PyObject *World_Repr (BPy_World *self) } /*@}*/ + +static int World_compare (BPy_World *a, BPy_World *b) +{ + World *pa = a->world, *pb = b->world; + return (pa == pb) ? 0:-1; +} + +PyObject* World_CreatePyObject (struct World *world) +{ + BPy_World * blen_object; + + blen_object = (BPy_World*)PyObject_NEW (BPy_World, &World_Type); + + if (blen_object == NULL) + { + return (NULL); + } + blen_object->world = world; + return ((PyObject*)blen_object); + +} + +int World_CheckPyObject (PyObject *py_obj) +{ +return (py_obj->ob_type == &World_Type); +} + + +struct World* World_FromPyObject (PyObject *py_obj) +{ + BPy_World * blen_obj; + + blen_obj = (BPy_World*)py_obj; + return (blen_obj->world); + +} + |