From c66741510cd0dd0fd3e356966204e380d989fba5 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 1 Nov 2004 17:03:05 +0000 Subject: [PATCH] - Fix for #1726, the convex() function is smarter now, checking on valid trias to test in quad PLus: - Add undo-push after 'assign material' in curve editmode, plus redraw to reflect material change - Added tooltips for opengl light buttons in user presets - Added correct buttons window redraw for armature selecting in editmode --- source/blender/src/buttons_editing.c | 6 +++--- source/blender/src/editarmature.c | 8 +++++--- source/blender/src/editmesh_lib.c | 21 ++++++++++++++++++--- source/blender/src/space.c | 8 ++++---- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index ddb7d98b38a..42f7149c821 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -457,9 +457,6 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an efa->mat_nr= G.obedit->actcol-1; efa= efa->next; } - allqueue(REDRAWVIEW3D_Z, 0); - makeDispList(G.obedit); - BIF_undo_push("Assign material index"); } else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { nu= editNurb.first; @@ -469,6 +466,9 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an nu= nu->next; } } + allqueue(REDRAWVIEW3D_Z, 0); + makeDispList(G.obedit); + BIF_undo_push("Assign material index"); } break; case B_MATSEL: diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index aedab4fd68d..552abbfcf7e 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -423,6 +423,7 @@ void selectconnected_armature(void) countall(); allqueue (REDRAWVIEW3D, 0); + allqueue (REDRAWBUTSEDIT, 0); allqueue(REDRAWOOPS, 0); } @@ -460,6 +461,7 @@ void selectconnected_posearmature(void) countall(); allqueue (REDRAWVIEW3D, 0); + allqueue(REDRAWBUTSEDIT, 0); allqueue (REDRAWACTION, 0); allqueue(REDRAWOOPS, 0); } @@ -696,7 +698,7 @@ void delete_armature(void) allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); + allqueue(REDRAWBUTSEDIT, 0); allqueue(REDRAWOOPS, 0); countall(); } @@ -742,7 +744,6 @@ void remake_editArmature(void) allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWOOPS, 0); allqueue(REDRAWBUTSHEAD, 0); - allqueue(REDRAWBUTSOBJECT, 0); allqueue(REDRAWBUTSEDIT, 0); } @@ -2234,7 +2235,7 @@ void mousepose_armature(void) allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWACTION, 0); allqueue(REDRAWIPO, 0); /* To force action ipo update */ - allqueue(REDRAWBUTSOBJECT, 0); + allqueue(REDRAWBUTSEDIT, 0); allqueue(REDRAWOOPS, 0); rightmouse_transform(); @@ -2459,6 +2460,7 @@ void deselectall_posearmature (int test){ for (curBone=get_armature(ob)->bonebase.first; curBone; curBone=curBone->next) deselect_bonechildren (ob, curBone, selectmode); + allqueue(REDRAWBUTSEDIT, 0); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWOOPS, 0); allqueue(REDRAWACTION, 0); diff --git a/source/blender/src/editmesh_lib.c b/source/blender/src/editmesh_lib.c index 72dd995c5bd..1e9f42615c1 100644 --- a/source/blender/src/editmesh_lib.c +++ b/source/blender/src/editmesh_lib.c @@ -1489,9 +1489,24 @@ float convex(float *v1, float *v2, float *v3, float *v4) float cross[3], test[3]; float inpr; - CalcNormFloat(v1, v2, v3, cross); - CalcNormFloat(v1, v3, v4, test); - + /* make sure we do not test a (close to) zero sized tria in quad */ + test[0]= AreaT3Dfl(v1, v2, v3); + test[1]= AreaT3Dfl(v2, v3, v4); + test[2]= AreaT3Dfl(v3, v4, v1); + + if(test[0]