Useful Scripts

From VFXpedia

Jump to: navigation, search

The following scripts may be useful.

Contents

Comp Scripts

Create Local Proxies
This script will generate a local proxie version of every/selected loader
to do so it generates a savernode and starts rendering it. so it will take some time to finish
did a little update: if proxy scale is set to 1 it will do now a copy instead of a new render
Goes into Scripts\Comp
--Michael_v
PlaneGenerator
This script will generate a series of 3D planes slicing an image into rectangles, or arbitrary shapes from a greyscale image. From the right angle, it still looks like a solid image. Fly the camera around for some interesting transitions.
This is a modified version of an original script by HuLaN, posted on VFXTalk.
Goes into Scripts\Comp
-=Batch Changer=-
Change parameters in all selected tools at once, with SlayerK's Batch Changer script. Supports multiple choices for "FuID" inputs, and even simple expressions like +1, -2, *3, /4 for "Number" and "Point" inputs.
Goes into Scripts\Comp
SE_ReRenderMissingFrames
This script is a modification of the 'check for missing frames'-script and works like this:
Within the current render-range it checks for missing frames of the selected saver.
If there are any missing frames, it sets up the renderrange and re-renders those frames.
Goes into Scripts\Comp
SE_LoaderTweaker
LoaderTweaker allows for easy modification of the most-frequently used Loader-options.
(Derived from the ChangeLoaderMissingFrame-script)
Goes into Scripts\Comp
Last revisited: January 9, 2008. Added Hold First/Last options.
SE_DeleteOrphanedLoaders
Loaders that are not connected to any tool will be deleted.
Goes into Scripts\Comp
SE_PriorityPassthrough
PriorityPassthrough (de)activates user-definable sets of tools.
The user has to put PL1, PL2, PL3 or PL4 into the comment-tab of the tool to assign the tool to a 'priority group'.
Goes into Scripts\Comp
Updated 15/05/07 as there was a little prob with animated tools.
SE_PrioritySetLevel
To easily set the PriorityLevel in selected tools.
Goes into Scripts\Comp
Renamer_glt
This script renames the selected tools (or all if nothing is selected). Similar to the renamer of Total Commander: inserting/replacing strings, inserting counter, or tool type abbreviation. See more description : : and use in the script. Current version: 1.02
Written by Gabor L. Toth. Last revised Saturday, March 31st, 2007
Bf_rename3
This script can be used to replace the default tool rename dialog. It uses the short name of the tool as prefix.
This script comes in two versions. Version 1 uses the default AskUser dialog which is not handy cause it does not highlight the textdialog and does not react to enter or escape. Version 2 uses iup as interfaces : : and does not have this problems.
To run this script ensure that the script is saved in the Fusion/Scripts/Comp directory. Select the tool you want to rename. Run the script.
You may use the hotkey manager at File-Scripts-Hotkey Manager to apply a shortcut e.g. CRTL-F2 to this script.
Updated: CRTL-A for using the current name for all tools in selection & more (see header).
Written by Blazej Floch. Last revised ,October 26th, 2009
bf_count_nodes
This script counts all (visible) nodes. It excludes invisible inputs for fusion 5.1 and 5.2.
compare to this
Written by written by Blazej Floch. Last revised Monday, September 24th, 2007
Rocket_Science_Saver_Clip_Rename
This custom script was written to rename the output files generated by the comp’s savers. The output clips are renamed based on the title of the comp. The file extension is created from a hard coded list of file : extensions and determined based on the TOOLST_Clip_FormatName attribute of the saver.
To run this script ensure that the script is saved in the Fusion/Scripts/Comp directory. Select the savers to be affected by the script and run the script from the Scripts menu of Fusion.
written by Brian Sinasac for Rocket Science. Last revised Wednesday, January 16th, 2007


Filmkameratene_Change_Path_OpenEXR
This custom script was written to maintain the custom data (channels) created for an OpenEXR format clip loaded into a Fusion loader.
Existing scripts that allow the user to re-path loader files destroyed existing clip information (in the creation of a new clip).
This script first collects the custom data, creates a new clip and repopulates the custom data.
To run this script ensure that the script is saved in the Fusion/Scripts/Comp directory. Select the Loader to be affected by the script and run the script from the Scripts menu of Fusion.
Written by Brian Sinasac for Filmkamertene. Last revised Wednesday, January 16th, 2007


DAMNCircles
This custom script was written to create circular paint strokes at a location, frame number and with a radius defined by a text file.
The script generates an image that is used to simulate particles colliding with a plane.
The initial version of this script expects that the user has manually added the paint tool and selected it.
To run this script ensure that the script is saved in the Fusion/Scripts/Comp directory. Select the paint tool to be affected by the script and run the script from the Scripts menu of Fusion.
Sample data (CollisionShort.dat) has been included for download so the script can be tested.
Written by Brian Sinasac for damnFX. Last revised Wednesday, January 16th, 2007


Category Color Changer - (Source):
The Category Color Changer uses a hard-coded table of RGB color values to color-code every tool in a composite based on its category.
This allows you to apply a standard color scheme to both newly created comps and older comps that had little or no color-coding.
Initially written by Casey Visco. Last revised Wednesday, December 20th, 2006


Convert_Footage.eyeonscript
This script was made to automate creating of reference clips from firewire drives with film footage.
It can be used to search folders recursive for footage in any file format that Fusion can load and convert it to any other file format fusion can write to. Creates comps for sequences and can submit them for render.


Missing frames
Checks all loaders for missing frames.


Flame Tracker to DFMO
This script converts 2D tracks exported from FFI stabilizer as .ascii file.
Writes .dfmo to the same direcrory, make sure it is writable. Can do all .ascii in directory with process all files option. Needs horizontal resolution of tracked image in pixels.


Save New Version and Update Savers
This is a modification of the 'Save New Version' script in Fusion 5 that also updates clip names in savers.
Use it if you intend to keep different version renders for comparison or other purposes. It will only update savers matching the composition name, so you have to explicitly enable 'versioning' of your savers.


VPE-Import
Import .VPE file from Photoshop CS3 with corresponding .3ds and image
it creates a Projector3D, a FBXMesh3D and a loader (for the projected image, position the Projector and link it with the loader
you must export in PS CS3 the vanishing points to 3DS and to .VPE, than use my script with both
not very tested and maybe not a good example of code
Goes into Scripts\Comp

Media:example_data.rar


SM_Save_One_Comp_Per_Frame_0.1
Based on the Save New Version script, this script allows you to set a range of frames and automatically export a sequence of Comps, one for every single frame of that range.
The reason why this script can be useful is that with rendering of comps (the ones that are very heavy on memory use particularly), Fusion sometimes renders a LOT faster if it purges its memory after each single frame.
For the moment there is no option to do this automatically*, but this workaround has the same result.
When using, make sure to save the comp FIRST using the necessary suffix and padding, for example FileName_frame_0000.comp!
  • *Update: there is! Thanks to Sean Konrad, here's a very elegant solution to this problem, using an event script:

Make a comp script called "Set Purge Cache on Render End.eyeonscript" with the following contents:

globals.ev = AddEventSuite("Composition")
 
function ev:OnEndRender(event)
        fusion.CacheManager:Purge()
end

or you could add it to the OnFrameRendered event if you're not doing it one frame at a time:

function ev:OnFrameRendered(event)
        fusion.CacheManager:Purge()
end

Simply run this script and then render the comp. It will purge the cache as it goes along! --Pieter Van Houte 05:13, 16 April 2008 (Central Daylight Time)


Fusion Camera to Maya v0.3
just for the fun of it it tried to create a export script for fusion cameras to a maya ascii file.
most parts of it are just a copy of a maya ascii file i had as reference but for the small tests i did it worked.
what we have so far:
export of translation and rotation for a selected cam
if the camera uses a target then this will also exported
export of animated focal length
a scale factor
Goes into Scripts\Comp
--Michael_v
updated by --Ata


Saver Ranges
this script animates the range in which the saver is active
it builds a list of all savers in the comp and let the user deside which should be active and in which range
by default all savers are active (besides if the are in passthrough or not) and the renderange is the comp renderrange
Goes into Scripts\Comp
--Michael_v


Tool hotkeys

i created a set of hotkeyscripts and a hotkey setting for adding tools to the flow.

if a tool is selected the new one will be inserted rigth next to it and remains all connections of the tool. it will be even inserted between. so main output of selected tool become main input of the new one and main output of the new one become input for downstream tools.

the polymask was altered by Stefan Ihringer, so that it will connect to the mask input of tools.

so, the hotkey settings look like this:

Flow = {
-- My own HotKeys
--***************************************************
M = "@Scripts:/HotkeyScripts/Merge.eyeonscript",
C = "@Scripts:/HotkeyScripts/BrightnessContrast.eyeonscript",
ALT_B = "@Scripts:/HotkeyScripts/Blur.eyeonscript",
R = "@Scripts:/HotkeyScripts/Loader.eyeonscript",
W = "@Scripts:/HotkeyScripts/Saver.eyeonscript",
B = "@Scripts:/HotkeyScripts/ChannelBoolean.eyeonscript",
ALT_C = "@Scripts:/HotkeyScripts/ColorCorrector.eyeonscript",
SHIFT_C = "@Scripts:/HotkeyScripts/ColorCurves.eyeonscript",
L = "@Scripts:/HotkeyScripts/CineonLog.eyeonscript",
A = "@Scripts:/HotkeyScripts/MatteControl.eyeonscript",
ALT_T = "@Scripts:/HotkeyScripts/Tracker.eyeonscript",
U = "@Scripts:/HotkeyScripts/UltraKeyer.eyeonscript",
K = "@Scripts:/HotkeyScripts/LumaKeyer.eyeonscript",
ALT_R = "@Scripts:/HotkeyScripts/PolylineMask.eyeonscript",
T = "@Scripts:/HotkeyScripts/Transform.eyeonscript",
S = "@Scripts:/HotkeyScripts/BetterResize.eyeonscript",
--ALT_U = "@Scripts:/HotkeyScripts/Underlay.eyeonscript",
X = "@Scripts:/HotkeyScripts/Background.eyeonscript",
ALT_P = "@Scripts:/HotkeyScripts/Photron.Primatte4.eyeonscript",
ALT_D = "@Scripts:/HotkeyScripts/ChangeDepth.eyeonscript",
ALT_G = "@Scripts:/HotkeyScripts/GamutConvert.eyeonscript",
P = "@Scripts:/HotkeyScripts/Paint.eyeonscript",
G = "@Scripts:/HotkeyScripts/ColorGain.eyeonscript",
--****************************************************
},

(maybe you must rename it from .rar to .zip to extract the archive)

--Michael_v


Tool Color Labels
Colorize all selected nodes using a palette of pre-defined colors. It's useful to map this script to a hotkey (for example ALT-C) for quick access. The 4 smaller swatches at the bottom only work on underlay nodes so you don't colorize all other selected nodes by accident.


Dump All Inputs
This comp script will generate a list of all possible node input and output values. You can use this output (id, name and current value) for further script, expression and macro development. --Fry 04:21, 9 April 2010 (EDT)


Track One Frame
This comp script allows you to track only one frame forward or reverse. --Fry 04:38, 9 April 2010 (EDT)

Event Scripts

Orphan Saver Check - (Source)
The Orphan Saver Check script is a Script Library that hooks the OnStartRender event and executes before the render dialog is displayed.
It examines each saver in the composition and displays a warning if the saver's image input is not connected to any other tools.
Save this script in the Fusion:\Scripts folder. It will be executed each time a new composition is created or an existing composition is loaded.
Initially written by Isaac Guenard, eyeon Software. Last revised Friday, July 21st, 2006
Note: Using this script or perhaps any scriptlib event script, will cause Deadline v2.6 to fail to load Fusion. --Drswoboda


Tool Scripts

Edit Multistrokes:
Now you can paint with the speed of multistrokes, and still be able to edit and animate them like single-strokes. These two scripts can convert a multistroke into a series of single-strokes, and vice-versa, with full undo. This allows you to easily edit, reposition, rearrange, retime or remove individual strokes, and to group, combine or re-combine single strokes for added render speed & stability. Essential tools for serious Fusion painters.
For Fusion 5.21 or later. Place the script into Scripts\Tool. Last revised 5th March 2008 by Daniel.
User Controls:
Building a fancy macro, or just customising an existing tool? Want to hide built-in controls, customise them, or add a whole new control of your own to drive your expression wizardry? This is the script for you - check it out. Currently, you can hide most built-in controls, or add a variety of window- or view-controls, with many options. Added controls don't immediately do anything, of course, but expressions on other controls or even other tools can reference them, which can be particularly useful for macros.
For Fusion 5.21 or later. Place the script into Scripts\Tool. Last revised 7th Oct 2008 by Daniel.
Track Published Points:
Run this tool script on a spline mask with published points, and it will set up a Tracker & connect all the points to it, ready for tracking. Place the script into Scripts\Tool.
It is designed to work on spline masks and b-splines.
Update Render Location:
This tool script is meant to be used in conjunction with the "Save New Version" script.
It will update a saver's path so that it matches the new comp name. It also takes into account sitations
where rendered image sequences are to be put into subfolders of the same name.
Tracker to Transform:
This script connects transform to selected tracer, bakes animation, and allows averaging keyframes or removing jitter.
Also allows to change reference frame and scale transform values. Saves last settings to comp.
SE_SetTargetToCam.eyeonscript:
Activate any 3D tool's target and line it up with one of the cameras in the scene.
It goes into scripts\tool and works on 3d tools only.
SE_TextPlusPlus.eyeonscript:
How many times have you wanted to copy the settings from one Shader in Text+ to another for adding further elements?
And how many times did you end up copying values back and forth manually?
This little script helps you achieving this in just a mouseclick.
For now it won't copy animated values, though.
It goes into scripts\tool and works on Text+ only.
SE_PointCloudFun.eyeonscript:
This script allows for adding imageplanes at PointCloud points,
as well as setting up 4 3DLocators at selectable points of a PointCloud.
A huge Timesaver when dealing with 3D-tracked scenes.
It goes into scripts\tool and works on PointCloud3D only.
Switch 3D Renderer type:
This script allows to switch renderer type of all(or selected) Renderer3D tools in composition to OpenGL or Software renderer.


Export 3D Transform.eyeonscript:
This tool script will export a baked version of a 3D tools transforms to a space delimited ASCII text file. The first line of the file has three entries as follows :
id rotation_order target
id
The id of the current tool type, as returned by tool:GetID(). i.e. a Camera would be Camera3D
rotation_order
A string describing the current rotation order
target
Will be 1 if the Use Target checkbox was selected, otherwise it is 0
The remaining lines have the following format
time x y z rot_x rot_y rot_z pivot_x pivot_y pivot_z target_x target_y target_z [angle_of_view]
The angle of view will only appear if the tools id is Camera3D and the type of camera is not orthogonal


Graceful LD Failure:
This will add a BG and DX to your LD so that the LD will not fail a render if it is out-of-range. --Chad


Convert Path to XY Path:
This script will convert an input that has been animated with a path modifier to an XY path (optionally ignoring either the X or Y axis). It can bake the animation or just convert the path's keyframes, but it can't convert smooth bezier handles. Note: You shouldn't convert tracker paths directly as this will prevent the tracker from working properly. Instead, connect the stable or unstable inputs to a Xf or Merge node and then use this script. --Tilt
I updated this script to fix two issues. The first was a bug that would cause it to ignore some types of Path. It was also using 1 for the default Start Frame, when some compositions will start from 0. I updated the script on May 14th, 2008 to fix those two issues. --Izyk


Copy Keyframes
This Script will help to copy keys to another time
It shows a dialog with all keys at current time and let the user decide which of them should be copied
than enter a destination frame an hit okay, all selected keys will be copied to the destination frame
Goes into Scripts\Tool
--Michael_v


Select Similar
These 2 Scripts will select other tools with the same color or from the same type
Goes into Scripts\Tool
--Michael_v


SelectWirelessSource
a little tool script that selects the source of a WirelessLink Fuse and move the FlowView to it
Goes into Scripts\Tool
--Michael_v


Loader/Saver version up
simple tool script that increases the version number in a loader or saver
(best use as a hotkeyscript to easily switch between different versions of your source)
Goes into Scripts\Tool
--Michael_v


Loader/Saver version down
simple tool script that decreases the version number in a loader or saver
(best use as a hotkeyscript to easily switch between different versions of your source)
Goes into Scripts\Tool
--Michael_v
Comp_Name_&Saver&_Date_to_Saver
Changes the Filename field of selected savers to <CompName>_<Saver>_<YYYY.MM.DD>.<ext>
Where
CompName - your composition's name
Saver - the part of a saver's name after Saver_ (e.g. if your saver's name is "Saver_OutputA", it'll take OutputA)
YYYY.MM.DD - current date
ext - original extension that has to be already set.
Based on Rocket_Science_Saver_Clip_Rename.eyeonscript by Brian Sinasac, reworked by Igor Kozitsyn, Dmitry Korshunov and Dmitry Slepichev.
Simplified versions: Comp_Name_&_Date_to_Saver,   Comp_Name_to_Saver

Utility Scripts

Log Manager
This script was designed to help manage the logs generated by the Fusion Render Manager.
There are 2 tools available in this script, Split Render Log tool and the Log Analyzer tool.
The Split Render Log tool allows the user divide their single large render log into a much more manageable daily log.
The Log Analyzer tool allows the user to view information for a specific day and broken down into specific jobs. The data is displayed in a series of tabs as follows:
General Information – job title, requester, render status, start, end and render time as well as the list of machines used in the render.
Errors – all errors found for the specified job
Verbose – all log entries for the specified job
Additionally, the Log Analyzer allows the user to save the file in a printer friendly format.
IUP was used to create the user interface.
To run this script ensure that the script is saved in the Fusion/Scripts/Utility directory. Run the script from the File->Scripts menu of Fusion.
GetCmdHelp.eyeonscript
Directly display help in SciTE console on selected eyeonscript objects and methods.


Third-party Scripts

Max 9 to Fusion Cam and Fusion Cam to Max 9:
These Fusion & Max scripts can import and export Fusion Camera animation to Max 9 and back again.
Written by Ciril, www.silverwavestudios.com. Last revised 2007.


DFSHToMaxAndBack - http://www.rpmanager.com/temp/DFSHToMaxAndBack02.ms:
This Max script can import and export Fusion DFSH shape files (created by exporting polylines from Fusion).
Written by Grant Adam. Last revised 2001.


Web based render monitor
More monitor than render manager, but hey.. you can monitor via web browser your render queue, to move comps up/down, to remove them from queue and save the queue itself.
It has option to connect to any available QueueManager on the local network.
Implemented simple ACL - access control list via remote IP adress, to control who can operate the queue.
Tested with apache web server for Windows.
To install - (a)change file extension to cgi; (b)place it in cgi-bin directory of the web server; (c)edit the first two lines - path to eyeonscript.exe and default render master in your network.


Batch List Footage
This script outputs a list of all loader images/sequences and saver files. Each line of a text file is read for a .comp filename. The script will open each comp in fusion and output the queried information. This is a modification of the original List Footage script for batch purposes.
Modified by S. Lee Gooding, www.seyet.com. Last revised 09/05/2008.


Extras

VidModes.def
Updated version of frame formats configuration file for Eyeon Fusion 5 (including RED One 2K-4K/Epic 5K, Silicon Imaging SI-2K).
Updated by Ciril, www.silverwavestudios.com. Last revised 20 April 2008.


Tips and Tricks

How to run Comp or Tool scripts from outside Fusion

The only difference that sets Utility, Comp & Tool scripts apart is that they're automatically given some local variables when they start up. All types are given fusion (& fu), referring to the Fusion object, Comp and Tool scripts also get composition (& comp), referring to the composition that the script was started from, and Tool scripts get tool, referring to the tool that was used to start the script.

You can easily convert any of these into scripts that can be run from outside Fusion (executing them with eyeonScript.exe), by adding the following code to the start:

--[[ For Utility scripts ]]---------
if not fusion then
  fusion = Fusion("localhost")
  fu = fusion
end
 
--[[ Add this for Comp scripts ]]---------
if fusion and not comp then
  composition = fusion:GetCurrentComp()
  comp = composition
end
 
--[[ Add this as well for Tool scripts ]]-----------
if comp and not tool then
  tool = comp.ActiveTool
end

This sets up the default variables from the local copy of Fusion (assuming it is already running), the current comp, and the currently active tool. Be aware that these variables may be nil (e.g. if no comp is open, or if no tool is currently active), and many scripts assume they are valid.

How to construct a group or macro from a script

Unfortunately, there's currently no trivial way to group tools from a script. However, it can be done by assembling a series of nested tables containing the tools to be grouped, with a few extras describing the rest of the group. These nested tables mirror the tables found in .setting files. You can then paste those tables directly into the comp, or save them as a setting file etc.

Take a look at the differences between a tool and a grouped tool to see what has to be done: Copy the tool (from the flow view) & paste it into SciTE to see its table structure. Now group the tool & copy/paste that into a different SciTE window. See how the original tool is now contained within an outer GroupOperator table, with extra tables describing which inputs/outputs are externally available?

You'll need a table containing the tools to be grouped. This can be done manually, by loading a .setting file, or by using the comp:CopySettings() function. Then, create the GroupOperator tables and plug the tools table into that. Here's an example script fragment that assumes you have a single ColorGain1 tool that you want to make a group out of.

-- Create a group table called Group1
gt = { Tools = { Group1 = { __ctor = "GroupOperator" } }
gt.Tools.Group1.ViewInfo = { __ctor = "GroupInfo" }
gt.Tools.Group1.Inputs = {}
gt.Tools.Group1.Outputs = {}
 
-- Add an external input, referencing ColorGain1's Input
gt.Tools.Group1.Inputs.Input1 = { __ctor = "InstanceInput", SourceOp = "ColorGain1", Source = "Input" }
 
-- Add an external output, referencing ColorGain1's Output
gt.Tools.Group1.Outputs.Output1 = { __ctor = "InstanceOutput", SourceOp = "ColorGain1", Source = "Output" }
 
-- get a table of settings for the actual tools to go in our new group
t = comp:CopySettings(ColorGain1)
gt.Tools.Group1.Tools = t.Tools
 
-- paste it back into the comp
comp:Paste(gt)

Creating macros is actually fairly similar, except you'd use __ctor = "MacroOperator" instead of "GroupOperator", and the external inputs/outputs should be named "MainInput1"/"MainOutput1" etc, while exposed controls are just called "Input1" etc. You can also use extra values in those Input tables, such as Name, Default, MinScale and MaxScale. Have a look at an existing macro setting file for examples.

How can I find the location of a tool in the flow?

Works in v 5.2 & up

Help "FlowView:GetPos"
Help "FlowView:SetPos"

Example:

x,y = comp.CurrentFrame.FlowView:GetPos(Background1)
comp.CurrentFrame.FlowView:SetPos(Background1, x + 0.5, y)
Personal tools