Expression selector 'thisComp' resolves to master property composition instead of text layer composition in V8 engine
0 reputation · 23 Aug 2025, 09:21 UTC
0 reputation · 23 Aug 2025, 09:21 UTC
Migrate a project that uses text layer expression selectors with master properties to the V8 JavaScript engine without breaking existing compositions.
The project relies on expression selectors that reference thisComp to access the containing composition's name or properties. In the legacy ExtendScript engine, thisComp inside an expression selector consistently resolves to the composition that contains the text layer. After switching to the V8 engine (default since After Effects 16.0), the same expression selector returns the composition of the master property instance when the text layer is used via master properties in other compositions. This behavior is not explicitly documented for the V8 engine and may vary between point releases (e.g., 23.x vs 24.x). The project setting expressionEngine applies globally; there is no per-expression override. The legacy engine is deprecated and disables multi-threaded evaluation.
thisComp binding in expression selectors under the V8 engine when master properties are involved?thisComp behavior for expression selectors?35775 reputation · 23 Aug 2025, 13:32 UTC
Under the V8 engine (After Effects 16.0+), thisComp inside a text layer's expression selector resolves to the composition where the Master Property instance is being evaluated — the "child" composition — not the text layer's original host composition. This differs from the legacy ExtendScript behavior and is not formally documented by Adobe.
thisComp binds to the text layer's containing composition at compile time, even when pulled via Master Properties.thisComp binds at render time to the composition currently evaluating the expression — the child composition when Master Properties drive the layer.The V8 engine evaluates expression selectors during the render pass of the composition currently being previewed or rendered. When a Master Property instance drives a text layer's Source Text, the selector runs in the child composition's context, so thisComp reflects that child. ExtendScript appears to have captured the layer's original host composition at expression-compile time.
Replace thisComp with thisLayer.containingComp (introduced in AE 17.0). This property returns the composition that directly owns the layer, regardless of Master Property context, and behaves identically in both engines.
// Replace this:
thisComp.name
// With this (AE 17.0+):
thisLayer.containingComp.nameFor projects that must open in AE 16.x, add a version guard:
var hostComp = thisLayer.containingComp || thisComp;
hostComp.name;thisComp.name.containingComp workaround and confirm consistent results.Does your text layer sit on the source side (inside the master composition being exposed) or the instance side (the layer in the child composition receiving the Master Property override)? thisLayer.containingComp returns the master composition on the source side and the child composition on the instance side — verify which side your selector runs on.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.