diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_workspace.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_workspace.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_workspace.c b/source/blender/makesrna/intern/rna_workspace.c index af9a200c3b9..041b2b9157f 100644 --- a/source/blender/makesrna/intern/rna_workspace.c +++ b/source/blender/makesrna/intern/rna_workspace.c @@ -146,6 +146,12 @@ const EnumPropertyItem *rna_WorkSpace_tools_mode_itemf( return DummyRNA_DEFAULT_items; } +static int rna_WorkspaceTool_index_get(PointerRNA *ptr) +{ + bToolRef *tref = ptr->data; + return (tref->runtime) ? tref->runtime->index : 0; +} + #else /* RNA_RUNTIME */ static void rna_def_workspace_owner(BlenderRNA *brna) @@ -213,6 +219,11 @@ static void rna_def_workspace_tool(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Name", ""); RNA_def_struct_name_property(srna, prop); + prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Index", ""); + RNA_def_property_int_funcs(prop, "rna_WorkspaceTool_index_get", NULL, NULL); + RNA_api_workspace_tool(srna); } |