Newer
Older
static PyObject *World_Repr( BPy_World * self )
return PyString_FromFormat( "[World \"%s\"]",
self->world->id.name + 2 );
Jacques Guignot
committed
static int World_compare (BPy_World *a, BPy_World *b)
{
World *pa = a->world, *pb = b->world;
return (pa == pb) ? 0:-1;
Jacques Guignot
committed
}
PyObject *World_CreatePyObject( struct World * world )
Jacques Guignot
committed
{
Jacques Guignot
committed
blen_object = ( BPy_World * ) PyObject_NEW( BPy_World, &World_Type );
Jacques Guignot
committed
if( blen_object == NULL ) {
return ( NULL );
}
blen_object->world = world;
return ( ( PyObject * ) blen_object );
Jacques Guignot
committed
}
int World_CheckPyObject( PyObject * py_obj )
Jacques Guignot
committed
{
return ( py_obj->ob_type == &World_Type );
Jacques Guignot
committed
}
World *World_FromPyObject( PyObject * py_obj )
Jacques Guignot
committed
{
Jacques Guignot
committed
blen_obj = ( BPy_World * ) py_obj;
return ( blen_obj->world );
Jacques Guignot
committed
}
/*****************************************************************************/
/* Description: Returns the object with the name specified by the argument */
/* name. Note that the calling function has to remove the first */
/* two characters of the object name. These two characters */
/* specify the type of the object (OB, ME, WO, ...) */
/* The function will return NULL when no object with the given */
/* name is found. */
/*****************************************************************************/
World *GetWorldByName( char *name )
world_iter = G.main->world.first;
while( world_iter ) {
if( StringEqual( name, GetIdName( &( world_iter->id ) ) ) ) {
return ( world_iter );
}
world_iter = world_iter->id.next;
}
/* There is no object with the given name */