Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

can I get transform of every particle in particle system? like "super spray"

can I get transform of every particle in particle system? like "super spray"

Anonymous
Not applicable
1,188 Views
6 Replies
Message 1 of 7

can I get transform of every particle in particle system? like "super spray"

Anonymous
Not applicable

Hi, everyone:

In maxscript, 

there is "particleCount" and "particlePos" I can use to get position of each particle,

but I want to get more: scale, rotation...or the transform matrix is the best.

Is there a way?

0 Likes
Accepted solutions (1)
1,189 Views
6 Replies
Replies (6)
Message 2 of 7

irishman_team_kilber
Mentor
Mentor
Accepted solution

The renderer has no concept of particle count ( except for dedicated particle renderers like Frantic Films' Krakatoa which deals only with particles and ignores the meshes). All particle systems replace the particles with meshes before sending data to the renderer. Thus, if you want the number of particles on a frame, you would have to iterate through all particle systems and collect their numbers. Also note that the render count and the viewport count in PFlow systems can be different, so it might be a good idea to take that into account, too.

 

I think the only to change the scale, rotation...or the transform is to use the PF Source instead of using superspray use the PFSource 

0 Likes
Message 3 of 7

Anonymous
Not applicable

Thanks for the reply. 

I've been searching in apis for days...Man Sad

0 Likes
Message 4 of 7

Alfred.DeFlaminis
Alumni
Alumni

Hello @Anonymous and welcome to the community,

 

I don't think superspray and the like have particle counts and super customizable orientation, but I may be incorrect about that.  I found nothing in my searches about it.  (SuperSpray does have some rudimentary orientation/rotation controls.)  However Particle Flow does have all the things you are looking for.  

 

You can display the particle numbers on screen by following the image below and checking the box in the display node of each event.  

 

particle ids.png

 

Last but not least, the PFlow does send the renderer mesh data in a number of ways, so the renderer can be aware of the number of particles.  See the image below for details.  Please let me know if you have any questions.

 

meshparticle.png

 

They are a bit beyond my skill level, but the Display Data operator and Display Script operator might be able to solve your position and rotation display issues.  You may have to post on the programming subforum for the best help there, I'm a lousy programmer.  

 

@irishman_team_kilber The reason the Pflow particle count and render count are different is because by default Pflow is set to only display 50% of particles in the viewport.  If you select a PFlow and go to the modifier menu, you can see the viewport display is at 50%, just change that to 100% to get a 1 to 1 representation.  

 

Please hit the "Accept as Solution" button if my post solves your issue or answers your question. This lets me know that I was effective in helping you, and thank you for doing so.

 

Best Regards,

 

 

0 Likes
Message 5 of 7

Alfred.DeFlaminis
Alumni
Alumni

Hello @Anonymous,

 

I just wanted to follow up here, any progress on this issue?  Any questions or anything?  

Best Regards,

0 Likes
Message 6 of 7

Anonymous
Not applicable

Sorry, I haven't been checking my Email for days.

Thank you for still helping me about this, and please ignore my poor English.

From the beginning, what I'm doing was a kind of research, to find a solution to turn SuperSpray into a keyframed Mesh.

Because artists use SuperSpray more than PF Source.

After some searching in MaxScript API, I decided to create a Mesher bound to that SuperSpray, and get a snapshot from the Mesher every frame.

Than detach those all faces from the meshes. Than I have tons of particle mesh faces, and vertices.

So problem turned into "How to calculate the transform matrix by vertex positions from frame N and frame N + 1".

I tried to do that, but my Math is too ......bad...

Than some days later, this progress was paused.

I may try to solve this again after I read some Math books...or wait for good news from cool guys in here.

 

Haha...wishes.

Thank you.

0 Likes
Message 7 of 7

Alfred.DeFlaminis
Alumni
Alumni

Hello @Anonymous,

 

Thanks for the reply!  I think my post wasn't very helpful then based on this information, so I apologize for the confusion there.  If you are tied to Superspray and need an animated mesh you might try this:

 

1) Make superspry

2) Use Mesher on Superspray

3) Use Blobmesh on Mesher

4) Export Alembic

5) Import Alembic 

 

This should give you an animated mesh, but it's not keyframed.  It doesn't give you N+1 or pos/rot/scale information though.  Smiley Frustrated

 

Does that help at all?

 

Best Regards,

0 Likes