How to control autorotate in the skin? [SOLVED]

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
Frankster69
Posts: 76
Joined: Mon Sep 18, 2017 12:54 pm

Sat Dec 14, 2019 3:59 am

Hi all,

Perhaps you can help me with this. I'm doing a 29 image tour. At first I thought it to be nice to use autorotate, from the output options. I can configure speed (I liked it slower) and also automatic change to the next node after x seconds.

Then I setup the hotspots to toggle autorotate on mouse-over and -out. But this lead to some inconsistencies at some points. When autorotate was still off, mousing over a hotspot could at times turn it back on, what I didn't want. In the end I chose to skip autorotate on load, but just have it present in the menu as option. I think that's also nicer for viewers. So I turned it off in the output options and reverted back the toggles on the hotspots.

However, using the toggle autorotate in the menu just starts a default rotation, too fast for my liking and without node change. And I can't find anywhere where I can customise it and make it change nodes.

Can this be done by activating autorotate in the output options, and then somehow NOT have it autorotate on load, but still use those settings when the menu toggle button is clicked?

regards, Frank
Last edited by Frankster69 on Mon Dec 16, 2019 1:53 am, edited 1 time in total.
User avatar
Hopki
Gnome
Posts: 9924
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Sat Dec 14, 2019 9:50 am

Hi Frank,
I am currently away and on a phone.
But what you can do is have a true false variable.
Then give the auto rotate button the toggle variable action as well as toggle rotation.

So when auto rotate is on the variable is true and when it’s off it’s false.

Then in the hotspot you add your actions but use an action filter that the actions only work when the variable is true.

If you need more help with this let me know, when I’m back later I can put together a little project but this is how I would do it.
Regards,
Hopki
Frankster69
Posts: 76
Joined: Mon Sep 18, 2017 12:54 pm

Sat Dec 14, 2019 10:21 am

Hello Hopki,

I think I can follow that, I haven't worked much with variables. I will try to work with that tomorrow and let you know if I solved it :)

regards, Frank
Frankster69
Posts: 76
Joined: Mon Sep 18, 2017 12:54 pm

Sun Dec 15, 2019 3:51 am

Hello Hopki,

I've tried to follow your lead, and I'm still having an issue I can't pinpoint. I've emailed you a Dropbox link to a zip with a 2-image project with the skin I'm editing.

I started by creating a variable 'rotate_var' that can be true or false, and gave it the default of true. I checked the 'exposed' checkbox too.

I could not find a 'toggle variable' action, so I split it up in (in that exact order, if it matters):
- Set variable value to 'false' if the value is 'true'
- Set variable value to 'true' if the value is 'false'
This is added to the Autorotate folder actions in the Controller folder.

To ht_node I added 'Mouse enter>Toggle autorotate' and 'Mouse leave>Toggle autorotate', both with filter 'if rotate_var=true'

On first sight, this works: If I open the project in localhost, autorotate starts and the variable is true. Hovering over the chevron (mouse enter) stops the autorotate, I can see the button in the controller changing too. Leaving (mouse leave) the chevron resumes autorotate. That is how it should work.

BUT...

If I manually stop autorotate via the toggle-button in the controller and then again hover over the chevron it RESUMES autorotation which it should not do. Even though, as I think it should with this code, clicking the button in the controller should set the variable to 'false' and the hovering over the chevron should only toggle autorotate if the variable is 'true'.

If the autorotation is stopped via the controller, hovering should not start it again.

I am inclined to think it's the controller code. I think maybe the mouseclick does BOTH actions? I tried switching the order of them, I tried putting the mouse-click toggle variable actions on the rotate svg images... I never get it to behave as I want. Either hovering over the chevron resumes rotation, or (if rotation is started manually via the controller) hovering over the chevron does nothing and it keeps rotating.

What am I missing here? See my email to support@ggnome.com

Any help appreciated!

regards, Frank
Frankster69
Posts: 76
Joined: Mon Sep 18, 2017 12:54 pm

Mon Dec 16, 2019 1:53 am

SOLVED IT! :D :D :D

Your tutorial videos gave me the idea to create a textfield reflecting the state of the variable. After doing that I found clicking the autorotate buttons did not toggle the value, which it should.

Turns out the double action (on the autorotate buttons folder) I used to simulate a toggle as you suggested (which I couldn't find so I improvised) is just canceling itself. If the var is true, it sets it to false, and then also because it's now false it sets itself (back) to true.

I've now separated the actions on the start and stop images, so if the start image is clicked, var is set to true, and if the stop button is clicked the var is set to false. Since only one button is visible at one time, this works!

I had tried that before and that didn't work then, but it turns out in that skin I forgot to delete the actions from the button folder.

All that was left is to assign toggle autorotate actions on mouse enter/leave if var is true to all hotspots. Now it works well: if autorotate is on, mouse-over any hotspot pauzes autorotate, and if autorotate is off it stays off on mouse-over.

Thanks for the tip, using a variable made it work!

regards, Frank
User avatar
Hopki
Gnome
Posts: 9924
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Mon Dec 16, 2019 11:15 am

Hi Frank,
In the Hotspot Template, I changed the two Toggle actions you have for the AutoRotate.
They are now:
Mouse Enter, Stop Autorotate
Mouse Leave, Start Autoroute
The action filters were good and no need to change anything there.

The other problem was your auto-rotate button was not toggling the variable.
I removed your two actions, Mouse Click, Set Variable Value, Set(=)/false and Mouse Click, Set Variable Value, Set(=)/true.
And used just one: Mouse Click, Set Variable Value, Not(¬), rotate_var.

The Operation: Not(¬) is a toggle, so each click toggles the variable from true to false and back.
With this done the project works ok.

Regards
Hopki
Frankster69
Posts: 76
Joined: Mon Sep 18, 2017 12:54 pm

Mon Dec 16, 2019 12:18 pm

Hello Hopki,

Aahh, Not (-) is a toggle! That I didn't know, thanks!

In the hotspot template I left it at two Toggle actions though. Using Start autorotate only starts an autorotate, defined with speed/delay in the action, it is not starting the autorotate that is set in the output options, where you can configure it to change nodes after x seconds.

I want the tour to be able to run as a kind of movie, stepping through all the nodes. Not just rotate a single pano at infinity. The options in the output can do that, but the options in the skin actions cannot.

Is it possible to add this to the actions? So if you select Start Autorotate as action, you can also set it to change nodes after x seconds?

It works now! I figured much of it out already (see the post before your answer) but I didn't know about the Not (-) being a toggle, so I've fixed that too now. Many thanks!

regards, Frank
Post Reply