diff options
author | Bastien Montagne <bastien@blender.org> | 2020-04-22 16:54:04 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-04-22 16:54:04 +0300 |
commit | 6a1056c6a8dbd0fecbf7f44b28717d0240e69024 (patch) | |
tree | 0a31f860285995964692dd4de649f6d5ac2d0308 /source/blender/makesrna/intern/rna_scene.c | |
parent | 6c9bebd82791de8bcdba7a52944f12706cc4fa0b (diff) | |
parent | 28f7c80c464b71911f926932f6a789efeea14c1e (diff) |
Merge branch 'blender-v2.83-release'
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 6548aa01091..4ea90aef931 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2026,6 +2026,24 @@ static void rna_View3DCursor_matrix_set(PointerRNA *ptr, const float *values) BKE_scene_cursor_from_mat4(cursor, unit_mat, false); } +static char *rna_TransformOrientationSlot_path(PointerRNA *ptr) +{ + Scene *scene = (Scene *)ptr->owner_id; + TransformOrientationSlot *orientation_slot = ptr->data; + + if (!ELEM(NULL, scene, orientation_slot)) { + for (int i = 0; i < ARRAY_SIZE(scene->orientation_slots); i++) { + if (&scene->orientation_slots[i] == orientation_slot) { + return BLI_sprintfN("transform_orientation_slots[%d]", i); + } + } + } + + /* Should not happen, but in case, just return defqult path. */ + BLI_assert(0); + return BLI_strdup("transform_orientation_slots[0]"); +} + static char *rna_View3DCursor_path(PointerRNA *UNUSED(ptr)) { return BLI_strdup("cursor"); @@ -2664,6 +2682,7 @@ static void rna_def_transform_orientation_slot(BlenderRNA *brna) srna = RNA_def_struct(brna, "TransformOrientationSlot", NULL); RNA_def_struct_sdna(srna, "TransformOrientationSlot"); + RNA_def_struct_path_func(srna, "rna_TransformOrientationSlot_path"); RNA_def_struct_ui_text(srna, "Orientation Slot", ""); /* Orientations */ |