You can also right click and
ExpressionThis allows for text manipulation. And you can use Lua:
- Code: Select all
-- Assume composition is: C:\path\Composition1.comp
Text(comp.Name) -- Composition1.comp
Text(comp.Filename) -- C:\path\Composition1.comp
-- Lua string manipulation
string.match(comp.Filename, "(.-)[^\\]-$") -- C:\path\
string.match(comp.Name, "([^%.]+)") -- Composition1
string.match(comp.Name, "(%..+)$") -- .comp
string.match(comp.Name, "%.(.+)$") -- comp
Most (all?) of the attributes of the Lua
comp object are supported.
In the Console-Tab print
- Code: Select all
==(comp:GetAttrs())
(== is a shortcut for dump() which is similar to python's pprint. That means it prints table structures nicely and even objects get a string representation.)- Code: Select all
Lua> ==comp:GetAttrs()
table: 0x03d7dec8
COMPN_LastFrameRendered = -2000000000
COMPB_HiQ = true
COMPI_RenderFlags = 131090
COMPN_ElapsedTime = 0
COMPN_AverageFrameTime = 0
COMPB_Locked = false
COMPB_Modified = true
COMPN_TimeRemaining = 0
COMPN_CurrentTime = 15
COMPN_RenderEnd = 60
COMPN_AudioOffset = 0
COMPS_Name = tire.comp
COMPN_GlobalStart = 1
COMPI_RenderStep = 1
COMPS_FileName = C:\Users\Public\Documents\Blackmagic Design\Fusion\Comps\tire.comp
COMPB_Rendering = false
COMPN_RenderStartTime = 1
COMPN_GlobalEnd = 1000
COMPN_RenderEndTime = 60
COMPN_RenderStart = 1
COMPN_LastFrameTime = 0
COMPB_Proxy = true
The Simple Expression names are similar but without the COMP*_ prefix and some have a bit different case: FileName -> Filename.
You need to use Text() or tostring() for non-string types like Booleans.
COMP basically means that this is the Attribute tag of the composition and the letter stands for the variable type:
- N -> Number
- I -> Integer
- B -> Bool
- H -> Handle
- S -> String/Text