Message 1 of 4
c++ pivot problems
Not applicable
08-06-2015
02:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I thought I might if had this working. But no -sigh
It looks to me moving my pivot sometimes if the object is not scaled. Then its a mess.
I'm I doing this right?
ip = GetCOREInterface();
ip7 = GetCOREInterface7();
// switch to pivotCenter from max script -- couldn't find in SDK
ExecuteMAXScriptScript(_T("toolMode.pivotCenter()"), 0, 0);
Box3 bb;
ViewExp& vpt = ip->GetViewExp(NULL);
for( auto i = 0; i < ip->GetSelNodeCount(); i++){
INode *newnode = ip->GetSelNode(i);
Object *obj = newnode->GetObjectRef();
obj->GetLocalBoundBox(ip->GetTime(), newnode, vpt.ToPointer(), bb);
Point3 theBox(bb.Center().x, bb.pmax.y, bb.pmin.z );
Matrix3 mat(1);
newnode->ResetPivot(ip->GetTime());
newnode->Move(ip->GetTime(), mat, theBox, TRUE, FALSE, PIV_PIVOT_ONLY, FALSE);
newnode = NULL;
}
ip->RedrawViews(ip->GetTime());I guess what I'm after is the c++ way to ....
obj.pivot = [obj.min.x, obj.center.y, obj.center.z]
thanks for any thoughts on this