diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-19 11:32:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-19 11:33:29 +0300 |
commit | 56fd821e9711eb64d8fa2a9fef538f1c6a32fdf4 (patch) | |
tree | 8ae0f78e8ed3e71c3c632076efd6f27d95ac5b3d /source | |
parent | 3f542312cfe7e73122aaa1140a36ed4da7791d8e (diff) |
RNA: add widget property access
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_workspace.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_workspace.c b/source/blender/makesrna/intern/rna_workspace.c index 5504ca68c6d..59b1086e17e 100644 --- a/source/blender/makesrna/intern/rna_workspace.c +++ b/source/blender/makesrna/intern/rna_workspace.c @@ -158,6 +158,18 @@ static int rna_WorkspaceTool_has_datablock_get(PointerRNA *ptr) return (tref->runtime) ? (tref->runtime->data_block[0] != '\0') : false; } +static void rna_WorkspaceTool_widget_get(PointerRNA *ptr, char *value) +{ + bToolRef *tref = ptr->data; + strcpy(value, tref->runtime ? tref->runtime->gizmo_group : ""); +} + +static int rna_WorkspaceTool_widget_length(PointerRNA *ptr) +{ + bToolRef *tref = ptr->data; + return tref->runtime ? strlen(tref->runtime->gizmo_group) : 0; +} + #else /* RNA_RUNTIME */ static void rna_def_workspace_owner(BlenderRNA *brna) @@ -250,6 +262,12 @@ static void rna_def_workspace_tool(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_WorkspaceTool_has_datablock_get", NULL); RNA_define_verify_sdna(1); + prop = RNA_def_property(srna, "widget", PROP_STRING, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Widget", ""); + RNA_def_property_string_funcs(prop, "rna_WorkspaceTool_widget_get", "rna_WorkspaceTool_widget_length", NULL); + RNA_define_verify_sdna(1); + RNA_api_workspace_tool(srna); } |