forked from bartvdbraak/blender
Fix combined pose + weight paint mode, was using wrong object
in a few places, missing some checks.
This commit is contained in:
parent
d25ab89ac0
commit
fcbfd29796
@ -4333,7 +4333,7 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* in weightpaint we select the associated vertex group too */
|
/* in weightpaint we select the associated vertex group too */
|
||||||
if (ob->mode & OB_MODE_WEIGHT_PAINT) {
|
if (OBACT && OBACT->mode & OB_MODE_WEIGHT_PAINT) {
|
||||||
if (nearBone->flag & BONE_ACTIVE) {
|
if (nearBone->flag & BONE_ACTIVE) {
|
||||||
ED_vgroup_select_by_name(OBACT, nearBone->name);
|
ED_vgroup_select_by_name(OBACT, nearBone->name);
|
||||||
DAG_id_flush_update(&OBACT->id, OB_RECALC_DATA);
|
DAG_id_flush_update(&OBACT->id, OB_RECALC_DATA);
|
||||||
|
@ -2513,7 +2513,11 @@ int draw_armature(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int
|
|||||||
/* drawing posemode selection indices or colors only in these cases */
|
/* drawing posemode selection indices or colors only in these cases */
|
||||||
if(!(base->flag & OB_FROMDUPLI)) {
|
if(!(base->flag & OB_FROMDUPLI)) {
|
||||||
if(G.f & G_PICKSEL) {
|
if(G.f & G_PICKSEL) {
|
||||||
if(ob->mode & OB_MODE_POSE)
|
if(OBACT && (OBACT->mode & OB_MODE_WEIGHT_PAINT)) {
|
||||||
|
if(ob==modifiers_isDeformedByArmature(OBACT))
|
||||||
|
arm->flag |= ARM_POSEMODE;
|
||||||
|
}
|
||||||
|
else if(ob->mode & OB_MODE_POSE)
|
||||||
arm->flag |= ARM_POSEMODE;
|
arm->flag |= ARM_POSEMODE;
|
||||||
}
|
}
|
||||||
else if(ob->mode & OB_MODE_POSE) {
|
else if(ob->mode & OB_MODE_POSE) {
|
||||||
@ -2530,8 +2534,8 @@ int draw_armature(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int
|
|||||||
if ((flag & DRAW_SCENESET)==0) {
|
if ((flag & DRAW_SCENESET)==0) {
|
||||||
if(ob==OBACT)
|
if(ob==OBACT)
|
||||||
arm->flag |= ARM_POSEMODE;
|
arm->flag |= ARM_POSEMODE;
|
||||||
else if(ob->mode & OB_MODE_WEIGHT_PAINT) {
|
else if(OBACT && (OBACT->mode & OB_MODE_WEIGHT_PAINT)) {
|
||||||
if(OBACT && ob==modifiers_isDeformedByArmature(OBACT))
|
if(ob==modifiers_isDeformedByArmature(OBACT))
|
||||||
arm->flag |= ARM_POSEMODE;
|
arm->flag |= ARM_POSEMODE;
|
||||||
}
|
}
|
||||||
draw_pose_paths(scene, v3d, rv3d, ob);
|
draw_pose_paths(scene, v3d, rv3d, ob);
|
||||||
|
@ -1148,7 +1148,7 @@ static void mouse_select(bContext *C, short *mval, short extend, short obcenter,
|
|||||||
WM_event_add_notifier(C, NC_OBJECT|ND_BONE_ACTIVE, basact->object);
|
WM_event_add_notifier(C, NC_OBJECT|ND_BONE_ACTIVE, basact->object);
|
||||||
|
|
||||||
/* in weightpaint, we use selected bone to select vertexgroup, so no switch to new active object */
|
/* in weightpaint, we use selected bone to select vertexgroup, so no switch to new active object */
|
||||||
if(basact->object->mode & OB_MODE_WEIGHT_PAINT) {
|
if(BASACT && BASACT->object->mode & OB_MODE_WEIGHT_PAINT) {
|
||||||
/* prevent activating */
|
/* prevent activating */
|
||||||
basact= NULL;
|
basact= NULL;
|
||||||
}
|
}
|
||||||
|
@ -5289,7 +5289,7 @@ void createTransData(bContext *C, TransInfo *t)
|
|||||||
{
|
{
|
||||||
if(ob_armature->type==OB_ARMATURE)
|
if(ob_armature->type==OB_ARMATURE)
|
||||||
{
|
{
|
||||||
if(ob_armature->mode & OB_MODE_POSE)
|
if((ob_armature->mode & OB_MODE_POSE) && ob_armature == modifiers_isDeformedByArmature(ob))
|
||||||
{
|
{
|
||||||
createTransPose(C, t, ob_armature);
|
createTransPose(C, t, ob_armature);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user