Grasshopper

algorithmic modeling for Rhino

<UPDATE> The component has been updated for Grasshopper 0.8. also new option to allow you to not inport the rgbPP attribute.

I have created a new definition for grasshopper that will import particle animations from Maya into grasshopper. The importer works in realtime, so if you have maya and grasshopper opened at the same time any changes to the particles in maya will be reflected in Grasshopper. Right now I only import two attributes, position as point and velocity as a vector. The script is open and easy to add any property you want to carry over. The idea behind the function is to use Maya ability to create “smarter” point cloud using forces and AI. the definition is in the download section at

www.cerver.org


how to use

1. In Maya create a particle system and add a new expression using the dynExport option.

dynExport -atr position -atr velocity -atr rgbPP -f pda NameOfParticle

or

dynExport -atr position -atr velocity -f pda NameOfParticle

Look at the Maya docs if you are not familiar with the command or expressions

2. Maya will write out the particles in real-time usually to a folder named “particles” in you Maya project directory. The file names will be the same name as the particle system name. input the name of the path and the name of the file into Ploc and Pname. For example.

Ploc = C:\Users\robert\Documents\maya\projects\particleTest\particles\test\

Pname= nParticleShape1

3. FRAME will control the frame number of the particle animation in maya

4. SCALE will scale the particle system 5. SWAPY will flip the Y and Z axis

5. UseRGB - if True will try to import the rgbPP attribute.

Views: 4768

Comment

You need to be a member of Grasshopper to add comments!

Comment by Alex Diebalek on May 16, 2011 at 3:20am

Hi Robert!

Thank you for the nice definiton. it helped me a lot. unfortunately i've got some troubles with importing a single particle system (not nparticles!).

Grasshopper tells me this:

'attributes do not match intended order or type, current attributes =
     position velocity
should =
     position velocity rgbPP
change the order to match in your dynExport in Maya'

i'm not working with rgbPP right now because they are no nparticles in my file.

I was looking for the upgraded gh-def. from your blog, which you told the guys in this forum who had the same problem, but i did not find any file.

Please, can you help me?

best,

Alex

Comment by Madu Mohan on November 11, 2010 at 7:27pm
yea no worries whenever you get a chance, its incredible to open up GH across many platforms.
Keep up the good work!
Comment by robert cervellione on November 11, 2010 at 7:21pm
you can also just animate the time slider in grasshopper
Comment by robert cervellione on November 11, 2010 at 7:15pm
yes you can link the maya time slider to the component. it requires a little different expression. i can post an example when i get a chance
Comment by Madu Mohan on November 11, 2010 at 7:12pm
Got it added into the expression editor and it works, Cheers.
So it continually rewrites the pda files as the time slider plays in maya.
I guess my question was if there was a way to visually see frame by frame instead of moving the slider manually in grasshopper. Some way to create a connection realtime to the slider in maya and the frame input in grasshopper...
Many thanks
Comment by robert cervellione on November 11, 2010 at 6:39pm
you do not need to add -mnf 0 -mxf 200

you need to add the code as an EXPRESSION not as a MEL Script. and make sure the expression is set to "evaluate Always". then maya will evaluate the particles at every frame and will update with any changes made, updating grasshopper in turn.
Comment by Madu Mohan on November 11, 2010 at 6:34pm
Hi Robert,
Thank you for the reply.
I’ve downloaded the new version and used the following code from your site:
dynExport -atr position -atr velocity -atr rgbPP -f pda nParticleShape1;

However I found when I executed this code with the particle selected, only one pda file was exported to the directory (the one that the slider was currently on)

So I have modified your code with the following: -mnf 0 -mxf 200

dynExport -mnf 0 -mxf 200 -atr position -atr velocity -atr rgbPP -f pda nParticleShape1;

This exported all the pda’s from 0-200 and I was able to then go into grasshopper and move the frame slider to preview the animation.
Is this correct?
Or is there a way to play the time slider in maya and have that drive grasshopper?

Way cool…
Cheers.
Comment by robert cervellione on November 11, 2010 at 4:19pm
Madu,

the first error is because you did not add a rgbPP attribute to your particle system. a rgbPP is not added to legacy particle systems. i recommend using a nParicle system and use "balls" as the type. this will create a rgbPP attribute on creation

the second error is because you removed the rgbPP attribute from the dynExport in maya and the code checks for that. i have released a new version that you can get on my site that will allow you to choose weather or not you bring in the rgbPP attribute.

hope this helps

-robert
Comment by Madu Mohan on November 11, 2010 at 1:28pm
Hi Robert,
Interesting work.
I have encountered a couple issues, seems similar to some other peoples comments.
If you could clarify when you have a chance I would greatly appreciate it as this seems to have quite a bit of potential.
I’m inclined to think that this is a issue with the dynExport code.
Heres two attempts below:

Failure 1: the dynExport code from your text.
dynExport -atr position -atr velocity -atr rgbPP -f pda particleShape1
Error in the Maya Script editor after executing the dynExport code:
“No export done. Could not find this attribute, please make sure all the objects have it: rgbPP//”

Failure 2: Maya Help mel example, slightly modified with my path.
2= dynExport -mnf 0 -mxf 200 -os 2 -atr position -atr velocity -p "Part_Test" -f pda;
Error in the out panel in GH:
“Attributes do not match intended order or type, current attributes = position velocity should = position velocity rgbPP, change the order to match in your dynExport in Maya

I’ve been banging my head around with this for a bit, would greatly appreciate your help!
Many thanks

Comment by Gerd Fechter on August 17, 2010 at 4:51pm
Does anybody know a similar tool to import particle animations from 3ds Max into grasshopper?????

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service