Transform; correct inverse parent implementation for translating children
This commit is contained in:
@@ -155,7 +155,6 @@ void createTransTexspace(void)
|
|||||||
Object *ob;
|
Object *ob;
|
||||||
ID *id;
|
ID *id;
|
||||||
|
|
||||||
|
|
||||||
ob= OBACT;
|
ob= OBACT;
|
||||||
Trans.total = 1;
|
Trans.total = 1;
|
||||||
td= Trans.data= MEM_callocN(sizeof(TransData), "TransTexspace");
|
td= Trans.data= MEM_callocN(sizeof(TransData), "TransTexspace");
|
||||||
@@ -840,17 +839,16 @@ static void ObjectToTransData(TransData *td, Object *ob)
|
|||||||
|
|
||||||
Mat3CpyMat4(td->mtx, ob->obmat);
|
Mat3CpyMat4(td->mtx, ob->obmat);
|
||||||
|
|
||||||
object_to_mat3(ob, obmtx);
|
|
||||||
|
|
||||||
/*
|
|
||||||
Mat3CpyMat4(totmat, ob->obmat);
|
|
||||||
Mat3Inv(obinv, totmat);
|
|
||||||
Mat3MulMat3(td->smtx, obmtx, obinv);
|
|
||||||
*/
|
|
||||||
if (ob->parent)
|
if (ob->parent)
|
||||||
{
|
{
|
||||||
Mat3CpyMat4(td->mtx, ob->parent->obmat);
|
float totmat[3][3], obinv[3][3];
|
||||||
Mat3Inv(td->smtx, td->mtx);
|
|
||||||
|
/* we calculate smtx without obmat: so a parmat */
|
||||||
|
object_to_mat3(ob, obmtx);
|
||||||
|
Mat3CpyMat4(totmat, ob->obmat);
|
||||||
|
Mat3Inv(obinv, totmat);
|
||||||
|
Mat3MulMat3(td->smtx, obmtx, obinv);
|
||||||
|
Mat3Inv(td->mtx, td->smtx);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user