RNA/Py API
change how data is added. eg. bpy.data.add_mesh(name) --> bpy.data.meshes.new(name) bpy.data.remove_lamp(lamp) --> bpy.data.lamps.remove(lamp) image and texture stil use add_* funcs
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
@@ -2005,6 +2006,16 @@ static PyObject *pyrna_prop_getattro( BPy_PropertyRNA *self, PyObject *pyname )
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* annoying exception, maybe we need to have different types for this... */
|
||||
if((strcmp(name, "__getitem__")==0 || strcmp(name, "__setitem__")==0) &&
|
||||
(RNA_property_type(self->prop) != PROP_COLLECTION) &&
|
||||
RNA_property_array_check(&self->ptr, self->prop)==0
|
||||
) {
|
||||
PyErr_SetString(PyExc_AttributeError, "PropertyRNA - no __getitem__ support for this type");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* The error raised here will be displayed */
|
||||
return PyObject_GenericGetAttr((PyObject *)self, pyname);
|
||||
|
Reference in New Issue
Block a user