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

Split name of fill property instead of layer name

New Here ,
Dec 31, 2021 Dec 31, 2021

I usually use a Split() expression to get pieces of a layer name and link a long list of comps to a control layer, but now I'm using one shape layer with fills connected to CSV data. I'm trying to figure out if I can use Split() to pull the title of the Fill propery in the same way I'd pull the layer name but I'm having trouble finding information about it. 

This is the expression I use for layer name split:

OnOff = thisComp.layer("1 - CHOOSE TEAM").effect(thisLayer.name.split("_")[0]+"_"+thisLayer.name.split("_")[4])("Checkbox")
if (OnOff==1){100}
else{0;}

 This is a screenshot of the shape layer with the Fill property renamed as "NFL_SECONDARY_COLORS_2020_ARZ."

Screen Shot 2021-12-31 at 1.38.06 PM.png

 

 

 

 

When the layer name is split, it only pulls "NFL_ARZ" and matches that to a checkbox on the control layer. 

Looking to do this same exact thing but instead of pulling the layer name, pulling the custom Fill property name that is within the shape layer. This shape layer has a fill layer for every NFL team.

TOPICS
Expressions , Scripting
780
Translate
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

Community Expert , Dec 31, 2021 Dec 31, 2021

Yes, sorry- rookie mistake. I think it should be thisProperty.propertyGroup(1).name

Translate
Community Expert ,
Dec 31, 2021 Dec 31, 2021

If I understand correctly, I think you just need to replace thisLayer.name with thisProperty.name in both places.

Translate
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
New Here ,
Dec 31, 2021 Dec 31, 2021

I thought so too at first, but when I do that, it pulls the property the expression is applied to, so in this case, opacity. It throws an error then becase it's trying to read the property 'Opactiy' and parse that name when the goal would be to move up one segment and get the Fill name, in this case "NFL_COLORS_2020_ARZ."

Screen Shot 2021-12-31 at 4.40.47 PM.png

Screen Shot 2021-12-31 at 4.43.48 PM.png

Translate
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
Community Expert ,
Dec 31, 2021 Dec 31, 2021

Yes, sorry- rookie mistake. I think it should be thisProperty.propertyGroup(1).name

Translate
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
New Here ,
Dec 31, 2021 Dec 31, 2021
LATEST

You're a hero. Thank you so much. That's one I've never used before and glad you were able to help! The full expression below works perfectly.

 

OnOff = thisComp.layer("1 - CHOOSE TEAM").effect(thisProperty.propertyGroup(1).name.split("_")[0]+"_"+thisProperty.propertyGroup(1).name.split("_")[4])("Checkbox")
if (OnOff==1){100}
else{0;}

 

Translate
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