'move -rpr' using the API

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  03 March 2008
'move -rpr' using the API

Hey

Does anyone know how to achieve the same the same result as with using the 'move -rpr' command via the API? Started using the API a while back and iam at the moment trying write myself a kinda of "Library", if you will, with things i normally do in melscripts. As to complement to the scriptingfunctionallity, you never know when such things might be good have. Most things i have figured out just fine, but the above i can quite seem to wrap my head aroud. In this case iam trying to just write a simple function that takes and object / MPoint / MVector / floats / double, or whatever, havnt decided yet, and just moves that object to that location using the same method as 'move -rpr' command would.

Only been using the the API for a couple of months so, iam still quite new to it. Its probably not that complicated, but any help would be appreciated. Anyone?

/Matte
 
  03 March 2008
No one? Ok, an alternative way of asking the question maybe.

What i to be able to do really is a way of moving an object to a world space location without having to bother about how it has been previously transformed. Lets say that an object has 3 parents, all these objects have been frozen/moved/rotated in x y z completely arbitrary. What i want to be able to do is to run a command to just say that i want an object that is at the far end of this hiearchy to be at position 2 2 2, or something else, and just have the object move to this scene coordinate position.

This would probably include some matrix mathematics to achieve, and i have found some info regarding converting between coordinate spaces, but nothing i have found so far has helped me in better understanding on how to attack this.

Anyone know of any good webpages which one can read to get a better crasp of what need to be done to solve this?

/Matte
 
  03 March 2008
try looking into MFnTransform.. that is where you do all your transformations in the api.. or you can just call the move mel command from the api if its easier.
__________________
Rich Diamant
http://www.rd3d.com
 
  03 March 2008
Diamant: Working with the MfnTransform class is not really the problem as i have already experimented much with the members within. And so far i havnt found a single/combination member functiallity that does this. So i get the feeling that the rpr argument in the move command is a compound that does a lot of things to achieve its behavior. Its this behavior that eludes me, so i was hoping that someone that understands the mathematics behind all this could point me in the right direction. Anyone from alias/autodesk here who actually wrote the command, hehe?

/Matte
 
  03 March 2008
-Edit
so I actually was a little confused as to what move -rpr does.. after tinkering.. its really no different then an absolute movement of an object except its based off of the rotation pivot.. in that case.. again, you use MFnTransform.

get the rotation pivot.. then move the object to zero based off of the rotation pivot, then move it however much you want to move it and you will have the same effect as -rpr.. all within MFnTransform.

-Rich
__________________
Rich Diamant
http://www.rd3d.com

Last edited by Diamant : 03 March 2008 at 12:44 AM.
 
  03 March 2008
Aha, given that seemingly simple piece of advice i figured out how to solve it. I thank thee for zee input.

/Matte
 
  03 March 2008
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:15 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.