You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

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 ;)