SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.


SM Forums / Maya Questions / Dynamics & Special Effects / EXPRESSIONS FOR ALL! (knowledge tidbits)

Dynamics & Special Effects Maya Particles, nDynamics, Fluids, Rigid Bodies & General VFX

Join the conversation. Reply to post
Page 5 of 5 « First 3 4 5
 
Thread Tools
25-10-2016, 07:44 PM   #61
Animate95
Registered User
 
Join Date: Oct 2016
Posts: 1
Help with a noise expression
Hi! I saw that everyone has been posting mel solutions for various expressions. I was wondering if anyone knew how to create an expression for making particles move randomly. I am in the process of creating particle effects for pollen, but I can't get the particles to move independently around the object. I looked into different expressions that could possibly work, but not one has been successful. I believe that this has to be done from the per particle array under a noise expression. If anyone could help it would be much appreciated!
  Reply with quote
04-02-2017, 03:26 PM   #62
simplymaaya
Registered User
 
Join Date: Feb 2017
Posts: 1
Quote:
This expression will take the attribute of an object at a certain “offset” time, and apply it to another objects attribute. For instance it will take it off a cubes translateZ attribute, and assign it to a spheres translateZ attribute.

-Create a new scene.

-Create a polyCube.

-Create a polySphere.

-Translate the sphere about 10 units in Y.

-Open the Expressions editor, then Select Filter/By Expression Name.

-Type in the following:

int $offset = 10;
int $currentTime = `currentTime -q`;
$offsetTime = $currentTime - $offset;
$cube1Zpos = `getAttr -t $offsetTime pCube1.tz`;
pSphere1.translateZ = $cube1Zpos;

-Hit Create.

and here is the explaination !


//Time offset expression
//offset length (in frames)
int $offset = 10;


//Get current time
int $currentTime = `currentTime -q`;


//Substract the offset to the current time
//so if current time is 10,
//and offset is 2, offsetTime will be 8
$offsetTime = $currentTime - $offset;


//Get the value of pCube1.translateZ
//at frame $offsetTime (8 in our example)
$cube1Zpos = `getAttr -t $offsetTime pCube1.tz`;


//Assign it to pSphere1.translateZ
pSphere1.translateZ = $cube1Zpos;

This could be taken much further, you could for example setup joints and IK so it looks like power tubes are going from the mothership to the children, you could also add a custom attribute called “motion” and multiply the “noise” section of the expression by it, so that if you decide to turn you noisy motion off you would just have to set the custom attribute to 0. You could keyframe that attribute so you could control the random “floating” motion of the ship throughout the scene so it stops looking as if it were floating if it lands for example.

This type of setup could also be applied to a cranefly, or any other type of futuristic flying object etc. Experiment with setting all sorts of different relationships etc until you are comfortable with this expression.


this is very handy little snippet from
Oliver Shyal Beardsley
thanks alot for .......it

hope you enjoy it...........


http://shyal.com and Shyal Beardsley's showreel https://www.youtube.com/watch?v=V9HTrE7xEnc
  Reply with quote
Reply
Page 5 of 5 « First 3 4 5

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
exporting / importing expressions djb123 Maya Technical Issues 2 10-04-2012 11:52 PM
How are expressions processed? Vesuvian Maya Basics & Newbie Lounge 1 15-02-2010 02:16 PM
facial expressions grunze Maya Basics & Newbie Lounge 1 28-10-2003 07:39 PM
facial phenmones and expressions strytus Animation 4 19-10-2003 05:22 PM
Help with expressions for polyplanes Darkware Programming 10 16-01-2003 12:24 AM