Fix #87219: 'affect transform' not working for Pose Space
`affect transform` was never supported for Pose Space in Limit constraints. This commit implements this space in the transform code. Pull Request: https://projects.blender.org/blender/blender/pulls/113363
This commit is contained in:
@@ -426,7 +426,7 @@ static void constraintRotLim(const TransInfo * /*t*/, TransData *td)
|
||||
}
|
||||
}
|
||||
|
||||
void constraintSizeLim(const TransInfo *t, TransData *td)
|
||||
void constraintSizeLim(const TransInfo *t, const TransDataContainer *tc, TransData *td)
|
||||
{
|
||||
if (td->con && td->ext) {
|
||||
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_from_type(CONSTRAINT_TYPE_SIZELIMIT);
|
||||
@@ -481,6 +481,11 @@ void constraintSizeLim(const TransInfo *t, TransData *td)
|
||||
/* Just multiply by `td->mtx` (this should be ok). */
|
||||
mul_m4_m3m4(cob.matrix, td->mtx, cob.matrix);
|
||||
}
|
||||
else if (con->ownspace = CONSTRAINT_SPACE_POSE) {
|
||||
/* Bone space without considering object transformations. */
|
||||
mul_m4_m3m4(cob.matrix, td->mtx, cob.matrix);
|
||||
mul_m4_m3m4(cob.matrix, tc->imat3, cob.matrix);
|
||||
}
|
||||
else if (con->ownspace != CONSTRAINT_SPACE_LOCAL) {
|
||||
/* Skip... incompatible `spacetype`. */
|
||||
continue;
|
||||
@@ -494,6 +499,10 @@ void constraintSizeLim(const TransInfo *t, TransData *td)
|
||||
/* Just multiply by `td->smtx` (this should be ok). */
|
||||
mul_m4_m3m4(cob.matrix, td->smtx, cob.matrix);
|
||||
}
|
||||
else if (con->ownspace = CONSTRAINT_SPACE_POSE) {
|
||||
mul_m4_m3m4(cob.matrix, tc->mat3, cob.matrix);
|
||||
mul_m4_m3m4(cob.matrix, td->smtx, cob.matrix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1002,7 +1011,7 @@ void ElementResize(const TransInfo *t,
|
||||
}
|
||||
}
|
||||
|
||||
constraintSizeLim(t, td);
|
||||
constraintSizeLim(t, tc, td);
|
||||
}
|
||||
|
||||
/* For individual element center, Editmode need to use iloc. */
|
||||
|
||||
@@ -67,7 +67,7 @@ bool transform_mode_is_changeable(int mode);
|
||||
void protectedTransBits(short protectflag, float vec[3]);
|
||||
void protectedSizeBits(short protectflag, float size[3]);
|
||||
void constraintTransLim(const TransInfo *t, const TransDataContainer *tc, TransData *td);
|
||||
void constraintSizeLim(const TransInfo *t, TransData *td);
|
||||
void constraintSizeLim(const TransInfo *t, const TransDataContainer *tc, TransData *td);
|
||||
/**
|
||||
* Used by Transform Rotation and Transform Normal Rotation.
|
||||
*/
|
||||
|
||||
@@ -55,7 +55,7 @@ static void ElementMirror(TransInfo *t, TransDataContainer *tc, TransData *td, i
|
||||
|
||||
mul_v3_v3v3(td->ext->size, td->ext->isize, fsize);
|
||||
|
||||
constraintSizeLim(t, td);
|
||||
constraintSizeLim(t, tc, td);
|
||||
}
|
||||
|
||||
float rmat[3][3];
|
||||
|
||||
Reference in New Issue
Block a user