PDA

View Full Version : Exporting Motion Vectors out of nParticles


RhythmOfLine
10-09-2009, 10:26 PM
Hello Folks,

Hope all is well :)

I am trying to export motion blur vectors out of Maya 2009 in Mental Ray sicne there is an option to export motion vectors. But I need them to work for nParticles, Fluids and Sprites
and then use RSMB(ReelSmart Motion Blur in Fusion) to apply motion blur in post.

I always thought that motion vectors can only be generated for geometry and not particles
so the only easiet way I can think of is to instance geometry to particles matching the radiusPP
and generating motion vectors on those to use on particles in post.

I really need to be able to figure this out so any and all help will be much appreciated.

Thanks for the help in advance, have a good one!

Cheers,
SD

stooch
10-10-2009, 01:51 AM
particles yeah you got the right idea. instance spheres or use geometry and this will generate the motion vectors.

fluids though... not going to work. since they are "stationary" in world space and your stuff is flying "through" them.

I suppose you can emit nparticles through your fluids and use the fluid as a field, the motion of the nparticles should approximate the fluids and then you could get motion vectors out of them using the instancing trick.


Hello Folks,

Hope all is well :)

I am trying to export motion blur vectors out of Maya 2009 in Mental Ray sicne there is an option to export motion vectors. But I need them to work for nParticles, Fluids and Sprites
and then use RSMB(ReelSmart Motion Blur in Fusion) to apply motion blur in post.

I always thought that motion vectors can only be generated for geometry and not particles
so the only easiet way I can think of is to instance geometry to particles matching the radiusPP
and generating motion vectors on those to use on particles in post.

I really need to be able to figure this out so any and all help will be much appreciated.

Thanks for the help in advance, have a good one!

Cheers,
SD

RhythmOfLine
10-12-2009, 08:15 PM
thanks Stooch, I appreciate it. how about exporting motion vectors out of velocity vectors in a fluid? how would one write those out as a motion vector pass?

Aikiman
10-12-2009, 08:40 PM
Im just trying to do the same thing, apparently there is some script you can use that does it for you. I havent checked Highend yet but Im sure google can help us out too.

RhythmOfLine
10-12-2009, 11:19 PM
Aikiman, attached is a script that exports velocity vectors in fluids. you can also export other stuff liek density, fuel etc. You can read more about it here - http://www.hosok2.com/project/cloud/cloud.htm

I still can't get any motion vectors out of Maya from regular particles in Maya 2009. Not sure about the process. Anyone done this before?

Aikiman
10-13-2009, 01:00 AM
I just picked that one up myself but Im having usability issues with it, for some reason it wont save out the files. have you used it?

RhythmOfLine
10-13-2009, 06:42 PM
Nah, didn't work here either.

I am still trying to figure out a way to export motion vectors directly from fluids and cloud type particles. Basically volume type particles.

Cheers,
SD

RhythmOfLine
10-16-2009, 01:27 AM
so, the following snippets of code color my fluid red and green based on where they are going. red in X and green in Y. the only issue now is that first of all they need to go from 50% green to 100% green and 50% red to 100% red instead of being full on red and green hues.

my second issue is that these are in container space but if the camera rotated or the container rotated, they wouldn't work since the axis would be all flipped. how would one go about resolving this issue? i am guessing it needs some sort of matrix multiplication with the camera space and world space.



float $resX = 30;

float $resY = 30;

float $resZ = 30;

string $fn = "fluidShape1";

for($x=0; $x<$resX; $x++)

for($y=0; $y<$resY; $y++)

for($z=0; $z<$resZ; $z++)

{

float $den[] = `getFluidAttr -at "density" -xi $x -yi $y -zi $z $fn`;

float $vel[];clear $vel;

if($den[0] > 0)

{

$vel = `getFluidAttr -at "velocity" -xi $x -yi $y -zi $z $fn`;

float $cor[] = <<$vel[0], $vel[1], $vel[2]>>;

setFluidAttr -at "color" -vv ($vel[0]) ($vel[1]) 0 -xi $x -yi $y -zi $z $fn;

}

}

CGTalk Moderation
10-16-2009, 01:27 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.