<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
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.
irene schweizer
this particle importer sounds really great and i tried to install it but, dont know, its not working. i downloaded the .ghx and .mel file and put the .mel file in the scripts file from maya. than i wrote mp2csv("someName") in the command line and maya shows a file with the right frame. but when i typed the file adress in the grasshopper expression nothing happened.
so maybe you can explain step by step whats to do!?
thank you!
May 16, 2010
robert cervellione
you do not need the mell script, that is something different. you only need the grasshopper def. in the grasshopper def is a text panel with instruction on how to use the file. i have also added the same text here.
May 16, 2010
Tommaso Casucci
good work!!
Does it work in Maya 2011?
May 21, 2010
robert cervellione
yes it works in 2011. and on legacy particles or nParticles.
May 21, 2010
Michele
I saw your videos, you did something amazing.
I can't use it, I copied the destination and the name of the file in the right places but it doesn't work. I uploaded a screenshot: The output says that is not possible to find the file. Could you please help me?
May 28, 2010
robert cervellione
look at the error, does the file "particlesparticleShape1.1.175.pda" actualy exist!!
first problem is you need to add a "\" at the end of the ploc
second you particle name is probably "particleShape1" drop the ".1" at the end
May 28, 2010
Michele
about the ".1" that's the name of the file as it come out from the dynExport. I even tried to change it but it doesn't work
May 28, 2010
robert cervellione
May 28, 2010
Michele
second point is that (I am sorry I am not so familiar with maya) in this page, when you write about the dynExport, there's this attibute "-atr rgbPP" wich is missing in the instruction you give at your "www.cerver.org" page.
I tried both of them.
With the one from "www.cerver.org" I get the problems I wrote before.
With the one from this page maya tell me:
"Error: No export done. Could not find this attribute, please make sure all the objects have it: rgbPP"
Maybe what I am doing with maya is wrong. In this case I will ask a friend of mine to help me with the dynExport and I wont disturb you anymore.
Anyway I would like to thank you for helping me.
May 28, 2010
robert cervellione
i have updated my site to include a projects page for this plugin it is under Projects tab. here is a direct link
http://www.cerver.org/?page_id=363
i have also updated the definition to include a maya file which should help, so re-download it form the download section. (i hope)
May 28, 2010
Robert Beach
May 28, 2010
Gerd Fechter
Aug 17, 2010
Madu Mohan
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
Nov 11, 2010
robert cervellione
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
Nov 11, 2010
Madu Mohan
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.
Nov 11, 2010
robert cervellione
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.
Nov 11, 2010
Madu Mohan
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
Nov 11, 2010
robert cervellione
Nov 11, 2010
robert cervellione
Nov 11, 2010
Madu Mohan
Keep up the good work!
Nov 11, 2010
Alex Diebalek
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
May 16, 2011
Avishek Das
Jun 16, 2011
robert cervellione
take a look above at the how to use, you can omit rgbPP and it will work fine.
dynExport -atr position -atr velocity -atr rgbPP -f pda NameOfParticle
or
dynExport -atr position -atr velocity -f pda NameOfParticle
Jun 16, 2011
robert cervellione
Alex,
the update is on my site www.cerver.org. and if you using legacy particles then omit the rgbpp part of the expression
Jun 16, 2011
robert cervellione
Jun 16, 2011
Avishek Das
Robert, I have figured out a way..
We can use still use legacy particle system with rgbPP atr
1.make a particle grid
2.set render apperance as sphere
3.now go to ''add dynamic attributes'' and select ''color''
4.now select all the particles and select'' add per particle'' from the dialogue box just appeared
now u can use ''dynExport -atr position -atr velocity -atr rgbPP -f pda NameOfParticle'' command without any error and robert's code does accept it without any error..
if u have any problem mail me @ colors1990@gmail.com
Jun 16, 2011
Avishek Das
actually add both...add per particle and add per object
Jun 16, 2011
robert cervellione
Jun 16, 2011