• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Adding a path to a group of contents gives an error

Contributor ,
May 01, 2023 May 01, 2023

Copy link to clipboard

Copied

I currently have a layer that has an effect "Start"

I have another layer where I have a Fill.

In the file I have an express with some code part of the code is a start point:

 

start = thisComp.layer("Control").effect("Start")("Point")[1];

 

In another layer I have a group of imported itmes from illustrator.

It contains:

Screen Shot 2023-05-01 at 7.05.23 PM.png

In Contents I added a path and also added the express with the start code.

In this layer it gives me an error:

Error: Object of type not found where a property is needed

Is there a difference in the way that a fill layer and the vector group layer if treated? If so how can I set the start point of this object also?

TOPICS
Scripting

Views

311

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , May 01, 2023 May 01, 2023

It sounds like you're trying to reference a layer within a group in After Effects using an expression, but you're encountering an error.

When you have a group of vector shapes in After Effects, the group itself is treated as a layer, and the individual shapes within the group are treated as contents. So in order to reference a path within a group, you need to specify the index of the group layer followed by the index of the shape within that group.

For example, if you have a group layer named "Gro

...

Votes

Translate

Translate
Community Expert ,
May 01, 2023 May 01, 2023

Copy link to clipboard

Copied

What is it that you're trying to do?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 01, 2023 May 01, 2023

Copy link to clipboard

Copied

LATEST

It sounds like you're trying to reference a layer within a group in After Effects using an expression, but you're encountering an error.

When you have a group of vector shapes in After Effects, the group itself is treated as a layer, and the individual shapes within the group are treated as contents. So in order to reference a path within a group, you need to specify the index of the group layer followed by the index of the shape within that group.

For example, if you have a group layer named "Group 1" and a shape within that group named "Shape 1", you would reference it in an expression like this:

thisComp.layer("Group 1").content("Shape 1").path


To set the start point of a path within a group, you can modify your expression like this:

 

start = thisComp.layer("Control").effect("Start")("Point")[1];
thisComp.layer("Group 1").content("Shape 1").path.points()[0] + start

 

This expression will add the value of the "Start" effect on the "Control" layer to the first point in the path of "Shape 1" within "Group 1".

Note that you may need to adjust the index numbers in the expression based on the order of your layers and shapes. Also, make sure that the "Control" layer is above the layer with the group of shapes in the layer stack so that it is properly referenced in the expression.

I hope this helps!

 

Karthik

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines