Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-03-01 15:06:01 +0300
committerCampbell Barton <campbell@blender.org>2022-03-01 15:09:56 +0300
commitd681d82d41c176951eb294a2d1dd413eb2fe8af2 (patch)
treefe216b2c7a3fab6ed0386af44e9b091e7afdaaed
parent629f22f161abfbe492d71e08cc89651da683aded (diff)
Fix T96035: Some tool settings do not work
Oversight in 74611e3555684a22e9a07bd0992a444b571b8083 missed updating property access to use the tool identifier to lookup the property group.
-rw-r--r--source/blender/windowmanager/WM_toolsystem.h1
-rw-r--r--source/blender/windowmanager/intern/wm_toolsystem.c16
2 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/windowmanager/WM_toolsystem.h b/source/blender/windowmanager/WM_toolsystem.h
index 32b9cf1d7ba..5cbe1e2da14 100644
--- a/source/blender/windowmanager/WM_toolsystem.h
+++ b/source/blender/windowmanager/WM_toolsystem.h
@@ -117,6 +117,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,
diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c
index fce11853030..df6f0a9e1ff 100644
--- a/source/blender/windowmanager/intern/wm_toolsystem.c
+++ b/source/blender/windowmanager/intern/wm_toolsystem.c
@@ -830,6 +830,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) {
@@ -844,7 +853,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);
@@ -873,8 +882,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.