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

Tuesday, March 25th 2014, 2:00pm

getting a layer name (Solved)

Hello,

I would like to make an action to alter different properties of layers/plugins. I'm trying to get the name of a plugin/layer.

For example:
<layer name="cool3"/>
set(i,3); tween(layer['cool',[get(i)]].alpha,0,1);

What is the correct syntax to do this?

Thank you,
Tom

This post has been edited 1 times, last edit by "o.mwell" (Mar 25th 2014, 9:32pm)


Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

2

Tuesday, March 25th 2014, 2:34pm

Hi!
well, it's simple

txtadd(layer_name,cool,get(i));
tween(layer[get(layer_name)].alpha,0);

txtadd - docu

Regards
Andrey
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

3

Tuesday, March 25th 2014, 2:58pm

Thank you very much!

4

Tuesday, March 25th 2014, 4:48pm

Started to insert into a for loop, then i find myself stuck again.

Here it is:

set(maxvar,12);
for(set(i, 1), i LT maxvar, inc(i),
txtadd(lname,cool,get(i));tween(layer[get(lname)].alpha,0););

Strange. Seems like only the eleventh layer gets the tween.

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

5

Tuesday, March 25th 2014, 5:32pm

Well
it's a simple programming
you set i to 1 and condition i LT 12 so
it's - 1,2,3,4,5,6,7,8,9,10,11 values
because 11 is LT 12 but 12 is = 12
that's why just 11 elements
and you need:
- start from 0 - set(i,0); and i LT maxvar
or
- start from 1 - set(i,1); and i LT 13 add(maxvar,1); or set(maxvar,13) or inc(maxvar);
anyway it depends on your own case

Regards
Andrey
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

6

Tuesday, March 25th 2014, 5:57pm

Sorry, my bad. Losing my mind.
In the action the value for the condition is set correcty, i just made this stupid mistake for the example.

Nevertheless, my question is regarding the for loop not tweening all the layers just the highest before 12.

7

Tuesday, March 25th 2014, 7:51pm

Tried it with set instead tween and its working.

So for 11 layers the following will work.

set(maxvar,12);

for(set(i, 1), i LT maxvar, inc(i),

txtadd(lname,cool,get(i));set(layer[get(lname)].alpha,0););

But not with tween. And i would like it to be animated.
Maybe a workaround can be done with triggering an action,
but i'm sure there's a simpler way to do this and also would like to understand what i am missing here.

Best,
Tom

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

8

Tuesday, March 25th 2014, 8:46pm

Hi!
yes you are right
tween is special :) dunno why but it is
for tween multiply layers do so
for(set(i,0), i LT maxvar, inc(i),
txtadd(lname,coll,get(i));
dotween(get(lname),0);
);

and additional helper action
action name="dotween"
tween(layer[%1].alpha,%2);
/action

And it will works ;)

Andrey
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

9

Tuesday, March 25th 2014, 9:31pm

It is working.

Thank you Andrey.

All the best,
Tom