diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-08-29 16:58:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-08-29 16:58:44 +0300 |
commit | e81c352746483acb50fbeddbba4249cdcb51d952 (patch) | |
tree | 3d8ffc7458835a78c9a752ed820d5c5f19fc0072 /source/blender/makesrna/intern | |
parent | 5269a3c1afec106bb76bad2f158f3c46d264c59c (diff) |
Tool System: hide paint options for non brush tools
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_workspace.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_workspace.c b/source/blender/makesrna/intern/rna_workspace.c index 88b79e8ee32..db6a58fa85e 100644 --- a/source/blender/makesrna/intern/rna_workspace.c +++ b/source/blender/makesrna/intern/rna_workspace.c @@ -152,6 +152,12 @@ static int rna_WorkspaceTool_index_get(PointerRNA *ptr) return (tref->runtime) ? tref->runtime->index : 0; } +static int rna_WorkspaceTool_has_datablock_get(PointerRNA *ptr) +{ + bToolRef *tref = ptr->data; + return (tref->runtime) ? (tref->runtime->data_block[0] != '\0') : false; +} + #else /* RNA_RUNTIME */ static void rna_def_workspace_owner(BlenderRNA *brna) @@ -230,6 +236,13 @@ static void rna_def_workspace_tool(BlenderRNA *brna) RNA_def_property_enum_items(prop, rna_enum_space_type_items); RNA_def_property_ui_text(prop, "Space Type", ""); + RNA_define_verify_sdna(0); + prop = RNA_def_property(srna, "has_datablock", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Has Datablock", ""); + RNA_def_property_boolean_funcs(prop, "rna_WorkspaceTool_has_datablock_get", NULL); + RNA_define_verify_sdna(1); + RNA_api_workspace_tool(srna); } |