WM: add tool property getter function

Matches 'ensure' functions but doesn't add data.
This commit is contained in:
2019-01-23 15:36:10 +11:00
parent 2e4f1b592f
commit 7ce38978ae
2 changed files with 16 additions and 2 deletions

View File

@@ -897,6 +897,13 @@ IDProperty *WM_toolsystem_ref_properties_ensure_idprops(bToolRef *tref)
return tref->properties;
}
bool WM_toolsystem_ref_properties_get_ex(bToolRef *tref, const char *idname, StructRNA *type, PointerRNA *r_ptr)
{
IDProperty *group = tref->properties;
IDProperty *prop = group ? IDP_GetPropertyFromGroup(group, idname) : NULL;
RNA_pointer_create(NULL, type, prop, r_ptr);
return (prop != NULL);
}
void WM_toolsystem_ref_properties_ensure_ex(bToolRef *tref, const char *idname, StructRNA *type, PointerRNA *r_ptr)
{