You are not logged in.

1

Friday, April 24th 2015, 6:38am

Access to specify the layer name

Source code

1
2
3
4
for(set(spot,1), spot LT layer.count, inc(spot), 	
    trace('layer[',spot,'].name=',layer[get(spot)].name);
	
    );


Dear everyone

This is to get the names of all the layers in panorama

If I want to get the specified layer, how to get?

benji33

Intermediate

Posts: 244

Location: France

Occupation: Senior Software engineer

  • Send private message

2

Friday, April 24th 2015, 11:01am

Source code

1
2
3
4
5
for(set(counter,1), counter LT layer.count, inc(counter), 	
  if(layer[get(counter)].name == 'MY_LAYER_NAME',
    <!-- execution code on the selected layer here -->  
  );
);


or if you're talking about the layer object you can copy it using the copy method

PS: perhaps avoid the "spot" var name it's confusing ;)