PDA

View Full Version : FX Scripts (FFX, AB, Pflow)


amckay
03-02-2008, 06:57 PM
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
http://www.allanmckay.com
amckay@allanmckay.com

http://www.allanmckay.com/scripts/amckay_scripts_01.rar




PFFX_pflow_script_GenOBJ.ms
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..

PFFX_ScriptGUI_v01.2.ms
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.

ReadFiles_ChangeThem.ms
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.

create_animVolume_v06.ms
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!


DB_FFX_Batcher_v05.ms
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.

ffx_repository.txt
C:/temp/simMyfile.max,C:/temp/2ndFile.max,C:/blah.max

ren_repository.txt
C:/temp/RenderThisfile.max,C:/scenes/render2.max

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.


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

CFX_FFX-QuickDataOutput_v01.ms
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).

CFX_GenVertAnim.ms
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.

CFX_Local_v02.0.ms
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.

CFX_VersionUp_v01.01.ms
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.

DB_FlamePermutationsGen_v03.20
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:

amckay_StoreAge_PFLOW.ms
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!

BS_GetMesh.ms
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.

PFS_BakePFAnimScript.ms
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

GC.ms
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.


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

CFX_MatteMyScene_v02.ms
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.


CFX_NoHoldoutGenerator.ms
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).

CFX_ResetMaterialEditor.ms
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.

CFX_SmoothAndFlip.ms
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.

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


CFX_DummyStick_v01.0.ms
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.


CFX_Wirecolour.ms
Will randomly assign new wire colors to all selected objects

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

quick_simRender.ms
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.

amckay_centerpivot.ms
Quick script to center objects pivot

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

amckay_pflow_loader.ms
Another quick script just to load pflow window

amckay_resetxform.ms
Resets the xform of an object

ahmedsheeraz
03-02-2008, 07:31 PM
wow thanx....now u open teh doors of the pflow treasureland.

SoLiTuDe
03-02-2008, 08:19 PM
Thanks for sharing, Allan! There's some good stuff in there. :thumbsup:

amckay
03-02-2008, 08:26 PM
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 :)

Neejoh
03-02-2008, 08:51 PM
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 http://forums.cgsociety.org/images/icons/icon13.gif

amckay
03-02-2008, 09:05 PM
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

scrimski
03-02-2008, 09:26 PM
Nice one, thanks for sharing.

erilaz
03-02-2008, 09:37 PM
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. :D

amckay
03-03-2008, 02:38 AM
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.
http://forums.cgsociety.org/showthread.php?p=4987059#post4987059

PsychoSilence
03-03-2008, 08:20 AM
server exceeded bandwith limit :(

Neejoh
03-03-2008, 08:53 AM
Haha yeah, it happens a lot lately. Too bad hosting can be such a bitch when it comes to bandwidth

amckay
03-03-2008, 02:34 PM
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!

JohnnyRandom
03-03-2008, 03:33 PM
Great scripts:) Thanks for taking the time to share them.

amckay
03-03-2008, 05:42 PM
haha cool

ok so I put up a bunch of tutorials today (http://forums.cgsociety.org/showthread.php?p=4988492#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!


http://www.catastrophicfx.com/tut/amckay_scripts_01.rar

holycause
03-06-2008, 09:34 PM
thx :thumbsup:

really helpfull

eractou
03-17-2008, 06:07 AM
Omg awesome share Allan.Thanks a million. :love:

assem
03-24-2008, 06:38 PM
thank you very much for this >>:thumbsup:

assem
03-24-2008, 06:39 PM
thank you very much for this >>:thumbsup:

DSVega93
04-07-2008, 04:33 PM
Sweet, Ill have to scan over these to try and figure them out.

The one thing I cant seem to wrap my head around is just how to go about writing the scripts themselves. We did learn MaxScript from Paul Neale this year, but its somewhat tricky trying to figure out the workflow of PFlow (no pun intended =P).

Just as an example: Im sitting here in the lab trying to tell my emitted particles that once they collide with a simple sphere to lock on and drip down the surface of the object until it reaches the bottom and continue to descend. Im sure theres a way to do it with just using operators, but If I can learn to script this simple effect I can start unlocking more doors to more elaborate effects.

I dont mean to impose, but could you shed some light on basic PFlow Scripting?

charleyc
04-07-2008, 08:14 PM
...Just as an example: Im sitting here in the lab trying to tell my emitted particles that once they collide with a simple sphere to lock on and drip down the surface of the object until it reaches the bottom and continue to descend. Im sure theres a way to do it with just using operators, but If I can learn to script this simple effect I can start unlocking more doors to more elaborate effects.

I dont mean to impose, but could you shed some light on basic PFlow Scripting?

Actually, while this could be scripted, it would not be too much fun, and for larger meshes, it could get really slow. PFTools Box#1 (www.orbaz.com (http://www.orbaz.com)) has an operator (Lock/Bond) that is designed for just such an effect. It is a very good thing to learn scripting with PFlow, if you deal a lot with PFlow and want to push beyond the basics, I would highly recommend getting the PFTool Boxes. Box#1 has some very useful additions to PFlow (such as Lock/Bond) and really completes the power of PFlow. And Box#3 adds, among other things, the ability to create custom Operators that execute faster than a Script Operator.

DSVega93
04-08-2008, 10:25 PM
Hmm, that just might work too. Still, are there any resources out there that explain how particle scripting works or would I be best scouring the MaxHelpfiles?

charleyc
04-08-2008, 10:30 PM
The best places to learn are www.orbaz.com/forum (http://www.orbaz.com/forum) and http://www.scriptspot.com/bobo/

amckay
04-15-2008, 12:15 AM
put up two new minor vids

Just a very quick look at AB4's new features.
www.allanmckay.com/tut/AB4_Intro.avi

New maxscript tut which is basically covering how to read values in a max file and write them out to a text file, as well as read in files from a specific directory etc. Just a bit more left field examples of maxscript rather than reading object properties etc.
www.allanmckay.com/tut/maxscript_03.avi

holycause
04-18-2008, 06:22 PM
hi Allan,
how are u dude?

did you put your tutorials on catastrophicfx as well?


Concurrent download limit exceeded.

Glacierise
04-19-2008, 08:06 PM
Cool vids, Allan! Thanks! Btw, I am making my first FumeFX/Afterburn reel next week, I have a shot at a job in a movie FX studio. Cross fingers for me ;)

Bandu
04-20-2008, 12:14 PM
Cool Allan,

but,
"Concurrent download limit exceeded."

any other link?



cheers,
Bandu

amckay
04-23-2008, 01:48 AM
I'm going to have to get a new server soon!
but if the page doesnt load try again in a few mins just means too many people are downloading at once

hey ruben!

supremepizza
05-02-2008, 09:17 PM
...........

CGTalk Moderation
05-02-2008, 09:17 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.