From cfab1a9e6a32ade832e4267ceced9f6733861ae2 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 20 Oct 2005 14:58:46 +0000 Subject: [PATCH] - Fix for Wkey menu in WeightPaint modus; it didn't work when the armature is a modifier only (Armature not parented to Mesh). Note; if multiple Modifier/Armatures work, it uses only the first still. - Armature option 'draw axes' now scales axes to 0.25 of bone length. --- source/blender/src/drawarmature.c | 4 ++-- source/blender/src/editobject.c | 3 ++- source/blender/src/poseobject.c | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/source/blender/src/drawarmature.c b/source/blender/src/drawarmature.c index db29f045eec..2154ac866aa 100644 --- a/source/blender/src/drawarmature.c +++ b/source/blender/src/drawarmature.c @@ -1473,7 +1473,7 @@ static void draw_pose_channels(Base *base, int dt) glPushMatrix(); glMultMatrixf(pchan->pose_mat); glTranslatef(0.0f, pchan->bone->length, 0.0f); - drawaxes(0.25f); + drawaxes(0.25f*pchan->bone->length); glPopMatrix(); } } @@ -1649,7 +1649,7 @@ static void draw_ebones(Object *ob, int dt) glPushMatrix(); set_matrix_editbone(eBone); glTranslatef(0.0f, eBone->length, 0.0f); - drawaxes(0.25f); + drawaxes(eBone->length*0.25f); glPopMatrix(); } diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index d46c06bd4b9..1b8e49e3582 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -1999,7 +1999,8 @@ void special_editmenu(void) } } else if(G.f & G_WEIGHTPAINT) { - if(ob->parent && (ob->parent->flag & OB_POSEMODE)) { + Object *par= modifiers_isDeformedByArmature(ob); + if(par && (par->flag & OB_POSEMODE)) { nr= pupmenu("Specials%t|Apply Bone Envelopes to VertexGroups %x1"); if(nr==1) { Mesh *me= ob->data; diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index 827882c5204..2300a3b6be7 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -39,6 +39,7 @@ #include "DNA_constraint_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" +#include "DNA_modifier_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" @@ -52,6 +53,7 @@ #include "BKE_DerivedMesh.h" #include "BKE_displist.h" #include "BKE_global.h" +#include "BKE_modifier.h" #include "BKE_object.h" #include "BKE_utildefines.h" @@ -609,7 +611,7 @@ void pose_adds_vgroups(Object *meshobj) { struct vgroup_map map; DerivedMesh *dm; - Object *poseobj= meshobj->parent; + Object *poseobj= modifiers_isDeformedByArmature(meshobj); bPoseChannel *pchan; Bone *bone; bDeformGroup *dg;