Thread: SDK duplication
View Single Post
# 5 03-10-2004 , 07:33 PM
Registered User
Join Date: Aug 2004
Posts: 24
As ArtBlack said, there are many ways to do this, but you want a simple way that you can duplicate and not have to set up everything more than once. Here is a quick method for you:

Create your first light and the pointer and creat a distanceDimension (Create->Messuring Tools->Distance Tool) move one of the distance locators to the light and the other to your pointer. Parent the light locator to the light and the pointer locator to the point. To make sure everything duplicates ok, also parent the distanceDimension to the light. Now create an expression that looks at the distance between the light and the pointer and changes you light. To test this I actually changed the scale of the light (a simple sphere). The expression would look somthing like this:

if (Light1_DistanceShape1.distance < 8.5)
{
Light.scaleX = 2;
Light.scaleY = 2;
Light.scaleZ = 2;

}
else
{
Light.scaleX = 1;
Light.scaleY = 1;
Light.scaleZ = 1;
}


You will have to change the distance value to what ever your scale is. Be carfull with the distance, maya internally works in cm, so if you are not in cm's then the distance on screen will not be the same as the distance in the expression. All I did was use getAttr Light1_DistanceShape1.distance to see what range I wanted for the expression.
To finish this I grouped the Light so that I could move the rotation pivot without altering the distance and moved it to the center of the `wheel`. Now I could rotate the group node and watch the Light move round and round and get twice as big when it nears the pointer.
From here I was able to duplicate the group node with `duplicate input graph` checked and everything duplicated with it. Make sure you also have `assign unique name to child nodes` checked when duplcating. Now you can duplicate the Light as many times as you like and have lots of them without having to set it all up again.

Hope this helps a little,

Richard


----------------------------------------------
Richard Cheek
https://www.freelance-animation.com
----------------------------------------------