new rna api call: RNA_struct_idprops_unset(op->ptr, "someprop"), added to allow un-setting operator properties.
This commit is contained in:
@@ -620,7 +620,7 @@ void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type);
|
|||||||
struct IDProperty *RNA_struct_idprops(PointerRNA *ptr, int create);
|
struct IDProperty *RNA_struct_idprops(PointerRNA *ptr, int create);
|
||||||
int RNA_struct_idprops_check(StructRNA *srna);
|
int RNA_struct_idprops_check(StructRNA *srna);
|
||||||
int RNA_struct_idprops_register_check(StructRNA *type);
|
int RNA_struct_idprops_register_check(StructRNA *type);
|
||||||
|
int RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier);
|
||||||
|
|
||||||
PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier);
|
PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier);
|
||||||
int RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test);
|
int RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test);
|
||||||
|
@@ -521,6 +521,24 @@ int RNA_struct_idprops_register_check(StructRNA *type)
|
|||||||
return (type->flag & STRUCT_NO_IDPROPERTIES) == 0;
|
return (type->flag & STRUCT_NO_IDPROPERTIES) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* remove an id-property */
|
||||||
|
int RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier)
|
||||||
|
{
|
||||||
|
IDProperty *group= RNA_struct_idprops(ptr, 0);
|
||||||
|
|
||||||
|
if(group) {
|
||||||
|
IDProperty *idp= IDP_GetPropertyFromGroup(group, identifier);
|
||||||
|
if(idp) {
|
||||||
|
IDP_RemFromGroup(group, idp);
|
||||||
|
IDP_FreeProperty(idp);
|
||||||
|
MEM_freeN(idp);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int RNA_struct_is_a(StructRNA *type, StructRNA *srna)
|
int RNA_struct_is_a(StructRNA *type, StructRNA *srna)
|
||||||
{
|
{
|
||||||
StructRNA *base;
|
StructRNA *base;
|
||||||
|
Reference in New Issue
Block a user