User:Gringo/Eyeon Fusion Tips & Tricks

From VFXPedia

Jump to: navigation, search

Contents

General Subjects and Interface

  • Fine-tuning a shot where the the camera changes a lot or the objects look rather different at different points, it's useful to see several different frames at once to watch how your changes affect the entire shot. For that you can view the result through several TimeStretchers on separate Display Views or even in one picture, merged together. The result will be rendered slower, but you'll avoid the situation when slight improvements in one frame destroys others.
  • If you want to shift many loaders in your composition in time, it's much easier to do in a text editor (via the Open in Scite script, for example) replacing the rows GlobalStart = <X> and GlobalEnd = <Y> with new X and Y values.


Flow Editor

  • Once you rename a loader or a saver node, Fusion stops displaying its clip name and shows only the node name instead. To display the actual file name again, Ctrl+X the Saver or the Loader, open a text editor and paste from the clipboard. Remove the following string at the beginning:
NameSet = true,
Then copy everything to the clipboard and paste back to the Flow.


Controls Area

  • You can enter rather complex expressions using mathematical operators e.g. +,-,*,/,^, brackets, functions e.g. sqrt(), log(), tan(), constants like pi, e directly to any number fields in the Control Panel and Fusion will calculate the result for you.


Bins

  • Large (default) icons in the Bin are 160x120 pixels and huge icons are 240x180. You can save a .bmp to the same folder and with the same name as your .setting to use it as a thumbnail.


Image Tools

  • To avoid bright flashes created by the Glow tool when bright objects cross the frame border, set the the Clipping Mode to None.
  • To optimize your CustomTool performance, try to move as many calculations as you can from the Channels tab to Setup or to simple expressions to avoid their repetitive execution for each pixel. The expressions in the Setup tab are executed once per frame as well as simple expressions in opposite to Channels and Inter which are executed once per pixel. Nevertheless, Intermediate expressions can also optimize rendering if they perform the same calculation for several channels.


3D

  • If you want to displace a dense 3D-surface with a map, it's optimal to have the map resolution equal to the grid resolution + 1 pixel in each direction.
This way every pixel on the map corresponds to a vertex. The same applies to any other property applied on the vertex level with a map.
  • The range set in the SoftClip, wherever it's connected in the scene, is scaled together with the camera.
This means, if you scale the whole scene, the relative clipping doesn't change. But if you scale only the camera, you need to compensate by scaling the clipping range to the opposite direction if you want to preserve the actual clipping distance in the scene.


Particles

  • To quickly transfer all the particle style properties from a pEmitter to a pChangeStyle or a pSpawn, copy the pEmitter to the clipboard, paste it to a text editor, do the same for the pChangeStyle, copy and paste all the ParticleStyle tags from the pEmitter text to the pChangeStyle text, copy the pChangeStyle text to the clipboard and paste it back to the Flow.


  • 3D-shape particles can be simulated by three pEmitters with the Always Face Camera turned off and the Rotation set so that the sprites are perpendicular to each other. Particles' positions have to be the same and sprites' textures should represent the object rendered from front(back)/right(left)/top(bottom). Interactive lighting can be simulated by assigning corresponding normal maps as the sprites' texture which can be affected by a pCustom depending on the particles' position.
Since Fusion 6.4, the Replicate3d tool offers real 3D-shape particles.


  • The resolution of the input sprite image doesn't affect the size of bitmap-style particles. If you change the image aspect by means of either resolution or pixel aspect, the width of the particles is maintained and the height is altered.


  • The get[ch][#]b(x, y) function of the pCustom tool samples values in the image coordinate space, so getr1b(0, 0) samples the bottom left corner and getr1b(0.5, 0.5) samples the center. This means, the image isn't virtually positioned in the 3D space by any means.


  • To take the color values from the top right corner of an image with the get[ch][#]b(x, y) function, use getr1b((w1-1)/w1, (h1-1)/h1)
(Chad Capeland)


  • The pCustom tool doesn't have a Config tab to rename its controls. To not get lost in your parameters designations, you can create a new Controls' Names text field with the UserControls.eyeonscript in the Numbers tab and describe the purpose of each screw control there.
You can also create user controls with the names like NumberIn1 to turn the pCustom's standard screw controls into named sliders, checkboxes and so on. This, however, currently leads to loosing the parameters' values after re-opening of the composition.
Another way is to create user controls with sensible names and connect the standard parameters of the pCustom to them with simple expressions.


  • All the forces are evaluated once per sample, not once per frame. The same for pCustom expressions. For example, if you use px+1, 1 will be added several times a frame if MB is switched on or the Sub-frame Calculation Accuracy is >1. The Quality control of MB multiplied by the Sub-frame Calculation Accuracy defines the amount of samples.
(Stephen Horwat)


  • To compensate the motion blur and the Sub-frame Calculation Accuracy influence on the results of pCustom expressions you have to divide anything you add to the particles' properties by (<MB Quality> * <MB Is On> * 2 + 1) * <Sub-frame Calculation Accuracy>
Since Fusion 6.14 you can just multiply everything you add to the expressions by delta. Everything which is a multiplier in your expression should be raised to the power of delta.
For example, px+3 should be changed to px+3*delta and px*3 should be changed to px*3^delta.


  • Unlike pCustom, the pCustomForce tool doesn't re-define the velocity completely, but rather adds impulse. Besides, it takes into account increased number of samples per frame, maintaining the amount of effect regardless Motion Blur and Accuracy settings.
This means, the expressions get more simple: for instance, instead of vx+3*delta you should use just 3.


  • To bring more irregularity to turbulence field, you can apply the Shake modifier to pTurbulence\Density.


  • If you alter particles' trajectories using pCustom Position X/Y/Z Expression, the particles will only be shifted. If you use pCustom Velocity X/Y/Z Expression instead, they will also be rotated relative to motion in case the Rotation Mode is Rotation Relative to Motion.


  • To make particles rotate according to their motion with a pCustom, use if(vx>0, atan(vy/vx), atan(vy/vx+180) as the Rotation Z Expression.


  • To soften the regions borders, you can apply a high-frequency Shake modifier to their size or position. See a detailed explanation.


Scripting and Development


General

  • To replicate the effect of Output Levels, you need to multiply the color with the difference High-Low and add Low. If you do this with a pCustom, put c1*(n2-n1)+n1 to the channel expressions (n1 is the black point or Low and n2 is the white point or High). The same can be done with a ColorCorrector or a BrightnessContrast. Expression for the Gain: High-Low. Expression for the Brightness: Low


Expression Modifier

  • You can easily clamp negative values of a parameter if you multiply it by (x>0)
For example, n1*(n1>0) returns a positive value or 0.
This construction is more compact than if(n1>0,n1,0)


User Controls

  • To add a user control where you can drag and drop an image node (an equivalent of an image input), use
LINKID_DataType = "Image",
INPID_InputControl = "ImageControl",
  • To add a user control where you can drag and drop a 3D node (an equivalent of a SceneInput), use
LINKID_DataType = "DataType3D",
INPID_InputControl = "ImageControl",
(Stephen Horwat)
See also: Script/Reference/Applications/Fuse/Classes/ScriptOperator/AddInput
  • By default, the User Control script creates new controls with no spaces in names. To fix it, copy-paste the tool ta a text editor and replace INPS_Name = "<Compound Name>", with LINKS_Name = "<Compound Name>", in the control description.
  • To create a mix slider, similar to the Background-Foreground in the Dissolve tool or Subtractive-Additive in the Merge, instead of
LINKS_Name = "..."

use

SLCS_LowName = "...",
SLCS_HighName = "...",
  • If you need an additional control of a certain type in your macro, it's not always necessary to create a user control. Instead, you can use any unused controls of the internal nodes.

For instance, the Label controls. You can take them from the tools, depending on what amount of exposed macro controls need to be included to the roll-out:

Any Tool.StartEndRenderScripts - 2
Transform.ReferenceSize - 3
Merge.ReferenceSize - 3


Macros

  • If you want to expose the ColorCorrector's controls from the Shadows / Midtones / Highlights or Red / Green / Blue sections, you need to create their clones using the UserControls script, connect the originals to the clones correspondingly by simple expressions and expose the clones. The reason for this is the controls in the subcategories are dynamically created once you press the Shadows / Midtones / Highlights (or Red / Green / Blue) buttons, so macro is unable to expose them all directly.
  • To group the macro controls into roll-offs, you can create label user controls in any tool inside the macro with the UserControl script and expose them among the macro controls right before the controls you want to nest. The key parameters for label controls are LBLC_NumInputs (the quantity of following controls to include) and INP_Default (0 to have the roll-off closed and 1 to open it by default)
  • In case you need a condition check in the CustomTool and this condition may be checked not for every pixel, but once per frame, it's much more effective to put the condition not directly to a channel expression, but to a simple expression, created on the corresponding channel expression field in the following format: Text(iif(<condition>,"<true-option>","false-option")). Such a simple expression will put different CustomTool expressions to its channel expressions depending on the condition and speed-up the tool dramatically.


Scripts

  • Sometimes you need to access several parameters of another node in the Flow in order for your macro to work. If the node's name is unknown, it's better to have just one text field where a user can copy-paste the node's name instead of connecting its multiple parameters directly. dostring() command can help assembling full parameters' names based on the node name. In this Text+ render script example the TextSize variable is assembled from two words and used to set a Text+ parameter:
TextSize = 0.1
AssignSizeScript = "Size = Text".."Size"
dostring(AssignSizeScript)
(Christoffer Hulusjö)

Another way to do this is to create an image or a 3D input instead of a text field so that you can just connect the tool from which you need to get the parameters' values or drag and drop it instead of copy-pasting its name. To get the name of a node connected to an input, use the GetSourceTool() function.

For example, this frame render script in a Text+:
src = self:GetSourceTool("LoadersName")
StyledText = string.gsub(src.Clip.FileName, "^(.+[/\\])", "")

Assigns to the Text+ the file name of a Loader connected to the Loader's Name user control.

(Stephen Horwat)

You can also use simple expressions. Actually, a Frame Render Script won't work for setting pEmitter's region position (the region will move, but the particles will be born at the same place).

For example, this expression:
_G[LocatorName.Value].Transform3DOp.Translate.X
on pEmitter's\Region\X Offset takes the name of a tool, entered to the user-created LocatorName text field and adds a source parameter name.
(Peter Loveday)


  • You can set Transform.Edges to Mirror by assigning 3 to it: Transform.Edges = 3. This mode is similar to Wrap, but it mirrors the image to avoid seams.
(Robert Zeltsch)


  • A text created by a script can be formatted using \t for tabulation and \n for a new line.


  • If you combine numbers and text in one string with the .. operator, you should always insert a space between this operator and the number. Otherwise, one of the points is considered to be a part of the number.
For example: "The length is ".. 1000 .."mm."


  • To insert the current date in a certain format by a script, use the os.date function. For example, os.date("%d.%m.%Y") will return something like 31.12.2010 (Russian date format).


  • To get the file name of a Saver without path, use string.gsub(Saver1.Clip.FileName, ".*\\", "").
Where Saver1 is the Saver's node name
string.gsub() is a function which replaces all the characters in the string like "Drive:\Folder2\Folder1\FileName.ext" before the last "\" and this last "\" with an empty string leaving only "FileName.ext".


  • If you want to get the path to the folder which stores your sequence, use string.gsub(Saver1.Clip.FileName, "(.+)\\.+\\.+", function(s) ParentFolderName = s end)
Where Saver1 is the Saver's node name
string.gsub() is a function which replaces all the characters in the string like "Drive:\Folder3\Folder2\Folder1\FileName.ext" after the second "\" from the end including this "\" with an empty string and assigns remaining "Drive:\Folder3\Folder2" to the ParentFolderName variable.


To get the value of a property, use <ToolName>.<InputName>.<PropertyName> or <ToolName>.<OutputName>.<PropertyName>. Most of the time InputName and OutputName are just Input or Output.
For example: Blur1.Input.OriginalWidth or Loader1.Output.XScale



  • To access a particular value from a metadata field defined in the array format, for instance, FieldName = { 1, 2, 3, 4 },
use <Loader Name>.Output.Metadata.<Field Name>[<Number>],
For example: Loader1.Output.Metadata.cameraTransform[13]



Gregory Chalenko
www.compositing.tv