numParticles() returns inaccurate result - Printable Version +- tyFlow Forum (https://forum.tyflow.com) +-- Forum: tyFlow Discussion (https://forum.tyflow.com/forum-1.html) +--- Forum: Bugs and Issues (https://forum.tyflow.com/forum-3.html) +--- Thread: numParticles() returns inaccurate result (/thread-4251.html) |
numParticles() returns inaccurate result - Alan2024 - 05-10-2024 Hello, I'm new to tyflow. I've read the docs (https://docs.tyflow.com/tyflow_maxscript/) and trying to use maxscript to get particle data. But when I call $.numParticles(), it won't return a valid result even when I enabled interface. Please help me, thank you! My scene setup is in the image. RE: numParticles() returns inaccurate result - tyFlow - 05-10-2024 Did you call updateParticles first? RE: numParticles() returns inaccurate result - Alan2024 - 05-10-2024 (05-10-2024, 02:38 AM)tyFlow Wrote: Did you call updateParticles first? Yes, I did call updateParticles first. As in the post image, the first line is $.updateParticles 15. I also tried to write those code into a ms script. The result is also the same. By the way, I can get Id from getAllParticleIDs(), when I have 169 particles, the array is properly filled with (1, 2, 3, ..., 169). But getParticleAge always returns 0, getParticlePosition returns (0, 0, 0) no matter what frame number I gave to updateParticles() function. I attached my max scene and script run result. UE4_Max_VAT_Test011.max (Size: 912 KB / Downloads: 108) here's my test code: Code: macroScript TestTools_TyflowTest category:"Test Tools" buttontext:"Test Tools" tooltip:"Test Tools" the result is RE: numParticles() returns inaccurate result - tyFlow - 05-13-2024 I opened your file, ran the script, and received the correct result. Is there anything else I need to do to reproduce the issue you're seeing? What version of Max are you using? Attached is the result I see when running your script. RE: numParticles() returns inaccurate result - Alan2024 - 05-14-2024 (05-13-2024, 06:27 PM)tyFlow Wrote: I opened your file, ran the script, and received the correct result. Is there anything else I need to do to reproduce the issue you're seeing? What version of Max are you using? Thank you for your reply! I was using Max 2021, maybe this is version specific issue? I'll try another max version. RE: numParticles() returns inaccurate result - tyFlow - 05-14-2024 Thanks, I can reproduce the issue in Max 2021 and will look further into what's causing it. Edit: so I stepped through my code in Max 2021 and it's returning all the expected/proper values, but for whatever reason they're not being received by MAXScript properly...not idea why, to be honest. I would recommend trying the setup in a newer version of Max for now. RE: numParticles() returns inaccurate result - Alan2024 - 05-15-2024 (05-14-2024, 01:14 PM)tyFlow Wrote: Thanks, I can reproduce the issue in Max 2021 and will look further into what's causing it. Thank you for confirming the issue! I will use a newer version Edit: 2024 works fine, thank you! |