Skip to main content
Participant
December 31, 2021
Answered

Split name of fill property instead of layer name

  • December 31, 2021
  • 1 reply
  • 959 views

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."

 

 

 

 

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.

This topic has been closed for replies.
Correct answer Dan Ebberts

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

1 reply

Dan Ebberts
Community Expert
Community Expert
December 31, 2021

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

Participant
December 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."

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
December 31, 2021

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