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 <ideasman42@gmail.com>2018-07-03 19:33:52 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-03 19:38:08 +0300
commit81a23d1f2db5d3c21e3c35cf3128f5e6326df54a (patch)
treeabb1e5a5866d6928d1ad1ed5406d8b84299cc249 /source/blender/makesrna/intern/rna_workspace_api.c
parent51acd547605a9c3b1644fba9d6e3168e37973c68 (diff)
Tool System: add operator for introspection
In some cases we want associate use an operator for a tool for introspection, so we can for eg, automatically use the same binding for in the popup toolbar. Space-G/R/S for transform now work as accelerator keys again. Also Space-E for extrude.
Diffstat (limited to 'source/blender/makesrna/intern/rna_workspace_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_workspace_api.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_workspace_api.c b/source/blender/makesrna/intern/rna_workspace_api.c
index 0db192e8347..eceaaeec3a4 100644
--- a/source/blender/makesrna/intern/rna_workspace_api.c
+++ b/source/blender/makesrna/intern/rna_workspace_api.c
@@ -53,6 +53,7 @@ static void rna_WorkspaceTool_setup(
const char *keymap,
const char *manipulator_group,
const char *data_block,
+ const char *operator,
int index)
{
bToolRef_Runtime tref_rt = {0};
@@ -61,6 +62,7 @@ static void rna_WorkspaceTool_setup(
STRNCPY(tref_rt.keymap, keymap);
STRNCPY(tref_rt.manipulator_group, manipulator_group);
STRNCPY(tref_rt.data_block, data_block);
+ STRNCPY(tref_rt.operator, operator);
tref_rt.index = index;
WM_toolsystem_ref_set_from_runtime(C, (WorkSpace *)id, tref, &tref_rt, name);
@@ -110,6 +112,7 @@ void RNA_api_workspace_tool(StructRNA *srna)
RNA_def_string(func, "keymap", NULL, KMAP_MAX_NAME, "Key Map", "");
RNA_def_string(func, "manipulator_group", NULL, MAX_NAME, "Manipulator Group", "");
RNA_def_string(func, "data_block", NULL, MAX_NAME, "Data Block", "");
+ RNA_def_string(func, "operator", NULL, MAX_NAME, "Operator", "");
RNA_def_int(func, "index", 0, INT_MIN, INT_MAX, "Index", "", INT_MIN, INT_MAX);
/* Access tool operator options (optionally create). */