diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-02 09:59:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-02 10:03:23 +0300 |
commit | 07d4580f644577ebbd49f7d9a2bd8a81561cc099 (patch) | |
tree | 268e8a78e00389f136391c1d00e2020eb9f472a4 /source/blender/windowmanager/gizmo/intern | |
parent | dce12293d0dbaf0ae1e2ea90dc46ae7e40763f31 (diff) |
Gizmo: support for gizmo-group properties
This allows gizmo groups to store properties in the tool.
This makes sense for gizmo options which only control gizmo display and
don't control operator execution.
Unlike similar kinds of properties,
this isn't accessible via the gizmo-group-type instance.
For now the it's only stored in the workspace tool as can be done for
operator properties, so each instance doesn't have different settings
which would be confusing from a user perspective and complicate access
from the top-bar.
Later we could add gizmo-group properties if needed.
Diffstat (limited to 'source/blender/windowmanager/gizmo/intern')
-rw-r--r-- | source/blender/windowmanager/gizmo/intern/wm_gizmo_group_type.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group_type.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group_type.c index a44005a7d28..655d38a5206 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group_type.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group_type.c @@ -32,6 +32,7 @@ #include "MEM_guardedalloc.h" #include "RNA_access.h" +#include "RNA_define.h" #include "WM_api.h" #include "WM_types.h" @@ -83,7 +84,12 @@ void WM_gizmogrouptype_iter(GHashIterator *ghi) static wmGizmoGroupType *wm_gizmogrouptype_append__begin(void) { wmGizmoGroupType *gzgt = MEM_callocN(sizeof(wmGizmoGroupType), "gizmogrouptype"); - + gzgt->srna = RNA_def_struct_ptr(&BLENDER_RNA, "", &RNA_GizmoGroupProperties); +#if 0 + /* Set the default i18n context now, so that opfunc can redefine it if needed! */ + RNA_def_struct_translation_context(ot->srna, BLT_I18NCONTEXT_OPERATOR_DEFAULT); + ot->translation_context = BLT_I18NCONTEXT_OPERATOR_DEFAULT; +#endif return gzgt; } static void wm_gizmogrouptype_append__end(wmGizmoGroupType *gzgt) @@ -91,6 +97,8 @@ static void wm_gizmogrouptype_append__end(wmGizmoGroupType *gzgt) BLI_assert(gzgt->name != NULL); BLI_assert(gzgt->idname != NULL); + RNA_def_struct_identifier(&BLENDER_RNA, gzgt->srna, gzgt->idname); + gzgt->type_update_flag |= WM_GIZMOMAPTYPE_KEYMAP_INIT; /* if not set, use default */ |