Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
Instanciated particles fade on impact

Instanciated particles fade on impact

2005-05-18       - By Bradley R. Gabe

 Back
Reply:     1     2  

Hi Alex-

It may be possible to do what you want all in particle land, but if you
can't get this working, you could try using the CGS_PlotParticles plugin
available at our site (www.cg-soup.com/downloads/plotparticles.zip)

If I had to do what you were doing, I'd probably duplicate my blossoms,
then make sure each one has a unique material. I would write a script that
would determine the frame at which the blossom hit the ground or were close
to the ground, then set keys on transparency. The script loop would look
something like this:

// Get the current selection and frame range
var coll = GetValue('SelectionList');
var Fs = GetValue('PlayControl.In');
var Fe = GetValue('PlayControl.Out');

// Set the distance for testing object near ground
var range = 0.1;

// Set the timespan in frames for fading transparency to 0
var span = 30;

// For each frame, test every object
for(var frame = Fs; frame<=Fe; frame++){

        // Check each object from selection
        for(var i=0; i<coll.count; i++){

                obj = coll(i);

                // If the object is less than range...
                if(obj.kinematics.global.posy.value < range){

                        // Get a pointer to the material transparency...
                        // This will vary based on your own material setup
                        // In this case, there is a constant material
connected directly to the material input
                        var mat = obj.material;
                        var transR = Dictionary.GetObject(mat +
'.Constant.transparency.red');
                        var transG = Dictionary.GetObject(mat +
'.Constant.transparency.green');
                        var transB = Dictionary.GetObject(mat +
'.Constant.transparency.blue');
                        var transA = Dictionary.GetObject(mat +
'.Constant.transparency.alpha');

                        // Build an array of keyframes for fadeout
                        var keyArr = [frame, 1, frame + span,
0];

                        // Apply the keyframes to the trans params
                        transR.AddFcurve2(keyArr);
                        transG.AddFcurve2(keyArr);
                        transB.AddFcurve2(keyArr);
                        transA.AddFcurve2(keyArr);

                        // Remove the object from the collection so it
doesnt set keys again
                        coll.Remove(obj);
                }
        }
}
// End Script


Sorry about the pitch... but for those who run into situations like this a
lot, or other situations that need more involved scripting or custom tools
to help out of a jam, you can subscribe to our Cuppa Soup service.

-Brad
CG Soup

>Sorry to bother you all again.. in particle hell at the moment !!!
>
>After semi succesfully creating my trees, the client has decided she
>wants blossom to fall from the trees...
>
>I have it going pretty well.. I have 14 different blossom shapes which
>are being instanced.. however when they hit the floor, I want them to
>stick then fade away.
>If they weren't instnaces I would just alter there alpha levels.. but
>as they are instance I cant get that to work ???
>
>Is this possible.. and if so can some one give me a few pointers please !!
>
>thanks in advance
>
>--
>kind regards
>
>Alex Dinnin
>
>---
>Unsubscribe? Mail Majordomo@(protected) with the following text in body:
>unsubscribe xsi

<html>
<body>
Hi Alex-<br><br>
It may be possible to do what you want all in particle land, but if you
can't get this working, you could try using the CGS_PlotParticles plugin
available at our site
(<a href="http://www.cg-soup.com/downloads/plotparticles.zip" eudora="autourl"
>www.cg-soup.com/downloads/plotparticles.zip</a>)<br><br>
If I had to do what you were doing, I'd probably duplicate my blossoms,
then make sure each one has a unique material. I would write a script
that would determine the frame at which the blossom hit the ground or
were close to the ground, then set keys on transparency. The script loop
would look something like this:<br><br>
<font face="Courier New, Courier">// Get the current selection and frame
range<br>
var coll = GetValue('SelectionList');<br>
var Fs = GetValue('PlayControl.In');<br>
var Fe = GetValue('PlayControl.Out');<br><br>
// Set the distance for testing object near ground<br>
var range = 0.1;<br><br>
// Set the timespan in frames for fading transparency to 0<br>
var span = 30;<br><br>
// For each frame, test every object<br>
for(var frame = Fs; frame&lt;=Fe; frame++){<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>// Check
each object from selection<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>for(var
i=0; i&lt;coll.count; i++){<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>obj
= coll(i);<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>//
If the object is less than range...<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>if(obj.kinematics.global.posy
.value
&lt; range){<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>//
Get a pointer to the material transparency...<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>//
This will vary based on your own material setup<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>//
In this case, there is a constant material connected directly to the
material input<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>var
mat = obj.material;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>var
transR = Dictionary.GetObject(mat + '.Constant.transparency.red');<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>var
transG = Dictionary.GetObject(mat +
'.Constant.transparency.green');<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>var
transB = Dictionary.GetObject(mat + '.Constant.transparency.blue');<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>var
transA = Dictionary.GetObject(mat +
'.Constant.transparency.alpha');<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>//
Build an array of keyframes for fadeout<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>var
keyArr = [frame, 1, frame + span,
0];<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>//
Apply the keyframes to the trans params<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>transR.AddFcurve2(keyArr);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>transG.AddFcurve2(keyArr);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>transB.AddFcurve2(keyArr);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>transA.AddFcurve2(keyArr);<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>//
Remove the object from the collection so it doesnt set keys again<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>coll.Remove(obj);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>}<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>}<br>
}<br>
</font>// End Script<br><br>
<br>
Sorry about the pitch... but for those who run into situations like this
a lot, or other situations that need more involved scripting or custom
tools to help out of a jam, you can subscribe to our Cuppa Soup service.
<br><br>
-Brad<br>
CG Soup<br><br>
<blockquote type=cite class=cite cite="">Sorry to bother you all again..
in particle hell at the moment !!!<br><br>
After semi succesfully creating my trees, the client has decided
she<br>
wants blossom to fall from the trees...<br><br>
I have it going pretty well.. I have 14 different blossom shapes
which<br>
are being instanced.. however when they hit the floor, I want them
to<br>
stick then fade away.<br>
If they weren't instnaces I would just alter there alpha levels..
but<br>
as they are instance I cant get that to work ???<br><br>
Is this possible.. and if so can some one give me a few pointers please
!!<br><br>
thanks in advance<br><br>
-- <br>
kind regards<br><br>
Alex Dinnin<br><br>
---<br>
Unsubscribe? Mail Majordomo@(protected) with the following text in
body:<br>
unsubscribe xsi</blockquote></body>
</html>