Merge branch 'blender-v3.1-release'

This commit is contained in:
Campbell Barton 2022-03-01 23:11:46 +11:00
commit 143bc9f8d4
2 changed files with 14 additions and 3 deletions

View File

@ -103,6 +103,7 @@ void WM_toolsystem_do_msg_notify_tag_refresh(struct bContext *C,
struct wmMsgSubscribeKey *msg_key,
struct wmMsgSubscribeValue *msg_val);
struct IDProperty *WM_toolsystem_ref_properties_get_idprops(struct bToolRef *tref);
struct IDProperty *WM_toolsystem_ref_properties_ensure_idprops(struct bToolRef *tref);
void WM_toolsystem_ref_properties_ensure_ex(struct bToolRef *tref,
const char *idname,

View File

@ -818,6 +818,15 @@ static IDProperty *idprops_ensure_named_group(IDProperty *group, const char *idn
return prop;
}
IDProperty *WM_toolsystem_ref_properties_get_idprops(bToolRef *tref)
{
IDProperty *group = tref->properties;
if (group == NULL) {
return NULL;
}
return IDP_GetPropertyFromGroup(group, tref->idname);
}
IDProperty *WM_toolsystem_ref_properties_ensure_idprops(bToolRef *tref)
{
if (tref->properties == NULL) {
@ -832,7 +841,7 @@ bool WM_toolsystem_ref_properties_get_ex(bToolRef *tref,
StructRNA *type,
PointerRNA *r_ptr)
{
IDProperty *group = tref->properties;
IDProperty *group = WM_toolsystem_ref_properties_get_idprops(tref);
IDProperty *prop = group ? IDP_GetPropertyFromGroup(group, idname) : NULL;
RNA_pointer_create(NULL, type, prop, r_ptr);
return (prop != NULL);
@ -861,8 +870,9 @@ void WM_toolsystem_ref_properties_init_for_keymap(bToolRef *tref,
IDPropertyTemplate val = {0};
dst_ptr->data = IDP_New(IDP_GROUP, &val, "wmOpItemProp");
}
if (tref->properties != NULL) {
IDProperty *prop = IDP_GetPropertyFromGroup(tref->properties, ot->idname);
IDProperty *group = WM_toolsystem_ref_properties_get_idprops(tref);
if (group != NULL) {
IDProperty *prop = IDP_GetPropertyFromGroup(group, ot->idname);
if (prop) {
/* Important key-map items properties don't get overwritten by the tools.
* - When a key-map item doesn't set a property, the tool-systems is used.