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-10-05 06:07:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-10-05 06:13:30 +0300
commit143ece7199c20b231077273e4c16c7edd0bc4940 (patch)
tree046795b2e46defc6668fa1119a67716a537310a1 /source/blender/makesrna/intern/rna_workspace_api.c
parentc15439bcdc52f90570dd22fc0f61b94bdf56145d (diff)
Tool System: initial support for UV-sculpt
This currently conflicts with the UV-sculpt toggle being manually set, ideally this would work more like other paint modes in Blender.
Diffstat (limited to 'source/blender/makesrna/intern/rna_workspace_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_workspace_api.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_workspace_api.c b/source/blender/makesrna/intern/rna_workspace_api.c
index 898dc296299..fb237299dd0 100644
--- a/source/blender/makesrna/intern/rna_workspace_api.c
+++ b/source/blender/makesrna/intern/rna_workspace_api.c
@@ -90,7 +90,10 @@ static void rna_WorkspaceTool_refresh_from_context(
if (ob == NULL) {
/* pass */
}
- else if (ob->mode & OB_MODE_PARTICLE_EDIT) {
+ else if ((tref->space_type == SPACE_VIEW3D) &&
+ (tref->mode == CTX_MODE_PARTICLE) &&
+ (ob->mode & OB_MODE_PARTICLE_EDIT))
+ {
const EnumPropertyItem *items = rna_enum_particle_edit_hair_brush_items;
const int i = RNA_enum_from_value(items, ts->particle.brushtype);
const EnumPropertyItem *item = &items[i];
@@ -99,6 +102,18 @@ static void rna_WorkspaceTool_refresh_from_context(
STRNCPY(tref->idname, item->name);
}
}
+ else if ((tref->space_type == SPACE_IMAGE) &&
+ (tref->mode == SI_MODE_VIEW) &&
+ (ob->mode & OB_MODE_EDIT))
+ {
+ const EnumPropertyItem *items = rna_enum_uv_sculpt_tool_items;
+ const int i = RNA_enum_from_value(items, ts->uv_sculpt_tool);
+ const EnumPropertyItem *item = &items[i];
+ if (!STREQ(tref_rt->data_block, item->identifier)) {
+ STRNCPY(tref_rt->data_block, item->identifier);
+ STRNCPY(tref->idname, item->name);
+ }
+ }
else {
Paint *paint = BKE_paint_get_active(scene, view_layer);
if (paint) {