Matrix3 MshExp::TransformNode(INode* pNode,TimeValue CurTime, int TransformType){ Matrix3 mat; switch((TransformType&0xff)) { case TN_AFTER_WORLD://After World mat = pNode->GetObjTMAfterWSM(CurTime); break; case TN_BEFORE_WORLD://Before World mat = pNode->GetObjTMBeforeWSM(CurTime); break; case TN_TRANSFORM: mat = pNode->GetNodeTM(CurTime); break; default: mat = Matrix3(1); break; } if(TransformType&TN_NO_TRANSLATION) mat.NoTrans(); if(TransformType&TN_NO_ROTATION) mat.NoRot(); if(TransformType&TN_NO_SCALE) mat.NoScale(); return mat; }
std::string LuxMaxUtils::getMaxNodeTransform(INode* node) { LuxMaxUtils *lmutil; std::string tmpTrans = ""; Matrix3 nodeTransformPos = node->GetObjTMAfterWSM(GetCOREInterface()->GetTime()); Matrix3 nodeTransformRot = nodeTransformPos; Matrix3 nodeTransformScale = nodeTransformPos; nodeTransformRot.NoTrans(); nodeTransformScale.NoTrans(); nodeTransformScale.NoRot(); nodeTransformRot = nodeTransformRot * nodeTransformScale; tmpTrans.append(floatToString(nodeTransformRot.GetColumn(0).x)); tmpTrans.append(" "); tmpTrans.append(floatToString(nodeTransformRot.GetColumn(1).x)); tmpTrans.append(" "); tmpTrans.append(floatToString(nodeTransformRot.GetColumn(2).x)); tmpTrans.append(" "); tmpTrans.append("0 "); tmpTrans.append(floatToString(nodeTransformRot.GetColumn(0).y)); tmpTrans.append(" "); tmpTrans.append(floatToString(nodeTransformRot.GetColumn(1).y)); tmpTrans.append(" "); tmpTrans.append(floatToString(nodeTransformRot.GetColumn(2).y)); tmpTrans.append(" "); tmpTrans.append("0 "); tmpTrans.append(floatToString(nodeTransformRot.GetColumn(0).z)); tmpTrans.append(" "); tmpTrans.append(floatToString(nodeTransformRot.GetColumn(1).z)); tmpTrans.append(" "); tmpTrans.append(floatToString(nodeTransformRot.GetColumn(2).z)); tmpTrans.append(" "); tmpTrans.append("0 "); tmpTrans.append(floatToString(nodeTransformPos.GetTrans().x)); tmpTrans.append(" "); tmpTrans.append(floatToString(nodeTransformPos.GetTrans().y)); tmpTrans.append(" "); tmpTrans.append(floatToString(nodeTransformPos.GetTrans().z)); tmpTrans.append(" 1.0"); return tmpTrans; }