f
f
Click Here
Global SectionArticlesBookstoreDictionaryDownloadsDVDsEventsForumsGalleryJob ListingsNewsNewslettersSchools
 Advanced Search
USER: PASS:  Login  Register

Subscribe
Site Links
Home > Maya > Tutorials > Dynamics / FX > How to fade particle instancer > Page 1 Change background colorChange background colorChange background colorChange background color
How to fade particle instancer
Tutorial by Alin Sfetcu
Login to add a Bookmark Discuss this tutorial in it's Forum 4 votes for an average rating of 3.75

Updated:   10/27/08

Works on:    Irix  Windows  Linux  MacOS-X
Maya Versions:   4.x, 5.x, 6.x, 7.x, 8.x, 2008, 2009
Readership Level:   Intermediate
Owner:   Sanctuary
Author Name:  Alin Sfetcu
Homepage:   http://www.roottree.ro

How to fade particle instancer

(Maya Dynamics Tutorial)


In this tutorial i`ll try to explain how to fade particle instancer on

a particle basis :). So, here we go :


I`ll duplicate my object which i intend to use as instance 10 times for this example.

The number of duplicates are actually steps of fading.


After fhat i`ll duplicate the shader of my object 10 time as well and I`ll lower the transparency on every shader 10% lower then the previus one. After that assign

the shaders to my object like in the screenshot below.


click for larger version


II`ll create my particle object and i`ll prepare it for instancer. Having to make those basics/routine every time i`m using MEL snipets to add custom attrs and write some basic creation and runtime expresion. So here is the code, just select your particle shape and run it.



string $objs[] = `ls -sl -type "particle"`;
string $obj = $objs[0];

addAttr -ln x_indexPP -keyable true -dt doubleArray $obj;
addAttr -ln x_indexPP0 -keyable true -dt doubleArray $obj;
addAttr -ln x_scalePP -keyable true -dt vectorArray $obj;
addAttr -ln x_scalePP0 -keyable true -dt vectorArray $obj;
addAttr -ln x_rotPP -keyable true -dt vectorArray $obj;
addAttr -ln x_rotPP0 -keyable true -dt vectorArray $obj;

setAttr ( $obj + ".lifespanMode") 3;

string $creationExp = `dynExpression -q -c $obj`;
string $runttimeExp = `dynExpression -q -rbd $obj`;

$creationExp = "\r\nx_indexPP = (int)rand( 0, 9 );\r\n\r\nx_scalePP = rand( 0.5, 0.8 );\r\n\r\nx_rotPP = rand( 360 );\r\n\r\nlifespanPP = rand( 3, 5 );\r\n\r";
$runttimeExp = "\r\nx_rotPP += << rand(10), rand(10), rand(10) >>;\r\n\r";

dynExpression -s $creationExp -c $obj;
dynExpression -s $runttimeExp -rbd $obj;




Now i`ll open creation expression and replace the row which

set te x_indexPP attribute with x_indexPP = 0;


Now i`ll select my 10 objects and attach the instancer. (make sure the instacer attr are set like in the screenshot so the custom attr will be used);


click for larger version


If I hit play i`ll get something like this (i`ve keyed emmiter emission rate at frame 0 with

value 20 and at frame 20 with value 0, just to keep the scene readable) :


click for larger version


Now I`ll make two new custom attrs, named x_dieAt and x_dieAtPP. x_dieAt is a %

value of the lifespanPP at which i want my particle to start fading. x_dieAtPP is the

calculated value at which my each particle i want t start fade, and i`m using it

because i have diferent lifespanPP for every particle. Next, in the creation expression

i`ll add the line which calculate x_dieAtPP.


click for larger version


Now I`ll start dealing with runtime expression. This is pretty simply but a good

understanding of the linstep function is needed. Below is the code i`m using to

make my particle switch to the next object (which is the next step in transparency).


click for larger version



Hope i`ve made this very clear and easy to follow.



fade_instancera.mov



Alin Sfetcu - VFX Artist

aSfetcu (at) gmail.com

.

Login to add a Bookmark Discuss this tutorial in it's Forum 4 votes for an average rating of 3.75

Latest Forum posts about this Tutorial

 Error: Invalid Call To "linstep" by Sanctuary (06/11/09)
 Mel Scripting? by larsonworks (05/02/07)
 Useful ? by Joojaa (01/15/07)
 Erh How Complicated by Joojaa (01/15/07)
 Read the Tutorial Here by admin (05/06/06)

Discuss in Forums

Related Learning Tools
Maya Related DVDs



Digital Sets 4: Image- Based Terrain
Maya Related Books



Learning Autodesk Maya 2008: Foundation
Global DVDs



Visual Effects Compositing Fundamentals

Top Rated Maya Tutorials

1. Maya Particle Instancer by Mike Harris (03/16/06)
2. Working With Macromolecular Data in Maya: DNA by robotball (08/29/05)
3. Particle Emission when objects collide by Alex Alvarez (10/23/06)
4. Pen writing on paper (Maya paint effects) by Duncan Brindsmead (10/24/06)
5. Making hair styles with Maya fur by Anuradha Jayathilaka (11/05/08)


Related Tips


No Results to Display


More Tutorials by Sanctuary

1. How to make a realistic cable by Alin Sfetcu (10/22/08)
2. How to fade particle instancer by Alin Sfetcu (10/27/08)






Sponsors

Sponsor

Contact Us | Advertise | Post Jobs | Post News | Post Events | Terms