More armature stuff;

- The "Skinnable" option for Bones now is taken into account for the
  Envelope drawmode. If not Skinnable, it also doesn't draw the soft
  deform area. Maybe bone should be hidden... dunno yet.
- Use CTRL+LMB in weightpaint mode to sample the weight in a mesh.
  Note; it returns the weight of the closest visible vertex, not of a
  Blended result.
- NKey Panel for Mesh edit now shows a menu with the VertexGroup name(s)
  of a selected Vertex, plus the Weight.

Fix:
- while scaling Bone points in editmode (Envelope drawtype), the Bone
  root scale was not copied from (or to) the parent tip. This was not
  visible (is not drawn) but deform did use it... causing weird errors.
  For those who saw this error today: just go into editmode, select all
  Bones, press Skey, enter. That fixes it :)
This commit is contained in:
2005-08-19 21:37:29 +00:00
parent 91e39a0ec3
commit 6d60b0acfe
7 changed files with 179 additions and 38 deletions

View File

@@ -101,6 +101,7 @@
#include "BDR_drawmesh.h"
#include "BDR_drawobject.h"
#include "BDR_editobject.h"
#include "BDR_vpaint.h"
#include "BSE_view.h"
#include "BSE_drawview.h"
@@ -1066,7 +1067,7 @@ void nurbs_foreachScreenVert(void (*func)(void *userData, Nurb *nu, BPoint *bp,
static void calc_weightpaint_vert_color(Object *ob, int vert, unsigned char *col)
{
Mesh *me = ob->data;
float fr, fg, fb, input = 0.0;
float fr, fg, fb, input = 0.0f;
int i;
if (me->dvert) {
@@ -1075,33 +1076,13 @@ static void calc_weightpaint_vert_color(Object *ob, int vert, unsigned char *col
input+=me->dvert[vert].dw[i].weight;
}
CLAMP(input, 0.0, 1.0);
fr = fg = fb = 85;
if (input<=0.25f){
fr=0.0f;
fg=255.0f * (input*4.0f);
fb=255.0f;
}
else if (input<=0.50f){
fr=0.0f;
fg=255.0f;
fb=255.0f * (1.0f-((input-0.25f)*4.0f));
}
else if (input<=0.75){
fr=255.0f * ((input-0.50f)*4.0f);
fg=255.0f;
fb=0.0f;
}
else if (input<=1.0){
fr=255.0f;
fg=255.0f * (1.0f-((input-0.75f)*4.0f));
fb=0.0f;
}
col[3] = (unsigned char)(fr * ((input/2.0f)+0.5f));
col[2] = (unsigned char)(fg * ((input/2.0f)+0.5f));
col[1] = (unsigned char)(fb * ((input/2.0f)+0.5f));
CLAMP(input, 0.0f, 1.0f);
weight_to_rgb(input, &fr, &fg, &fb);
col[3] = (unsigned char)(fr * 255.0f);
col[2] = (unsigned char)(fg * 255.0f);
col[1] = (unsigned char)(fb * 255.0f);
col[0] = 255;
}
static unsigned char *calc_weightpaint_colors(Object *ob)