|04 April 2011||#1|
Christopher James Ford
CG Generalist / Shader Artist
Johannesburg, South Africa
Join Date: Oct 2006
How can a particle Collision event trigger an animated change in texture?
I'm busy with a scene where there are bouncey balls (nparticles) colliding with mutliple cubes in the scene. The effect I'm going for is whenever a particle collides with a cube I want that cube to light up and then fade to its original colour again. So the bouncing particles make the cubes light up whenever they collide.
All I need to achieve this is a collision event to drive a value between 0 and 1 which will be used as a fade between 2 textures. When the value is 0 it displays texture A, when the value is 1 it displays texture B.
So far I have a MEL command running on a collision event with one surface. I'm getting the first collision to adjust the value of a multiplyDivide node from 0 to 1, but it just stays at that value after the first collision. I don't know how to make the mel script fade the value back to 0 after a given number of frames. and then push the value back to 1 on the next collision.
The MEL script for my event so far looks like this..
shader_Switch is my collision event, nParticle1 is my particle object, pPlane 1 is the object the particle shape is colliding with.
So what I have at the moment is the first collision between particle and surface adjusting a value from 0 to 1, and then nothing further happens.
But what I need is that value to change from 0 to 1 and then fade back to 0 on each particle/surface collision.
Would love to know how to do this, the concept seems quite simple and I'm sure it's possible. Any help would be greatly appreciated.
Last edited by LinchpinZA : 04 April 2011 at 02:45 PM.
|Thread Closed share thread|