From cbe57acddf9554d11988718758096f9d847e9c95 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 30 Apr 2018 15:50:08 +0200 Subject: Workbench: Integration VertexPaint and WeightPaint modes - Disable VertexPaint and WeightPaint for OB_MATERIAL and OB_RENDER. Users want to see the final result - When in OB_SOLID, the active object should be rendered without any color. The lighting information is multiplied with the VertexPaint/WeightPaint color - Removed the use_shading flag from VertexPaint and WeightPaint - add method to check if render engine should draw without color (DRW_object_in_only_lighting_mode) Reviewers: fclem Tags: #code_quest Maniphest Tasks: T54894 Differential Revision: https://developer.blender.org/D3191 --- source/blender/draw/modes/paint_weight_mode.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source/blender/draw/modes/paint_weight_mode.c') diff --git a/source/blender/draw/modes/paint_weight_mode.c b/source/blender/draw/modes/paint_weight_mode.c index 3cc2ad63ed4..a5a9f355dc6 100644 --- a/source/blender/draw/modes/paint_weight_mode.c +++ b/source/blender/draw/modes/paint_weight_mode.c @@ -118,8 +118,6 @@ static void PAINT_WEIGHT_engine_init(void *UNUSED(vedata)) } } -static float world_light; - static void PAINT_WEIGHT_cache_init(void *vedata) { PAINT_WEIGHT_PassList *psl = ((PAINT_WEIGHT_Data *)vedata)->psl; @@ -134,12 +132,13 @@ static void PAINT_WEIGHT_cache_init(void *vedata) /* Create a pass */ psl->weight_faces = DRW_pass_create( "Weight Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_MULTIPLY); stl->g_data->fweights_shgrp = DRW_shgroup_create(e_data.weight_face_shader, psl->weight_faces); static float light[3] = {-0.3f, 0.5f, 1.0f}; static float alpha = 1.0f; + static float world_light = 1.0f; DRW_shgroup_uniform_vec3(stl->g_data->fweights_shgrp, "light", light, 1); DRW_shgroup_uniform_float(stl->g_data->fweights_shgrp, "alpha", &alpha, 1); DRW_shgroup_uniform_float(stl->g_data->fweights_shgrp, "global", &world_light, 1); @@ -187,8 +186,6 @@ static void PAINT_WEIGHT_cache_populate(void *vedata, Object *ob) const bool use_vert_sel = (me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0; struct Gwn_Batch *geom; - world_light = BKE_collection_engine_property_value_get_bool(ces_mode_pw, "use_shading") ? 0.5f : 1.0f; - if (use_surface) { geom = DRW_cache_mesh_surface_weights_get(ob); DRW_shgroup_call_add(stl->g_data->fweights_shgrp, geom, ob->obmat); @@ -233,7 +230,6 @@ void PAINT_WEIGHT_collection_settings_create(IDProperty *properties) properties->type == IDP_GROUP && properties->subtype == IDP_GROUP_SUB_MODE_PAINT_WEIGHT); - BKE_collection_engine_property_add_bool(properties, "use_shading", true); BKE_collection_engine_property_add_bool(properties, "use_wire", false); } -- cgit v1.2.3