Page MenuHome

Weight painting with draw manager
ClosedPublic

Authored by Luca Rood (LucaRood) on May 1 2017, 3:33 PM.

Details

Summary

This implements basic weight rendering with the draw manager.
Drawing options are still missing (vertex and face selection masking).

Also, there are two known crashes:

  • If two objects have the same mesh, there is a segfault when entering weight painting mode unless the object is the last on being drawn with that mesh (this seems to be related to where caches are being stored, and it seems that maybe there are going to be some changes in that area, so we'll see how this goes).
  • If you close Blender while in weight painting mode, it segfaults (most useless segfault ever, hehe).

This is part of T51208

Diff Detail

Repository
rB Blender
Branch
weight-patch (branched from blender2.8)
Build Status
Buildable 621
Build 621: arc lint + arc unit

Event Timeline

Some nitpicking comments, feel free to ignore most of them (the comment about 120 fallback is serious though).

source/blender/draw/modes/paint_weight_mode.c
95–96
-if (!e_data.weight_face_shader) {
+if (e_data.weight_face_shader == NULL) {
118

maybe leave the "/* Uniforms need a pointer to it's value so be sure it's accessible" comment?

source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_alpha_frag.glsl
7

no need for 120 fallback

source/blender/makesdna/DNA_ID.h
106
- IDP_GROUP_SUB_MODE_PAINT_WEIGHT = 5 
+ IDP_GROUP_SUB_MODE_PAINT_WEIGHT = 5,

Added all drawing options (Wire, shading, face mask and vert mask), did some minor style fixes, and added support for the custom weight color setting (debatable usefulness).

Fixed all crashes and memleaks. Weight cache invalidation is a bit hacky, but is the simplest way to do it for now, and can be changed later.

Fixed one last corner case where the draw cache wasn't updated (different object with same mesh).

Added ensure BM dvert, and rebased.

This revision was automatically updated to reflect the committed changes.