Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 03-05-2003, 06:57 PM   #1
mind_raper
Registered User
 
Join Date: Nov 2002
Location: Pakistan
Posts: 57
Thanks: 0
Thanked 3 Times in 3 Posts
Thumbs up EXPRESSIONS FOR ALL! (knowledge tidbits)

Sorry to break-in mind-raper, but I'm making this thread STICKY so it will always be at the top for everyone to learn from!

Post your particle/dynamics EXPRESSIONS here for everyone to learn from!

Please write a little "how-to" along with your expression, so we will all know how to try it, and experiment with applying it to our dynamics/particle scenes!

Thanks all!


THREAD STARTS HERE first post by mind_raper
here's a little nice expression to .. colorize you particles system,
i have learnd it from gnomon workshop well its really good & ...
is very simply

first from general options add per particle attribute
the rightclick---> write creation expression::

take ur your are particle shape node (particleShape1) and add per particle attiribute (rgbPP)
and then assign a random value b/w (minVector i.e <<.3,5,7>>) and (maxVector i.e <<.5,7,1>>).

select the render type streaks or multi-streaks or what ever u want check on the color Accum button and the lightining button too

play around the values to see different color effects...


particleShape1.rgbPP = rand(<<.3,5,7>>,<<.5,7,1>>);



hope u find it usefull
enjoy - -> :banana:
__________________
Learn the Rules|Then|
Burn the Rules Book
mind_raper is offline   Reply With Quote
Old 03-05-2003, 07:25 PM   #2
ragecgi
Super Moderator
 
ragecgi's Avatar
 
Join Date: Sep 2002
Location: Minnesota, USA
Posts: 3,709
Thanks: 0
Thanked 13 Times in 12 Posts
Default

Thanks mind-raper!

I think everyone should know the power of using expressions with particle systems, and your post will help others "EXPERIMENT" and learn, rather than be affraid, or overwhelmed.

Good job m8!
__________________
Israel "Izzy" Long
Motion and Title Design for Broadcast-Film-DS
izzylong.com
ragecgi is offline   Reply With Quote
Old 03-05-2003, 07:44 PM   #3
ragecgi
Super Moderator
 
ragecgi's Avatar
 
Join Date: Sep 2002
Location: Minnesota, USA
Posts: 3,709
Thanks: 0
Thanked 13 Times in 12 Posts
Default

Here is a little expression tidbit from me to help this thread along:

TO RANDOMIZE STUFF: selectedObjectname.tx = rand(-10,10);

"tx", or whatever, is the attribute you can choose to have the expression applied to.

So, for random particle ROTATION:

selectedObjectname.rotX = rand(0,360);
selectedObjectname.roty = rand(0,360);
selectedObjectname.rotz = rand(0,360);

Try this as a CREATION expression, AND then try it as a RUNTIME expression to see the difference between these calculation types
__________________
Israel "Izzy" Long
Motion and Title Design for Broadcast-Film-DS
izzylong.com
ragecgi is offline   Reply With Quote
Old 08-05-2003, 07:07 PM   #4
mind_raper
Registered User
 
Join Date: Nov 2002
Location: Pakistan
Posts: 57
Thanks: 0
Thanked 3 Times in 3 Posts
Default Speed, Stuff

i think that was difficult...
well no prb....

tell u one thing....they are very easy just u need little bit of understanding......here's one more example from maya's documentation!
moving the particles.....

Use the Particle Tool to place a collection of particles in the workspace. You then create the following creation expression to control their velocity:

particleShape1.velocity = <<0,1,0>>;

All the particles move in a Y-axis direction at one grid unit per second as the animation plays.

explaination

"particleShape1" is the shape node for ur particle object that can be anything that u have named

"velocity" is the attirbute for shape node.

"<<0,1,0>>" is the value for X, Y, Z Respectivly
try to change the values and make it more dynamic with coditional statments

like if frame==something
move in X direction

or the way u wanted.


hope this works for u ....!

enjoy coding...!
__________________
Learn the Rules|Then|
Burn the Rules Book

Last edited by mind_raper : 09-05-2003 at 08:31 PM.
mind_raper is offline   Reply With Quote
Old 20-05-2003, 09:04 AM   #5
mind_raper
Registered User
 
Join Date: Nov 2002
Location: Pakistan
Posts: 57
Thanks: 0
Thanked 3 Times in 3 Posts
Lightbulb Kill particles a few moments after they reach a specified locator

create an emitter and a locator and create another locator
first select the particle and shift select the 1st locator
goto --- > Particles -- > goals--option reset the setting
and press ok
do the same with other locator
Animate the particle from one locator to another using Goalweight attribute

then add the following script and see the magic of expressions
thanks for the cool expression
<< Daniele Tosti >>

<b>
vector $partPos = particleShape1.position;
if ($partPos > locatorName.ty)
{
particleShape1.lifespanPP = rand (5);
}
else
{
particleShape1.lifespanPP = 5 ;
}</b>

enjoy coding
:banana:
__________________
Learn the Rules|Then|
Burn the Rules Book

Last edited by mind_raper : 20-05-2003 at 09:07 AM.
mind_raper is offline   Reply With Quote
Old 02-07-2003, 02:40 PM   #6
mind_raper
Registered User
 
Join Date: Nov 2002
Location: Pakistan
Posts: 57
Thanks: 0
Thanked 3 Times in 3 Posts
Default Attribute of an object at a certain “offset"

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...........
__________________
Learn the Rules|Then|
Burn the Rules Book
mind_raper is offline   Reply With Quote
Old 03-07-2003, 04:06 AM   #7
schmick
Registered User
 
Join Date: Apr 2002
Posts: 222
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nice thread here, i know i'll be learning from it, just hope it sticks
schmick is offline   Reply With Quote
Old 03-07-2003, 01:06 PM   #8
brian_ellebracht
Registered User
 
brian_ellebracht's Avatar
 
Join Date: Oct 2002
Location: St. louis Mo
Posts: 1,580
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Wow nice thread THis is a really good idea
brian
__________________
Please check
My (old) website!
brian_ellebracht is offline   Reply With Quote
Old 03-07-2003, 03:38 PM   #9
ragecgi
Super Moderator
 
ragecgi's Avatar
 
Join Date: Sep 2002
Location: Minnesota, USA
Posts: 3,709
Thanks: 0
Thanked 13 Times in 12 Posts
Default

It can only get bigger
__________________
Israel "Izzy" Long
Motion and Title Design for Broadcast-Film-DS
izzylong.com
ragecgi is offline   Reply With Quote
Old 04-07-2003, 09:14 AM   #10
mind_raper
Registered User
 
Join Date: Nov 2002
Location: Pakistan
Posts: 57
Thanks: 0
Thanked 3 Times in 3 Posts
Default

yes absolutly !
Cause expression makes ur animation look more healthy and realistic
support is all needed...!
__________________
Learn the Rules|Then|
Burn the Rules Book

Last edited by mind_raper : 04-07-2003 at 09:16 AM.
mind_raper is offline   Reply With Quote
Old 04-07-2003, 09:35 AM   #11
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Here's a little tip. If you use the seed() function you can be sure your expression with rand() functions run always the same way.

Code:
{
	seed(1234);

	float $foo = rand(-5, 5);
}
The $foo will contain a random value, but it is allways the same in a given frame...
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 04-07-2003, 05:03 PM   #12
ragecgi
Super Moderator
 
ragecgi's Avatar
 
Join Date: Sep 2002
Location: Minnesota, USA
Posts: 3,709
Thanks: 0
Thanked 13 Times in 12 Posts
Default

Cool K!!
__________________
Israel "Izzy" Long
Motion and Title Design for Broadcast-Film-DS
izzylong.com
ragecgi is offline   Reply With Quote
Old 06-07-2003, 07:31 PM   #13
mind_raper
Registered User
 
Join Date: Nov 2002
Location: Pakistan
Posts: 57
Thanks: 0
Thanked 3 Times in 3 Posts
Default Removing linear breaks

Moving a turbulance field with object the problem is..
noise patterens move slong with it
if u we want remove linear breaks
we use turbulance phase attribute

let say you....want to move a turbulance field...through particles and want to....
effect its nearest as u know turbulance field is not good at moving, thats why to aviod that we use phase as per need


Example script :


turbulance field.phaseX = times * 4;

play wid it....
it really handy in particle system..!

enjoying coding..!
__________________
Learn the Rules|Then|
Burn the Rules Book
mind_raper is offline   Reply With Quote
Old 07-07-2003, 12:12 AM   #14
ragecgi
Super Moderator
 
ragecgi's Avatar
 
Join Date: Sep 2002
Location: Minnesota, USA
Posts: 3,709
Thanks: 0
Thanked 13 Times in 12 Posts
Default

Rock on m8!
__________________
Israel "Izzy" Long
Motion and Title Design for Broadcast-Film-DS
izzylong.com
ragecgi is offline   Reply With Quote
Old 16-07-2003, 01:11 PM   #15
mind_raper
Registered User
 
Join Date: Nov 2002
Location: Pakistan
Posts: 57
Thanks: 0
Thanked 3 Times in 3 Posts
Default Some Handly Little Expressions

Rotating Wheels of Car or anything

Wheels on a car: apply to the wheel rotate in z channel
wheel.rz=car.tx/(2*3.145) * 1*360;

Wind shield wipers

Windshield wipers: apply to the wiper rotate in x channel
wiper.rx = (sin (.9 *time)*45)+10;
wiper = wiper
sine = sine
speed = how much fast you want() here i have put .9
time = time
degree = i put (45)
offset for position i put (10)


Random

Imbedded Sin Waves for a Random Effect
ty = sin (sin (.5 * time) * time);


enjoy ~ !
__________________
Learn the Rules|Then|
Burn the Rules Book
mind_raper is offline   Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
exporting / importing expressions djb123 Technical Issues 2 11-04-2012 12:52 AM

Thread Tools





A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.