[Bf-blender-cvs] [8d40d61af09] master: Fix T91225: Quick Favorites and shortcuts are broken for some properties

Philipp Oeser noreply at git.blender.org
Wed Sep 8 08:30:40 CEST 2021


Commit: 8d40d61af093fcf528ce282b740eca119a5ee5d3
Author: Philipp Oeser
Date:   Tue Sep 7 16:43:17 2021 +0200
Branches: master
https://developer.blender.org/rB8d40d61af093fcf528ce282b740eca119a5ee5d3

Fix T91225: Quick Favorites and shortcuts are broken for some properties

Caused by {rB3e4d720ae483}.

Before above commit, this had a different path handling and
RNA_path_from_ID_to_struct() was always used [which kind of took care of
this]. Now this is only used if ptr represents an ID itself, so we are
"loosing" part of the path.

This patch adds the path back on the member_id in
wm_context_member_from_ptr() for everthing related to space_data, so
WM_context_path_resolve_property_full() can construct a full path even
for these.

Maniphest Tasks: T91225

Differential Revision: https://developer.blender.org/D12418

===================================================================

M	source/blender/windowmanager/intern/wm_operators.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index df051328990..81dcc5ccea0 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -552,37 +552,38 @@ static const char *wm_context_member_from_ptr(bContext *C, const PointerRNA *ptr
             const View3D *v3d = (View3D *)space_data;
             const View3DShading *shading = &v3d->shading;
 
-            TEST_PTR_DATA_TYPE("space_data", RNA_View3DOverlay, ptr, v3d);
-            TEST_PTR_DATA_TYPE("space_data", RNA_View3DShading, ptr, shading);
+            TEST_PTR_DATA_TYPE("space_data.overlay", RNA_View3DOverlay, ptr, v3d);
+            TEST_PTR_DATA_TYPE("space_data.shading", RNA_View3DShading, ptr, shading);
             break;
           }
           case SPACE_GRAPH: {
             const SpaceGraph *sipo = (SpaceGraph *)space_data;
             const bDopeSheet *ads = sipo->ads;
-            TEST_PTR_DATA_TYPE("space_data", RNA_DopeSheet, ptr, ads);
+            TEST_PTR_DATA_TYPE("space_data.dopesheet", RNA_DopeSheet, ptr, ads);
             break;
           }
           case SPACE_FILE: {
             const SpaceFile *sfile = (SpaceFile *)space_data;
             const FileSelectParams *params = ED_fileselect_get_active_params(sfile);
-            TEST_PTR_DATA_TYPE("space_data", RNA_FileSelectParams, ptr, params);
+            TEST_PTR_DATA_TYPE("space_data.params", RNA_FileSelectParams, ptr, params);
             break;
           }
           case SPACE_IMAGE: {
             const SpaceImage *sima = (SpaceImage *)space_data;
-            TEST_PTR_DATA_TYPE("space_data", RNA_SpaceUVEditor, ptr, sima);
+            TEST_PTR_DATA_TYPE("space_data.overlay", RNA_SpaceImageOverlay, ptr, sima);
+            TEST_PTR_DATA_TYPE("space_data.uv_editor", RNA_SpaceUVEditor, ptr, sima);
             break;
           }
           case SPACE_NLA: {
             const SpaceNla *snla = (SpaceNla *)space_data;
             const bDopeSheet *ads = snla->ads;
-            TEST_PTR_DATA_TYPE("space_data", RNA_DopeSheet, ptr, ads);
+            TEST_PTR_DATA_TYPE("space_data.dopesheet", RNA_DopeSheet, ptr, ads);
             break;
           }
           case SPACE_ACTION: {
             const SpaceAction *sact = (SpaceAction *)space_data;
             const bDopeSheet *ads = &sact->ads;
-            TEST_PTR_DATA_TYPE("space_data", RNA_DopeSheet, ptr, ads);
+            TEST_PTR_DATA_TYPE("space_data.dopesheet", RNA_DopeSheet, ptr, ads);
             break;
           }
         }



More information about the Bf-blender-cvs mailing list