World rotation VS local rotation (expression scripting)

Become a member of the CGSociety

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

Thread Tools Display Modes
  09 September 2013
Question World rotation VS local rotation (expression scripting)

I'm essentially attempting to create a ball rolling expression that will rotate a sphere via a locator e.g.

locator1.rotateY = polySphere1.rotateY

...with the exception that I need the locator to have the ability to rotate the sphere only on its world axis, rather than it's local one. I assume this requires a higher level of scripting than the typical straight-forward expression scripting (as shown above).

Is there anyone who knows of a quick and simple way to do this? I'm still a novice at this scripting stuff, so it'd be nice to have something I can pick apart and adapt to other things. For this, I will be eternally grateful and shall forever be in debt to you
  09 September 2013
use a orient constraint?
blah blah blah
  09 September 2013
Thanks for the reply. Yes I tried that. Unfortunately the orient constraint locks its target object and it loses the ability to be keyed on it's local axis. Essentially what I'm looking for is a script that will rotate an object (say, a sphere) on "world" rotation mode, while still having the ability to key it's local rotation (when necessary).

For instance, when you open up the script editor and rotate an object on the world axis, you get this:

rotate -r -ws 0 32.833727 0 ;


rotate -r -ws 0 -30.391645 0 ;

or this...

rotate -r -ws -48.256342 0 0 ;

Basically it'd like to have a way of rotating a specific object (a sphere in this case) via the " rotate -r -ws 0 0 0 ; " command using a separate locator object that won't actually screw with that target's local rotation controls i.e. " rotate -r -os 0 0 0 ; " I'm certain there must be a way to do this. It would be incredibly useful.
  09 September 2013
simply parent your object under a null (a 'zero out' object that has the same transform attributes, so your objects is now at 0,0,0 transforms)

and apply the direct connection or orient constraint on the parent. You can still key your object as you wish.

'zero outs' are extremely often used in rigging, heck I even have a shortcut to create them on the fly.
maya@reddit r/maya
  09 September 2013
Thanks Bernie, I tried that solution as well. The thing is, the "parent" object needs to stay locked on it's Y axis as well as it is the object that's driving the Xrotation of the child sphere. As the outer parent rotates around the Yaxis I would like the child object to rotate respectively on the Yworld axis while still being manipulated by the parent with the scripted X rotation.

It's a bit hard to explain what I have going on, so I'll attach the file. The center "MOVE" locator drives the child Xrotation, while the outer "AIM" locator follows the target locator. The system works perfectly for a wheel/tire system, but I want to adapt to make an effective sphere rolling system. The idea is that the inner most sphere rotates inversely on the Yworld axis to offset the rotation value created by the AIM constraint parent.

The primary problem is that the Xrotation parent constantly rolls the inner sphere into a different orientation so that scripting any local value on the inner sphere is useless for the effect. So a World based rotation will be necessary to offset it correctly. Just look at the .ma file and you'll see exactly what I mean...
  09 September 2013
The attachment...

Last edited by LordRaidis : 09 September 2013 at 03:43 PM.
  09 September 2013
So I've been looking into this a bit more--and boy, this is a hell of lot more difficult than I had originally anticipated. The closest thing I've been able to find for what I'm doing is the classic makeroll.mel script, but even that is extremely buggy. Anybody know of a good existing scripts for making a ball roll based on the X and Z translations?
  09 September 2013
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:56 AM.

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