From ae7fcb58bccec94f5e72c5019402d66764352198 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 13 Dec 2006 08:50:11 +0000 Subject: [PATCH] Armature Proxy bugfix: synchronizing the pose went wrong when the proxy had new dependencies added internally (like constraints), changing the evaluation order for pose channels. My optimized code didn't like it, so now it falls back to a reliable slower method. Bug showed as totally messed up characters for proxies... Also: increased range for 3D Window properties clip-start/end, this is still a bad construct though... --- source/blender/blenkernel/intern/action.c | 17 +++++++++-------- source/blender/src/drawview.c | 16 ++++++++-------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 9f42e682e82..23f6fa28d76 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -730,14 +730,15 @@ void copy_pose_result(bPose *to, bPose *from) return; } - pchanto= to->chanbase.first; - pchanfrom= from->chanbase.first; - for(; pchanto && pchanfrom; pchanto= pchanto->next, pchanfrom= pchanfrom->next) { - Mat4CpyMat4(pchanto->pose_mat, pchanfrom->pose_mat); - Mat4CpyMat4(pchanto->chan_mat, pchanfrom->chan_mat); - VECCOPY(pchanto->pose_head, pchanfrom->pose_head); - VECCOPY(pchanto->pose_tail, pchanfrom->pose_tail); - pchanto->flag= pchanfrom->flag; + for(pchanfrom= from->chanbase.first; pchanfrom; pchanfrom= pchanfrom->next) { + pchanto= get_pose_channel(to, pchanfrom->name); + if(pchanto) { + Mat4CpyMat4(pchanto->pose_mat, pchanfrom->pose_mat); + Mat4CpyMat4(pchanto->chan_mat, pchanfrom->chan_mat); + VECCOPY(pchanto->pose_head, pchanfrom->pose_head); + VECCOPY(pchanto->pose_tail, pchanfrom->pose_tail); + pchanto->flag= pchanfrom->flag; + } } } diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index b03546e88ab..ffb738689f1 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -1850,7 +1850,7 @@ static void v3d_posearmature_buts(uiBlock *block, Object *ob, float lim) uiBut *but; bArmature *arm; bPoseChannel *pchan; - Bone *bone; + Bone *bone= NULL; TransformProperties *tfp= G.vd->properties_storage; arm = get_armature(OBACT); @@ -1861,7 +1861,7 @@ static void v3d_posearmature_buts(uiBlock *block, Object *ob, float lim) if(bone && (bone->flag & BONE_ACTIVE) && (bone->layer & arm->layer)) break; } - if (!pchan) return; + if (!pchan || !bone) return; but= uiDefBut(block, TEX, B_DIFF, "Bone:", 160, 140, 140, 19, bone->name, 1, 31, 0, 0, ""); uiButSetFunc(but, validate_bonebutton_cb, bone, NULL); @@ -2407,7 +2407,7 @@ static void view3d_panel_background(short cntrl) // VIEW3D_HANDLER_BACKGROUND uiDefIconBut(block, BUT, B_LOADBGPIC, ICON_FILESEL, 90, 128, 20, 20, 0, 0, 0, 0, 0, "Open a new background image"); id= (ID *)vd->bgpic->ima; - IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->image), id, &(vd->menunr)); + IMAnames_to_pupstring(&strp, NULL, NULL, &(G.main->image), id, &(vd->menunr)); if(strp[0]) { uiDefButS(block, MENU, B_BGPICBROWSE, strp, 110, 128, 20, 20, &(vd->menunr), 0, 0, 0, 0, "Select a background image"); @@ -2489,17 +2489,17 @@ static void view3d_panel_properties(short cntrl) // VIEW3D_HANDLER_SETTINGS uiDefButF(block, NUM, REDRAWVIEW3D, "Lens:", 10, 120, 140, 19, &vd->lens, 10.0, 120.0, 100, 0, "The lens angle in perspective view"); uiBlockBeginAlign(block); - uiDefButF(block, NUM, REDRAWVIEW3D, "Clip Start:", 10, 96, 140, 19, &vd->near, vd->grid/10.0, 100.0, 10, 0, "Set the beginning of the range in which 3D objects are displayed (perspective view)"); - uiDefButF(block, NUM, REDRAWVIEW3D, "Clip End:", 10, 76, 140, 19, &vd->far, 1.0, 1000.0*vd->grid, 100, 0, "Set the end of the range in which 3D objects are displayed (perspective view)"); + uiDefButF(block, NUM, REDRAWVIEW3D, "Clip Start:", 10, 96, 140, 19, &vd->near, vd->grid/100.0, 100.0, 10, 0, "Set the beginning of the range in which 3D objects are displayed (perspective view)"); + uiDefButF(block, NUM, REDRAWVIEW3D, "Clip End:", 10, 76, 140, 19, &vd->far, 1.0, 10000.0*vd->grid, 100, 0, "Set the end of the range in which 3D objects are displayed (perspective view)"); uiBlockEndAlign(block); uiDefBut(block, LABEL, 1, "3D Cursor:", 160, 150, 140, 19, NULL, 0.0, 0.0, 0, 0, ""); uiBlockBeginAlign(block); curs= give_cursor(); - uiDefButF(block, NUM, REDRAWVIEW3D, "X:", 160, 130, 150, 22, curs, -1000.0*vd->grid, 1000.0*vd->grid, 10, 0, "X co-ordinate of the 3D cursor"); - uiDefButF(block, NUM, REDRAWVIEW3D, "Y:", 160, 108, 150, 22, curs+1, -1000.0*vd->grid, 1000.0*vd->grid, 10, 0, "Y co-ordinate of the 3D cursor"); - uiDefButF(block, NUM, REDRAWVIEW3D, "Z:", 160, 86, 150, 22, curs+2, -1000.0*vd->grid, 1000.0*vd->grid, 10, 0, "Z co-ordinate of the 3D cursor"); + uiDefButF(block, NUM, REDRAWVIEW3D, "X:", 160, 130, 150, 22, curs, -10000.0*vd->grid, 10000.0*vd->grid, 10, 0, "X co-ordinate of the 3D cursor"); + uiDefButF(block, NUM, REDRAWVIEW3D, "Y:", 160, 108, 150, 22, curs+1, -10000.0*vd->grid, 10000.0*vd->grid, 10, 0, "Y co-ordinate of the 3D cursor"); + uiDefButF(block, NUM, REDRAWVIEW3D, "Z:", 160, 86, 150, 22, curs+2, -10000.0*vd->grid, 10000.0*vd->grid, 10, 0, "Z co-ordinate of the 3D cursor"); uiBlockEndAlign(block); uiDefBut(block, LABEL, 1, "Display:", 10, 50, 150, 19, NULL, 0.0, 0.0, 0, 0, "");