Posted: Feb 02, 2007
Category: Autodesk Maya
I thought I'd share a couple of my favorite Maya tips.
1. You can tumble ortho views. This is especially useful for technical illustration. Just toggle off "Orthographic Views:locked" in the tumble tool settings.
2. One can directly type expressions inside numeric edit cells in the attribute editor. Just click inside any numeric field and type "=". This puts the cell into expression mode. Whatever you type after the "=" is then turned into an expression node when you hit return. Expressions can use the keywords "time" and "frame". Thus if one typed
= time
into the ytranslate edit cell for an object, the object will now move uniformly upward where its height is equal to the current time in seconds.
To make it go half as fast simply type:
=time * .5
To make it jump in a totally random fashion type:
=random(1.0)
To make it wiggle up and down in a random yet smooth fashion you can use the noise function. Type:
= noise( time )
To make it wiggle up and down in a uniform fashion type:
= sin( time )
To make it lock to the y position of a second object called "sphere2" type:
= sphere2.ty
At any point you can rightmouse over the attribute name to open the expression editor for easy editing.
In order to post any comments, you must be logged in!
|
| Posted by Duncan Brinsmead on Jun 02, 2011 at 04:43 PM
|
I'm not aware of an automated method to select objects near a locator currently, so I think you would need to write a mel script. There might be something on creativeCrash to do this. One method would be to check the distance between the locator position and object center inside an expression. If you make these positions vector variables and subtract them then take the magnitude of the result you get the separation distance. Here is a simple expression that does this.
string $objs[] = `ls -type mesh`;
vector $l = `getAttr locator1.worldPosition[0]`;
float $selectDist = 1.0;
for( $obj in $objs ){
vector $v = `getAttr ($obj +".center")`;
if( mag($l-$v) < $selectDist ){
select $obj;
}
}
When you playback any meshes within the selectionDist value will become selected. Use select -r if you want other objects to become unselected.
|
|
| Posted by vijay_7363 on Jun 02, 2011 at 05:31 AM
|
hi duncan
how can i select objects in the scene, through a animated locator position
|
|
| Posted by DustCentury on Mar 28, 2011 at 03:05 AM
|
| I`m sorry i just want to ask a stupid question(for me maybe it will be opposite).i`m a college student in china with common questions,but where can i get more informations about those basic expressions?I became so confused when seeing theses scripts,but be excited by these amazing Special effects!Could you introduce some basic ideas for me?I just don not know how to begin with it.Very pleased to share with your tips!Thank you!
|
|
| Posted by slainye on Mar 01, 2011 at 02:21 PM
|
| Thank you!- let me have a go with those settings.
|
|
| Posted by Duncan Brinsmead on Mar 01, 2011 at 02:16 PM
|
The default gravity on hair (.98)is correct if units are interpreted as meters. (note that the actual units setting has no effect on dynamics) Thus if you are treating units as cm make the gravity 98.0. Also initially make the mass 1 and the drag zero. One can think of the drag as the mass of the air. If it is high, then it is like the hair is underwater. You may also need to increase the iterations on the hair to avoid stretching when using real world gravity settings. One may need to lower stiffness to compensate for increasing the iterations.
For the boat on ocean, if you did "make boat" then look at the extra attributes on the locator that the boat is parented to. As well there are notes on that node. Lowering the objectHeight attribute might help you( this is initially set based on the bounding box of your boat object... it might be wrong if your boat has a tall mast). Depending on the scale one can set things like gravity( the speed of the ocean waves should also be set to correctly match the scale ). WaterDamping will cause the boat to more exactly follow the wave. Also the pivot center is important... for a boat with a mast you may wish to translate it upwards relative to the locator, so that the center of the locator transform is the center of the boat hull.
|