Announcement

Collapse
No announcement yet.

write particle id via mascript?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • write particle id via mascript?

    It's funny I just posted a high-five that the older advection/conservation is still included in PFD and now I hit a snag ;]

    I'm running a Multi-pass liquid sim with a v2.2 sim box and under output, there's no option to save 'particle id' or 'particle velocity'. The sim RnD is complete and was designed to be run at half-speed for rendering. I went to do a playback at 0.5 speed, and for every in-between frame, PFD threw an error stating the particle id isn't found. Reading the box contents, it's only finding size and position for the particles. Is there a way I can write the particle id via maxscript at sim time (i guess velocity also)? Need to do this as a Multi-pass sim using an older sim box - can't get this look with Flip solver. Running version 3.11.

    Thanks in advance!

  • #2
    Hey, what kind of particles are these? I think you should be able to get their channels exported via maxscript indeed, by using the $.prt_expmask option of the simulator.

    It should look like something along these lines:
    "Liquid 80000402 Splashes 80000406 Mist 80000404 Foam 80000406 WetMap 80000404"

    Each of these numbers is a Hexadecimal number, and each bit in these numbers denotes which particle channels are exported:
    Bit 0 is always 0
    Bit 1 is the velocity
    Bit 2 is the size
    Bit 3 is Age
    Bit 10 is ID

    You can get the number you need using Windows' calculator. For example, here's what the number 80000406 from the string above would mean:
    Click image for larger version  Name:	Screenshot_3.png Views:	1 Size:	131.7 KB ID:	1028366


    You can switch bits on and off for the channels you need.

    Hope this helps!
    Svetlin Nikolov, Ex Phoenix team lead

    Comment


    • #3
      I think my head just spun, hah ;D Ok, so I'm fairly light on maxscript. It's the foam and splashes. Firstly, thank you! Much appreciated that technical breakdown. So now, for me to actually implement... would it be easier for me to sim in a v3 box and set conservation/advection via maxcript back to the older direct-symmetric and multipass? Then I might get my particle id's via the interface. Or should I go with the above method... and then the big question.. what do I type and where? hah. sorry. I'm staring at the sample commented code in the script simulation window.

      ..and I now see the title is missing an 'X'. yesh.
      Last edited by ttdww; 03-03-2019, 02:18 AM.

      Comment


      • #4
        Indeed, that sounds like the easiest way Just enable the systems and channels you need in v3, copy the string and plug it into the same parameter in v2
        Svetlin Nikolov, Ex Phoenix team lead

        Comment


        • #5
          Great! ;] So to change conservation/advection to older method, I'd just enter lines as... ?

          fn OnSimulationStep=(

          $.refltype=whatever will sim as direct-symmetric
          $.advtype=whatever will sim as multipass

          )

          Or maybe there's more to it?? Or less to it? ;]

          Thanks again Svetlin!

          Comment


          • #6
            Maybe..
            $.refltype=0
            $.advtype=3

            Comment


            • #7
              Sounds like this should do it..
              Svetlin Nikolov, Ex Phoenix team lead

              Comment


              • #8
                It's working! Eureka. Thanks a ton!

                I moved them over to only set once when the sim starts - I guess doesn't need it set every frame.

                Comment


                • #9
                  ..aand the sim still looks like Flip. I've polled the v3 box and it's definitely set to 0 and 3 to match with the 2 types. Are there any other params that come to mind that were hard coded for v3? I guess I can set those via script also.

                  Comment


                  • #10
                    Here's a screen cap showing RnD for trying to get the little surface waves but at the largest spacing possible. So this is same voxel size, v2 on left, v3 on right.

                    Comment


                    • #11
                      Hmm, the most certain way to know if you are running a grid or a FLIP simulation would be to send over the Phoenix log file. However, whether the FLIP or grid liquid solver is created should depend solely on the advtype parameter.

                      I might be missing something though - can you explain in more detail what you want to do and why?
                      Svetlin Nikolov, Ex Phoenix team lead

                      Comment


                      • #12
                        Copy that regarding the advtype param - will keep that in mind. Thanks!

                        I just scanned the log for that string and it's set to 4 :/ Seems it's not picking up the script setting.

                        Sure thing - I'm basically trying to achieve those little chaotic waves on the surface of my larger storm swells. The sample shows smaller tests I'm running of just the smaller waveforce active (larger swells turned off). I tried for days to get the little waves working in v3 like I had a couple years back in v2 and couldn't replicate the look, so I loaded in one of my older v2 boxes and voila, there were those little details again. Based on the # of grids and frames I need for the camera angle, I need to stay around the grid spacing I'm at now - about 125mill. With v2 multi-pass, I can get those details, but with flip it's unknown how small the spacing would need to be. The 2nd part of it is that I have the whole thing RnD'd already at 30fps and then need to render it for 60fps (it's for two 8k playback screens that are to emulate live action). So I need to tween the sim frames that I'm currently running that move good at 30fps, so need that particle ID which I was going to get from the v3 sim box. But it seems it's stuck at flip even with advtype scripted to be type 3 for multipass. Hopefully all that made sense.

                        On another note, if the ocean tex shader idea works out, then maybe I can forego doing all this and just try for adding the little waves with the ocean text as a bump for reflection warping.

                        Comment


                        • #13
                          Trying all sorts of ideas. Is anything added to the script like an override for params set in the interface? Or do I need to be simming solely from maxscript to change parameters via script. I've still been simming using the menu rollups. The log file still shows flip solver.

                          Comment


                          • #14
                            Maybe you could take a look at my scene, script, and log? It's definitely not picking up the script setting to force it to multipass. Probably user error. Keeps reverting to flip solver when simming. Let me know if that means email (and which) or post a link. Thanks!

                            Comment


                            • #15
                              Indeed, you are correct, there are more fail-safes added to prevent switching to the old solver. An alternative that would work would be to save a simulator from v2 and use it - it is a 3rd type of simulator, as opposed to the fire/smoke sim and the liquid sim in v3, and won't undergo automatic conversion. This 3rd type of simulator is no longer available for creation in Max, but can still be loaded from scenes created using v2. I'm sorry to have mislead you!
                              Svetlin Nikolov, Ex Phoenix team lead

                              Comment

                              Working...
                              X