bugfix [#23412] Weightpaint and rotate around bones

fixed by allowing an unselected armature to have its pose bones used in weightpaint mode.
This commit is contained in:
Campbell Barton
2010-10-10 23:11:34 +00:00
parent 1579c1a5c9
commit bf4075236f
2 changed files with 10 additions and 9 deletions

View File

@@ -5318,19 +5318,19 @@ void createTransData(bContext *C, TransInfo *t)
createTransPose(C, t, ob);
}
else if (ob && (ob->mode & OB_MODE_WEIGHT_PAINT)) {
/* exception, we look for the one selected armature */
CTX_DATA_BEGIN(C, Object*, ob_armature, selected_objects)
{
if(ob_armature->type==OB_ARMATURE)
{
if((ob_armature->mode & OB_MODE_POSE) && ob_armature == modifiers_isDeformedByArmature(ob))
{
/* important that ob_armature can be set even when its not selected [#23412]
* lines below just check is also visible */
Object *ob_armature= modifiers_isDeformedByArmature(ob);
if(ob_armature && ob_armature->mode & OB_MODE_POSE) {
Base *base_arm= object_in_scene(ob_armature, t->scene);
if(base_arm) {
View3D *v3d = t->view;
if(BASE_VISIBLE(v3d, base_arm)) {
createTransPose(C, t, ob_armature);
break;
}
}
}
CTX_DATA_END;
}
else if (ob && (ob->mode & OB_MODE_PARTICLE_EDIT)
&& PE_start_edit(PE_get_current(scene, ob))) {

View File

@@ -1038,6 +1038,7 @@ typedef struct Scene {
#define TESTBASELIB_BGMODE(v3d, scene, base) ( ((base)->flag & SELECT) && ((base)->lay & (v3d ? v3d->lay : scene->lay)) && ((base)->object->id.lib==0) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0))
#define BASE_EDITABLE_BGMODE(v3d, scene, base) (((base)->lay & (v3d ? v3d->lay : scene->lay)) && ((base)->object->id.lib==0) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0))
#define BASE_SELECTABLE(v3d, base) ((base->lay & v3d->lay) && (base->object->restrictflag & (OB_RESTRICT_SELECT|OB_RESTRICT_VIEW))==0)
#define BASE_VISIBLE(v3d, base) ((base->lay & v3d->lay) && (base->object->restrictflag & OB_RESTRICT_VIEW)==0)
#define FIRSTBASE scene->base.first
#define LASTBASE scene->base.last
#define BASACT (scene->basact)