Set Variable Value with Direct Node Access

Special forum to share and discuss skins for Pano2VR and Object2VR
User avatar
Hopki
Gnome
Posts: 12343
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.ggt
(8.06 KiB) Downloaded 28 times
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: 12343
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
(6.5 KiB) Downloaded 205 times
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: 240
Joined: Wed May 20, 2020 10:38 am
Location: NL

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: 12343
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,
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: 240
Joined: Wed May 20, 2020 10:38 am
Location: NL

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
SAwity
Posts: 28
Joined: Fri Sep 07, 2018 9:38 am

Mon Jan 18, 2021 4:50 pm

Hopki wrote:
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.

Regards,
Hi Hopki, is there a way to use this to change the preview image shown when sharing direct nodes? So that When i share on social, the preview image for the start node is different from say Node02 and so on.
User avatar
Hopki
Gnome
Posts: 12343
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Mon Jan 18, 2021 11:27 pm

Hi,
You can do this with a node image in a cloner to generate preview images in the images folder.
Then you can use a config loaded action to load and image, if you have many actions loading the preview image for all nodes, you can then use the variable to use in an action filter to select which node should be selected.
Regards,
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/
NOVOSELOV
Posts: 7
Joined: Thu Apr 30, 2020 2:53 pm

Thu Nov 04, 2021 11:07 am

Hi, is it possible to set Variable Value for a string? I mean something like www.site.com/index.html#"Max Mustermann"
Or i should make a logic for every value? My client want to make a "customozible" intro text for 100+ different names.
and a 2. is it possible to add a second ExtValue?
Thanks!
User avatar
Hopki
Gnome
Posts: 12343
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Thu Nov 04, 2021 2:07 pm

Hi NOVOSELOV,
The template allows one variable.
But it's a text variable so used with an Action Filter it can be used to trigger many things.
For example, used with a Variable Changed source action and an action filter, you can do many things.
Or in logic blocks change text depending on the variable value.
Regards,
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: 240
Joined: Wed May 20, 2020 10:38 am
Location: NL

Tue May 24, 2022 3:27 pm

Hi,
I try to update this for V7, it seems some VR skin loading script lines are new, but i cant get it to load the project.. i see the skin but the panorama doesn't show. can this pass value be adapted?
Hints appreciated :)
best,
David
User avatar
Hopki
Gnome
Posts: 12343
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Tue Jul 19, 2022 3:31 pm

Hi David,
The ExtValue.ggt has been updated and now works with V7.
The CustomValue.ggt still worked ok with V7.
Regards,
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: 240
Joined: Wed May 20, 2020 10:38 am
Location: NL

Mon Jul 25, 2022 12:03 pm

perfect! thanks!
david
the.focus.farm
Posts: 11
Joined: Tue Nov 17, 2020 11:20 am
Location: Singapore

Sat Jul 30, 2022 7:36 am

This is a great post, Hopki !
Thank You so much.
the.focus.farm
Posts: 11
Joined: Tue Nov 17, 2020 11:20 am
Location: Singapore

Sat Jul 30, 2022 7:37 am

Hopki wrote:
Thu Nov 04, 2021 2:07 pm
Hi NOVOSELOV,
The template allows one variable.
But its a text variable so using with an Action Filter it can be used to trigger many things.
For example used with a Variable Changed source action and an action filter you can do many things.
Or in logic blocks change text depending on the variable value.
Regards,
Yes ! Great.
deedee123
Posts: 240
Joined: Wed May 20, 2020 10:38 am
Location: NL

Fri Aug 12, 2022 12:42 pm

oops i now noticed this new "extvalue.ggt" breaks the connection to the VR skin used in V7...
Any way to fix that?
best,
David
Post Reply