Re: Is it Possible to Animate The End Key of a Particle Age FCurve During a Sim?

Date : Thu, 26 Apr 2007 14:38:25 +0100
To : XSI(at)Softimage.COM
From : "Vince Fortin" <vfortin(at)gmail.com>
Subject : Re: Is it Possible to Animate The End Key of a Particle Age FCurve During a Sim?
Hi Julian, here's how I'd do it:

1) Create a new float User Parameter on your PType and call it "alphaLimit".

2) Create a pEvent called "BIRTH" (Particle Age % 0, Per Trigger Particle, Jscript)

// Just point to an up-level parameter if you want to animate this value over time.
inParticle.Attributes("alphaLimit").Value = 100;

3) Create a pEvent called "RUNTIME" (Every 1 Frame, Per Particle, Jscript)

var alpha;
var age = inParticle.age;
var alphaLimit = inParticle.Attributes("alphaLimit").Value;
var color = inParticle.color;
// This is the simpliest way to script it, although it's a ll linear.
alpha = 1 - (age / alphaLimit);
color.alpha = alpha;
inParticle.color = color;

Is that what you're looking for?
 
Vincent


On 4/26/07, Julian Johnson <julian(at)exch.demon.co.uk> wrote:
> I'm trying to figure out a way to animate the end key of a Particle Age
> FCurve attached to my particle's alpha so that through the course of the
> simulation the rate of the alpha curve (from 1 to 0) becomes quicker.
> The idea is that the lifetime over which the particles dissolve becomes
> quicker over the sim.
>
> I've tried a simple scripted op on the ptype using the SCOP Wizard:
>
>    oAlpha = Inoriginal.Value.Parameters('Alpha')
>    oCurve = oAlpha.Source
>    oKey = oCurve.Keys(1)
>    #do sundry stuff to the key (ultimately tie in to animation time)
>    oKey.Set(oKey.Time,oKey.Value + 5)
>    return
>
> But the script seems to fail at oAlpha.Source.
>
> In isolation, from the ScriptEd, the script basically works:
> oPType = Application.GetValue('ParTypes.original')
> oCurve =  oPType.Alpha.Source
> #do sundry stuff to the key (ultimately tie in to animation time)
> key =  oCurve.Keys(1)
> key.Set(key.Time,key.Value -.2)
> print key.Time, key.Value
>
> Anyone have any ideas :-) ?
>
> Julian
>
> ========================================
>
> This e-mail (and any attachments) is confidential and may contain personal
> views which are not the views of Men-from-Mars unless specifically stated.
>
> If you have received it in error, please delete it from your system. Do not
> use, copy or disclose the information in any way nor act in reliance on it
> and notify the sender immediately.
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>
 

Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.