Copy link to clipboard
Copied
Hi,
I need to change targeted layer name dynamically.
This is regular path name:
thisComp.layer("layername").effect("...
I want to change the path name like:
thisComp.layer("layername"+ a value from a slider).effect("...
When i add a value like:
thisComp.layer("layername"+ 0).effect("...
thisComp.layer("layername"+ 1).effect("...
etc. it works.
But when i try to write:
x= thisComp.layer("sliderLayer").effect("nameValue")("Slider");
thisComp.layer("layername"+ x).effect("...
not working.
Do i try an invalid operation.
Or is there any way to execute it in CS5.
Thanks
Sliders return values, not strings. You need to include a toString() conversion.
Mylenium
Copy link to clipboard
Copied
Sliders return values, not strings. You need to include a toString() conversion.
Mylenium
Copy link to clipboard
Copied
Thank you Mylenium
I didn't know how to use toString() conversion.
I have investigated and find it.
It may help another members.
thisComp.layer("layername"+ x.value.toString())).effect("...
Copy link to clipboard
Copied
You probably just need to change this line:
x= thisComp.layer("sliderLayer").effect("nameValue")("Slider");
to this:
x= thisComp.layer("sliderLayer").effect("nameValue")("Slider").value;
Dan
Copy link to clipboard
Copied
Dan Ebberts​
x= thisComp.layer("sliderLayer").effect("nameValue")("Slider").value;
not working but
x= thisComp.layer("sliderLayer").effect("nameValue")("Slider").value.toString();
is working.
And it's the best usage i think.
Thanks