RNA: ID properties were not being shown as RNA properties anymore, fixed.
Python: fix two warnings (initialize to NULL).
This commit is contained in:
@@ -109,6 +109,7 @@ typedef enum PropertyFlag {
|
|||||||
typedef struct CollectionPropertyIterator {
|
typedef struct CollectionPropertyIterator {
|
||||||
/* internal */
|
/* internal */
|
||||||
PointerRNA parent;
|
PointerRNA parent;
|
||||||
|
PointerRNA builtin_parent;
|
||||||
struct PropertyRNA *prop;
|
struct PropertyRNA *prop;
|
||||||
void *internal;
|
void *internal;
|
||||||
int idprop;
|
int idprop;
|
||||||
|
@@ -87,7 +87,7 @@ static int rna_idproperty_known(CollectionPropertyIterator *iter, void *data)
|
|||||||
{
|
{
|
||||||
IDProperty *idprop= (IDProperty*)data;
|
IDProperty *idprop= (IDProperty*)data;
|
||||||
PropertyRNA *prop;
|
PropertyRNA *prop;
|
||||||
StructRNA *ptype= iter->parent.type;
|
StructRNA *ptype= iter->builtin_parent.type;
|
||||||
|
|
||||||
/* function to skip any id properties that are already known by RNA,
|
/* function to skip any id properties that are already known by RNA,
|
||||||
* for the second loop where we go over unknown id properties */
|
* for the second loop where we go over unknown id properties */
|
||||||
@@ -177,7 +177,7 @@ static void rna_Struct_properties_next(CollectionPropertyIterator *iter)
|
|||||||
|
|
||||||
/* try id properties */
|
/* try id properties */
|
||||||
if(!iter->valid) {
|
if(!iter->valid) {
|
||||||
group= rna_idproperties_get(&iter->parent, 0);
|
group= rna_idproperties_get(&iter->builtin_parent, 0);
|
||||||
|
|
||||||
if(group) {
|
if(group) {
|
||||||
rna_iterator_listbase_end(iter);
|
rna_iterator_listbase_end(iter);
|
||||||
@@ -243,7 +243,7 @@ static PointerRNA rna_Struct_functions_get(CollectionPropertyIterator *iter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Builtin properties iterator re-uses the Struct properties iterator, only
|
/* Builtin properties iterator re-uses the Struct properties iterator, only
|
||||||
* difference is that we need to see the ptr data to the type of the struct
|
* difference is that we need to set the ptr data to the type of the struct
|
||||||
* whose properties we want to iterate over. */
|
* whose properties we want to iterate over. */
|
||||||
|
|
||||||
void rna_builtin_properties_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
void rna_builtin_properties_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
||||||
@@ -260,6 +260,7 @@ void rna_builtin_properties_begin(CollectionPropertyIterator *iter, PointerRNA *
|
|||||||
newptr.id.data= NULL;
|
newptr.id.data= NULL;
|
||||||
|
|
||||||
iter->parent= newptr;
|
iter->parent= newptr;
|
||||||
|
iter->builtin_parent = *ptr;
|
||||||
|
|
||||||
rna_Struct_properties_begin(iter, &newptr);
|
rna_Struct_properties_begin(iter, &newptr);
|
||||||
}
|
}
|
||||||
|
@@ -187,7 +187,7 @@ static int PYTHON_OT_generic(int mode, bContext *C, wmOperator *op, wmEvent *eve
|
|||||||
{
|
{
|
||||||
PyObject *py_class = op->type->pyop_data;
|
PyObject *py_class = op->type->pyop_data;
|
||||||
PyObject *args;
|
PyObject *args;
|
||||||
PyObject *ret= NULL, *py_class_instance, *item;
|
PyObject *ret= NULL, *py_class_instance, *item= NULL;
|
||||||
int ret_flag= (mode==PYOP_POLL ? 0:OPERATOR_CANCELLED);
|
int ret_flag= (mode==PYOP_POLL ? 0:OPERATOR_CANCELLED);
|
||||||
|
|
||||||
PyGILState_STATE gilstate = PyGILState_Ensure();
|
PyGILState_STATE gilstate = PyGILState_Ensure();
|
||||||
|
@@ -1092,6 +1092,7 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data)
|
|||||||
case PROP_COLLECTION:
|
case PROP_COLLECTION:
|
||||||
/* XXX not supported yet
|
/* XXX not supported yet
|
||||||
* ret = pyrna_prop_CreatePyObject(ptr, prop); */
|
* ret = pyrna_prop_CreatePyObject(ptr, prop); */
|
||||||
|
ret = NULL;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
PyErr_Format(PyExc_AttributeError, "RNA Error: unknown type \"%d\" (pyrna_param_to_py)", type);
|
PyErr_Format(PyExc_AttributeError, "RNA Error: unknown type \"%d\" (pyrna_param_to_py)", type);
|
||||||
|
Reference in New Issue
Block a user