-
Get value of an Anchor-Point of an Layer which name is choosen by CSV
Hello, have an Problem with my code. I have csv table with two columns: One “MarkerNr” and one “Landkreis” (german word for counties). I have a Slider with the rounded values of 1-10 which use to select the row i want to access. In the column “Landkreis”, i have the name of the counties (for example “Ortenaukreis”) and i have many Layer with the counties name (so for example one of the Layer names is “Ortenaukreis”, too). Now i want the Position of an Null Object too get set to the Anchor-Point of the choosen Layer Name from the CSV. But it doesn’t work, it will show an error message tranlated from german says something like: Layer-Index 0 not within the allowed range…
Here is my code:
markerNr = thisComp.layer(“Werte_Speicher”).effect(“Auswahl-MarkerNr”)(1); //this is the slider to choose the row
landkreis = footage(“Landkreisauswahl.csv”).dataValue([1,markerNr]); //get value from the csv at position of slider
l = thisComp.layer(landkreis); // acces the Layer with name written in the csv (e.g. layer with name “Berlin” or “Ortenaukreis”)
l.toComp(l.anchorPoint); // get position of the selected layers anchor Point in this comp
my CSV looks like the one in the photo i attached. Hope i could explain may problem good enough (my english isn’t the best) and someone can help me with this.