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:
authorJeroen Bakker <j.bakker@atmind.nl>2018-04-30 16:50:08 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2018-04-30 16:54:38 +0300
commitcbe57acddf9554d11988718758096f9d847e9c95 (patch)
treed496e04a5a28e18e13bf2d124b378ee6132ca0a2 /source/blender/draw/modes/paint_weight_mode.c
parentd9f395ac390d1e02aa9c3e97ebaee8bb834e3af4 (diff)
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
Diffstat (limited to 'source/blender/draw/modes/paint_weight_mode.c')
-rw-r--r--source/blender/draw/modes/paint_weight_mode.c8
1 files changed, 2 insertions, 6 deletions
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);
}