Set Variable Value with Direct Node Access

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
User avatar
Hopki
Gnome
Posts: 10977
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Sun Jan 10, 2021 11:35 pm

Hi,
Here's a project I have been wanting to show for a while.
This uses Direct Node Access to affect a variable, so you add a value to the end of a URL which can then be used to affect the output.

In this example, the first URL shows a simple panorama with a title.
https://support.ggno.me/forum_projects/ ... index.html

The next URL is the same project but now uses the direct access parameters with the value on the end.
https://support.ggno.me/forum_projects/ ... 70,4,robot
The value "robot" is used as a variable value in the skin.
This value adds an external image loader with a link URL to a wiki page, background rectangle, and change the page title.
This also moves the border to the right by 100px and then enters the title text.

The next URL: https://support.ggno.me/forum_projects/ ... 4,computer
This changes the variable value to "computer".
This changes the image, URL, and title.

The project requires Direct Node Access for it to work, so for a single node project you need to add the panorama twice so the project has two nodes, then you can remove the second one.
This fools the project file that it is a multi-node tour so enable Direct Node Access.

How to use:
You need to copy and add the ExtValue.ggt to your project file and select the template under the HTML tab of the HTML5 output or add it to Pano2VR's templates folder if you will use it often.

The variable needs the name: ExtValue, this has to be a text variable.
You can then use this variable in the skin like any other variable. You can even use this to change languages.

The URL needs to end with the node, pan, tilt, FoV, then the projection, and then the value.
So for example: #node1,0,0,70,4,robot

In order:
- #node1, this is the opening node, so could be #node3 for example if node three needs to be the opening node
- 0 is the pan value
- 0 is the tilt value
- 70 is the field of view value
- 4 is the projection, Rectilinear, 9 would be Stereographic
- robot is the variable value the project is using along with computer

Regards,
Attachments
ExtValue.zip
(315.41 KiB) Downloaded 48 times
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
User avatar
Hopki
Gnome
Posts: 10977
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Mon Jan 11, 2021 3:19 pm

Hi,
Please find attached a modified template, thanks to Christoph (Gnome).
Also changed the name to CustomValue.ggt

Looking at the last project the URL looked a bit ugly having to include the node, view, and projection.
This new template only needs the value, so as an example, index.html#robot
Also, this works with a single node project.

To recap you need to copy the CustomeValue.ggt to your project folder or add it to the Pano2VR templates directory, but in either case, make sure it's selected under the HTML5 outputs HTML tab. Using the Edit Template button make sure that in the templates setting Custome Value is selected.

In the skin, you need to add a TEXT Variable with the name ExtValue.

To test, add a text box to your skin and set it to display the text variable, $(*ExtValue).
This will now display any value you enter at the end of the URL.

As an example, if you added #blue after .html without any spaces, the text box will display "blue".
Regards,
Attachments
CustomValue.ggt
(5.69 KiB) Downloaded 8 times
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
deedee123
Posts: 97
Joined: Wed May 20, 2020 10:38 am

Mon Jan 11, 2021 5:21 pm

that's interesting, does it also work with node + the variable (without adding angle numbers?)
david
User avatar
Hopki
Gnome
Posts: 10977
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Mon Jan 11, 2021 5:24 pm

Hi david,
Sorry no, if you need the node then you will need to use the first template.
The idea of the second one is if people want to select the language, so a text variable, en or de, for example.
Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
deedee123
Posts: 97
Joined: Wed May 20, 2020 10:38 am

Mon Jan 11, 2021 5:46 pm

Hi,
thanks for the quick reply,

I understand, that's a good thing. i've been wanting a way to hide my splash screen when coming from an external link (and keep direct node access), this should make it possible (with only drawback is i need to fill out the angle numbers too although they are not strictly needed for the purpose)
thanks,
David
Post Reply