View Single Post
Old 03-03-2004, 06:11 PM   #43
mind_raper
Registered User
 
Join Date: Nov 2002
Location: Pakistan
Posts: 57
Thanks: 0
Thanked 3 Times in 3 Posts
Default

found a usefull bit of information on Highend while i was looking for my flower prb hope it help....

Q: I have a fast moving object going past some paintFX trees, and I want the effect of wind created by it's passage to cause realistic swaying and wind blowing the branches around.
A: If you want to simply push the trees out of the way of the fast moving object, then create a small curve, attach it to your strokes(set control curves), and make the curveAttract negative with a suitable curveMaxDist on your brushes. Group the control curve with your moving object. For a turbulent wake I would generally animate the turbulence intensity on your brushes, staggering this animation based on brush location.

Rather than using control curves, the function \scripts\paintEffects\paintCollideFunc.mel could also be modified to work.

To make paint effects collide with the camera do the following: Copy this function to your local scripts directory before modifying it. You may wish to rename both the filename and the function inside. Instead of using the distance to the origin that it currently computes modify it to use the following distance:

float $c[3] = `getAttr persp.translate`;
float $dist = $sX * $c[0] + $sY * $c[1] + $sZ * $c[2];
if( $dist > 0 )
{
$dist = sqrt( $dist );
}


This is the distance from the camera to the current segment point( providing that you have not transformed the camera as a grouped node).

You need to add this modified paintCollideFunc to the runtimeFunc on all the brushes you wish to collide with(simply put the function in your scripts directory and enter the function name in the runtimeFunc field on the brush). Note that the wireframe redraw of paint effects is substantially slower when using this function.
__________________
Learn the Rules|Then|
Burn the Rules Book
mind_raper is offline   Reply With Quote