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:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-09-23 20:41:10 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-09-25 18:44:57 +0300
commitaf998b40a0d1cd1615ab836c6214523169d4dd42 (patch)
tree1c2a05cf7fa7ccf7b35e8501eba5a99ab5e51071 /source/blender/draw/intern/draw_cache_impl.h
parentbd51cada8db64e45cabca66cd61438c1ae2bdf25 (diff)
Implement correct drawing of advanced Weight display features.
This adds existing behavior from calc_weightpaint_vert_array that was missing from the new rendering code: - No selected Vertex Group displays as a solid pink color. - Zero weight displays as alert color depending on Options. - Multipaint mode correctly displays collective weight. In order to properly implement this variety, a data structure holding all relevant parameters is introduced. Reviewers: fclem, campbellbarton Subscribers: jbakker Differential Revision: https://developer.blender.org/D3722
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl.h')
-rw-r--r--source/blender/draw/intern/draw_cache_impl.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl.h b/source/blender/draw/intern/draw_cache_impl.h
index d601bfc3a3e..444d5aeb12d 100644
--- a/source/blender/draw/intern/draw_cache_impl.h
+++ b/source/blender/draw/intern/draw_cache_impl.h
@@ -96,8 +96,29 @@ struct GPUBatch *DRW_lattice_batch_cache_get_all_edges(struct Lattice *lt, bool
struct GPUBatch *DRW_lattice_batch_cache_get_all_verts(struct Lattice *lt);
struct GPUBatch *DRW_lattice_batch_cache_get_overlay_verts(struct Lattice *lt);
-/* Mesh */
+/* Vertex Group Selection and display options */
+typedef struct VertexWeightSelection {
+ int defgroup_active;
+ int defgroup_tot;
+
+ short flags;
+ char alert_mode;
+
+ /* Set of all selected bones for Multipaint. */
+ int defgroup_sel_tot;
+ bool *defgroup_sel;
+} VertexWeightSelection;
+
+enum {
+ VWEIGHT_MULTIPAINT = (1 << 0),
+ VWEIGHT_AUTO_NORMALIZE = (1 << 1),
+};
+void DRW_vweight_selection_clear(struct VertexWeightSelection *sel);
+void DRW_vweight_selection_copy(struct VertexWeightSelection *sel, const struct VertexWeightSelection *src);
+bool DRW_vweight_selection_compare(const struct VertexWeightSelection *a, const struct VertexWeightSelection *b);
+
+/* Mesh */
struct GPUBatch **DRW_mesh_batch_cache_get_surface_shaded(
struct Mesh *me, struct GPUMaterial **gpumat_array, uint gpumat_array_len,
char **auto_layer_names, int **auto_layer_is_srgb, int *auto_layer_count);
@@ -109,7 +130,7 @@ struct GPUBatch *DRW_mesh_batch_cache_get_weight_overlay_verts(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_all_edges(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_all_triangles(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_normals(struct Mesh *me);
-struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_normals_and_weights(struct Mesh *me, int defgroup);
+struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_normals_and_weights(struct Mesh *me, const struct VertexWeightSelection *vwsel);
struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_normals_and_vert_colors(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_select_id(struct Mesh *me, bool use_hide, uint select_id_offset);
struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_select_mask(struct Mesh *me, bool use_hide);