FX Scripts (FFX, AB, Pflow)

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  03 March 2008
FX Scripts (FFX, AB, Pflow)

Here's the deal - I'm couped up on a Sunday in my hotel room in New York, my office is back in Aus. So I only have some scripts here, and a dozen things to do today. However I had gauged some interest from a few people here on some of the older scripts I have written. So I figure I might as well put some up. Some of these I find really useful and very powerful, however I havent had time just yet to build a UI or check that they're all max 9 compatible etc. And others require a bit of documentartion to get your head around. Others are simple little tricks but I tend to frequently use on a daily basis. So they might save you a few extra clicks. And lastly I have some other really cool scripts, which unfortunately are back at my office, and not here with me - so others I will release later - as I will plan to release all of these cleaned up and documented better, with example scene files or videos wherever needed. So I really am putting these up "as is" and not really in a very supportive form.

Lastly some of these I even cringe as there are some neater ways to write these, however they did the job at the time for whatever I needed them for, so again.. "as is" : ) !!

Most of these are aimed at pflow, afterburn or fume fx. Used in production, some for large teams and at my studio, others just me 5 years ago needing a few quick things. I will release more soon - however I'm in New York right now and I'm flying back to aus to pack my bags as I'm moving permenately to North America this year, so I dont see myself having much time in the coming months..

Hope you find them useful!

Thanks guys!

-Allan McKay


Use this in conjunction with PFFX_ScriptGUI_v01.2.ms - make a script test and put this in there. Then wire it to a new event. What this will do is generate a special box where the particles travel to the new event. This way if you did an effect like an airstrike or something, it will generate a special box where it needs to blow up. Then run the next script (telling it to read your ffx container) and it will place a fume explosion set up for rendering at that position. read on with the next script..

The previous script PFFX_pflow_script_GenOBJ.ms generates a special box which has the frame information etc in it. And then make an explosion or fume fx sim, sim the whole effect. delete the lights and camera, emitters everything out of the scene so you just have $fumefx01. save it out and tell this script to point to that location. Then run this script it will generate as many explosions as your pflow event specifies, so you suddenly have 50 explosions or whatever you need. all set up to go to render. As with the rest, I will give better documentation on this later.

Simple script that will read all the files in a directory and change their spacing. This is a good starting point if you want to batch change files values. I wrote this to quickly change 50 demo files to a much higher resolution I neded. It then wrote them out to a new file name (so it isnt overwriting). You can modify this to do pretty much anything in max, so probably useful even outside of fx.

generates the tightest box possible based on your animation. Then just make it a bit wider and taller to fit the fire in and you save the most room possible for your fume fx sims!

Create a FFX_repository.txt and ren_repository.txt files in your c:\ and put the location of all the files you need sim'd in the FFX_repository.txt folder. example listed below.



All files are broken up with a , and are either / or \\ instead of \. Other than that its an easy way to locally sim all of your stuff. I wrote this a year ago before there was backburner support, however its still useful for doing stuff locally. I still use it a lot.

Useful to track one object to another objets animation. Such as tracking a dummy to another object etc.

Useful for dumping out data information from a fume fx scene. You will need to specify an output directory in the script (I dont believe I've written a gui for this one) but it will output a lot of useful information. Its good if you have 20 scenes ready to sim and you want to double check all of their settings quickly before they sim or you go home for the day. (I basically use it to dump out all my scenes so I can review them on my way home to double check nothing is going to go wrong or I missed anything, but also good for troubleshooting a fluid sim).

Will generate a dummy for each vertex on every frame of the animation. Good to get an idea as to what your objects doing, or gauge how far an object might be moving over time. Useful for things like seeing if objects collide with surfaces, or if you are doing a fluid sim with a complex character moving around, you can select a bunch of vertices to get an idea as to where hes moving etc. and create a container based on the entire animation.

This script will localize your scene so it will save all the point cache data and everything in the scene locally, and reset up the scene to be able to then sim locally. You can modify it but right now it will go to C:\f_local\ and make a folder for each max file, then inside of their have a /pic/ + /fxd/ + /pc2/ dirs and store all the info there. I wrote this one afternoon after a deadline where our network was going down a lot, I could easily save all my stuff locally and then set off sims for the night, knowing the network wasnt going to crap out.

Useful script that will increment your max file up one version, but also update your render output to the new version (as well as make new directory for it too) and if you enable the fume fx checkbox it will also change the fume fx FXD path to a new version as well. I find this useful so I do not need to update 3-5 things each time I decide to go up a version. (I version up a lot so I dont lose old data incase a director or client decides to roll back a version). Might want to modify to match your directory structure, but its pretty easy to use.

Will require some modifying but I wrote this to be able to generate fume fx libraries. I'm able to get maybe 3 situation tests and 5 flametypes and then it will go through and generate 15 max files from that with every single situation test ran by every single flame type. This was needed while we were prototyping various fire sims for a film coming out later this year.. What would take me a day of paintakingly boring work would take 10 seconds, and I could generate 500 max files ready to render if I wanted to. This will probably require some additional documentation to make sense, however right now I'm just putting it up in its raw form, later I will put it up with the correct example scenes.

Pflow scripts:

This script is very useful for getting a particles age to stay the same. Lets say you have a pillar of smoke that grows over 30 frames, but once it reaches 30 frames you want it to last forever, but at that size. Make it go to a new event at age 30 that has this script (plus the delete operator in here too) and it will keep reassigning the old age to the particle, so you do not need to tell your particle to last 5000 frames and have a funky animation or AFC curve for its life. I find this script to be useful a lot when working with afterburn!

Birth script which you can use to create a bunch of particles matching exactly what the objects in your scene are. If there are 50 objects named "Brick_01" etc. it will (assuming you tell it in the globals to look for "brick_*") generate 50 particles and assign the shape etc. to them.

Will tell your objects in the scene to be the same as your particles. Useful to initially grab the positions in a birth script, but then run this to move them around.

Simple but useful scripts

Simple way to clear out memory foot prints to an extent. It does a garbage dump, I personally find running it 3-5 times you get a good result. Its just useful to help from max crashing etc. so I occasionally will click this button to clear out some redudent memory.

Simple script to tell all your objects to be a grey material.

Mattes your scene out, so all models are matte/shadow. I use this all the time to pull in a scene file, matte everything out, and start doing fx passes.

Simple script which will hide all the objects in a scene, change the render path to exactly what it was with "_noholdout_" at the end of the name. And also changes the max file to "_noholdout". So you might have a maxfile called "foo.max" and it renders to "C:/temp/foo_000.tga" it will make a max file called foo_noHoldOut.max and render c:/temp/foo_NoHoldout_000.tga.
This script is useful if you need to make a bunch of passes that you render out, and then render again without any hold out geometry (I do a lot of this when working lets say in max doing lots of fume fx passes, and then all the geometry renders are done in Houdini, and there may be issues compositing the two together etc, or you just want with and without holdout geometry).

Simple script to clear all the materials out of the material editor. I use this all the time to get rid of all the shaders from a scene. Usually when I start an fx scene (esp fume shots) I will load the scene and run MatteMyScene and ResetMaterialEditor and then I will have a fairly clean max file to work with.

Smoothes the selected geometry and flips the normals. A lot of geometry I bring in from houdini requires it, so part of the importing software I wrote does this for me, however if I were to manually import .obj files I would then just click this button to set it right for me.

Simple script to toggle the selected objects from box mode and non box mode.

Simply select all the vertices you want tracked, and then it will track a dummy object to each vertex for the entire animation. Useful for linking emitters to point cached objects etc.

Will randomly assign new wire colors to all selected objects

If your fume fx containers path is busted this will fix it.

Useful if you're running out on a lunch break and want to get something to sim locally, and then render the results as well. It runs the sim, then renders it out once its completed.

Quick script to center objects pivot

Quick script to match the dimensions of one object to another, great for making deflectors match to a ground plane etc.

Another quick script just to load pflow window

Resets the xform of an object
Allan McKay
CG Society Instructor

  03 March 2008
wow thanx....now u open teh doors of the pflow treasureland.
you already missing my blog cgroute.com
  03 March 2008
Thanks for sharing, Allan! There's some good stuff in there.
  03 March 2008
thanks mate, I need to document it better, stuff like the permutations thing is actually pretty damn cool for saving time sometimes, and a lot of the others as well. However I need to probably build a small video or max files to explain it better, otherwise it wont be too useful.

So I will release everything eventually, I have lots more back at the office, as well as mel scripts. I kinda just never got to releasing because I get lazy at that part
Allan McKay
CG Society Instructor

  03 March 2008
Couped up in a NY hotel room, the city that never sleeps? I know you better than that Allan, haha

Anyway, there's a lot of hours of scripting by the looks of it! It's the little things like "PFlow_StoreAge" that are particularly handy for my kind of work, or hobby for that is.

Again, thanks a bunch for sharing Allan
Two million years of human evolution and this is what we get...
  03 March 2008
haha its true
I took all the guys out Friday night for a big one and Saturday too, so I'm hungover and chillin today

storeage is pretty pimp, I use it all the time
Allan McKay
CG Society Instructor

  03 March 2008
Nice one, thanks for sharing.
  03 March 2008
Brilliant stuff Allan. Shame to hear you're leaving our shores, as we need all the awesome talent we can get!

See you around the maxpro lists.
"There Really is No Secret"
Martin Brennand - mocha Product Manager - Imagineer Systems
  03 March 2008
yeah well I lived in LA for 2 years and came all the way back, and the last few years I've been working top side but living in Aus, so I'd say I'll be back pretty often. It's Australia after all!

By the way, released a bunch of tutorials today too - they're mainly introductory tutorials to get people running with maxscript and fume etc.
Allan McKay
CG Society Instructor

  03 March 2008
server exceeded bandwith limit :(
  03 March 2008
Haha yeah, it happens a lot lately. Too bad hosting can be such a bitch when it comes to bandwidth
Two million years of human evolution and this is what we get...

Last edited by Neejoh : 03 March 2008 at 09:57 AM.
  03 March 2008
ah crap guess it got more hits than I expected!
I'm mirroring to my company website (catastrophicfx.com) so it should be up in an hour or so
I'll repost the links then!
Allan McKay
CG Society Instructor

  03 March 2008
Great scripts Thanks for taking the time to share them.
poof ~>Vimeo<~
  03 March 2008
haha cool

ok so I put up a bunch of tutorials today (http://forums.cgsociety.org/showthr...492#post4988492)
and it killed the bandwidth to my site
so here are the scripts on my other site too.

hope the tutorials dont kill this site too!

Allan McKay
CG Society Instructor

  03 March 2008

really helpfull
FX TD - Sony Pictures Imageworks
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 01:55 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.