Combine variables and text to make URL

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
User avatar
Isaac Brown
Posts: 60
Joined: Tue Jun 13, 2017 12:55 pm
Location: Australia

Thu Apr 09, 2020 8:19 am

Hey all, I hope you are well and safe.

I've done this before but can't remember how I got it to work.

On mouse click I want to Open next panorama I am adding a URL based on variables:

panorama_$(*panoLevel)_white_$(*panoLocation)

So as you can see I am combining text/string with variables to build the URL. It isnt working and I think I need to wrap the whole URL in brackets, I cant work out the right way. I know its possible, im certain i've done this before.

Thanks in advance.
Isaac
IBCreative
User avatar
Isaac Brown
Posts: 60
Joined: Tue Jun 13, 2017 12:55 pm
Location: Australia

Fri Apr 10, 2020 12:03 am

I remembered how I did this previously:
I used placeholders and text wrapped in {} brackets to create the Go To URL string. The placeholders were picked up from each nodes User Data.

This time I was trying to use variables instead of placeholders. It doesn't look like variables are supported in this way?

Using User Data placeholders is okay. However I was trying to avoid using User Data by instead dynamically changing variables depending on the tags assigned to the node.

I chose not to use the User Data because this always feels like a bit of a hack to me, for example: I would put information in the "Copyright" User Data field that has nothing to do with the copyright of the image, but instead what ever information I needed for the skin to function, ie: "night" or "existing conditions". There is also a limited amount of user data fields at my disposal.

Something I would benefit from is is there could be a number (or preferably an unlimited amount, with new rows added with a + icon) of "custom fields" in each nodes user data. This could be referenced in the skin as $(cf1) $(cf2) and so forth. This way I could give my custom field a relevant name and content.

Anyway, I found the workaround, does anyone else see the value in Custom Fields?
Isaac
IBCreative
User avatar
Hopki
Gnome
Posts: 10165
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Sat Apr 11, 2020 10:56 am

Hi,
You can use a variable in the Open Next Next Panorama action.
As an example if you had a text variable called “var_node” and you entered “node1” into the variable.

You would use:

{$(*var_node)}
This would open node one.

Regards,
Hopki
Garden Gnome Software 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
Isaac Brown
Posts: 60
Joined: Tue Jun 13, 2017 12:55 pm
Location: Australia

Sat Apr 11, 2020 11:08 pm

Thanks Hopki, but can I combine a variable and a text string to make the URL?

Let me know if I’m not explaining clearly enough.
Isaac
IBCreative
User avatar
Hopki
Gnome
Posts: 10165
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Tue Apr 14, 2020 4:34 pm

Hi Isaac,
You can use a text variable in a URL string.
In the attached project use the Skin Configuration button to enter a URL, for example, https://ggnome.com
Then build the output.
When you click the open website button it will read the variable and open the website.
Now click the change URL button, this set a new URL to the variable, now click the same Open URL button and it will now open a new website.
Regards,
Attachments
isaac.zip
(13.74 KiB) Downloaded 12 times
Hopki
Garden Gnome Software 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
Isaac Brown
Posts: 60
Joined: Tue Jun 13, 2017 12:55 pm
Location: Australia

Wed Apr 15, 2020 12:06 am

Hi Hopki, thanks for your time on this. What you have provided in the test project works as expected.
I mustn't be explaining my requirement clearly enough. Let me go through my scenario.

I have 3D generated panoramas. Each panorama "level" has different "modes" such as rendered, white model, conceptual model etc. The panorama $(ut)'s are named in the following way:

panorama_aerial_white_01

panorama_ = a simple prefix that doesn't have a purpose other than letting me know this image is a panorama.
aerial = $(*level) = level (aerial, ground etc)
white = $(*mode) = mode (rendered, white, conceptual)
01 = location $(*location) = panorama number (01 through to 06)

I am trying to define each of the 4 items above as variables, as an alternative to using the user data fields (to keep the tour nice and tidy and contained inside the skin where possible). This way I am hoping to simply swap out which variable I need to create a new Go To URL value.

Example 1: Changing a mode of the current panorama

Let's say I am on the panorama called panorama_aerial_rendered_01 and I want to change to the white version of this panorama my go to URL could look like this: panorama_$(*level)_white_($*location) where I have used all the existing variables but used the wording "_white" to make the change

Example 2: Going to a new panorama:

Let's say I am on the panorama called panorama_aerial_rendered_01 and want to go to location 02, I could create this URL on mouse click: panorama_(*$level)_(*$white)_02.

By using variables to generate the Go To URL this would significantly reduce the work required to make my skin function how I need it to.

Workaround:
I have managed to get this working with userdata but am hoping to do this with variables instead.

Thanks again Hopki
Isaac
IBCreative
Post Reply