'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 Tools Search this Thread Display Modes
Old 03 March 2008   #1
'move -rpr' using the API


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?

Old 03 March 2008   #2
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?

Old 03 March 2008   #3
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
Old 03 March 2008   #4
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?

Old 03 March 2008   #5
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 Diamant

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

Old 03 March 2008   #7
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
Society of Digital Artists

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

All times are GMT. The time now is 01:29 AM.

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