Questions about polygon hotspots in O2VR

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
User avatar
jobes
Posts: 87
Joined: Fri Mar 07, 2008 2:34 am
Contact:

I've previously used point or area hotspots for projects. However I am trying to make my work more future-proof and follow best practice by using poly hotspots instead. However I have run into a few differences in the way I can use them, and can't find answers to this in the documentation.

First question: how can I move a whole poly hotspot from frame to frame eg one column to another in one go? If i draw a square poly (with 4 anchor dots) at the moment I have to labouriously move each of those into a new position if I am playing it over an element on an object (eg a badge on an object). This is interminable for multiple frames… is there a keyboard modifier or other tool for selecting all points on the poly and dragging/repositioning the whole thing?

Second: is there a way of removing a poly from some frame in a rotation? Think about a label on the front of a can… it is occluded (obscured) for some frames so I do not want the hotspot to be shown. I can do this will points or area hotspots no problems, but can't seem to work out how to remove poly shapes from just certain frames / columns.

Thanks in advance
User avatar
jobes
Posts: 87
Joined: Fri Mar 07, 2008 2:34 am
Contact:

Conversely, is there an easy or elegant way to copy the positions of point hotspots from one state to another? There's no checkbox to facilitate this, unlike with polygon hotspots, and it would be very useful. Thanks in advance
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi jobes,
There is a bug listing for reusing point hotspots the same way you can with polys so the dev’s are already on it.

Point hotspots can show a hint so you can see where the previous one was placed so you can avoid the point hotspot from moving up and down when rotating, but this said I find it hard to see and have put in a request for it to be more visible.

Getting back to the poly, I have put in a feature request covering what you are asking, please see Issue #1217
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/
User avatar
jobes
Posts: 87
Joined: Fri Mar 07, 2008 2:34 am
Contact:

Cheers Hopki, I'm glad I wasn't missing anything obvious, and that those comments are being addressed. Looks like I'll have to hang tight and do some manual point positioning…

Do you think there is a way of hacking the .o2vr file in a text editor to apply point hotspots for different states? I reckon it'd save me many hours of work if I could…
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Jobes,
Yep, open the *.o2vr file with a text editor and look for the opening tag: <hotspot> it will be somewhere near the bottom of the code. The give away is the numbers in brackets which are the locations of the polygon nodes.

You will then find something similar to:

<type>poly</type>
<id>Poly01</id>
<reusecolumn>0</reusecolumn>
<reuserow>0</reuserow>
<reusestate>0</reusestate>
<polyitem>
<column>0</column>
<row>0</row>
<state>0</state>
<polygons>(2440,1160)(2533,1093)(2726,1073)(2866,1106)(2946,1186)(2953,1313)(2693,1393)(2493,1366)(2360,1300)</polygons>
</polyitem>

You can copy and paste the section starting with <polyitem> and just change column to 1, then 2 etc.
one complete poly hotspot will look like something like this:

<polyitem>
<column>0</column>
<row>0</row>
<state>0</state>
<polygons>(2440,1160)(2533,1093)(2726,1073)(2866,1106)(2946,1186)(2953,1313)(2693,1393)(2493,1366)(2360,1300)</polygons>
</polyitem>

This will copy the poly to the required column, then you can click to make changes to the shape of it.
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/
User avatar
jobes
Posts: 87
Joined: Fri Mar 07, 2008 2:34 am
Contact:

Ta, that fits with what I have been experimenting with this morning too. I reckon a bit of GREP will beat hours of repositioning, once I can sort out the exact details :)
User avatar
jobes
Posts: 87
Joined: Fri Mar 07, 2008 2:34 am
Contact:

Ok, I can confirm manually code wrangling does work, exactly as hoped/planned!

Basically I have 8 point hotspots aligned, pixel-perfect, to an object. The object has 144 images per viewstate (4 rows, 36 columns). I needed them to be exactly aligned for 4 different view states. Having manually placed almost 1000 point hotspots for one view state, I was loathe to do more.

After a bit of R&D based on the above comments I found a method for ensuring the same positions for each hotspot, across each state. I used the free text editor Textwrangler, but any good code editor should be suitable (as long as it has good find/replace functions and displays line numbers) In this case I'm replacing point hotspots, but the method will apply for all types.
  • Open your O2VR file in a text editor (ideally use a copy for safety)
    Identify each hotspot - best thing is to search for <hotspot> tag; display each, and scroll between these, using line numbers as reference
    Copy/paste everything between 1st and last <pointitem> for each hotspot into new document. In my case this is view state 0
    Save this for safety before any further work(e.g. hs1 before editing.xml)
    Save a copy with an obvious name such as hs1_state1
    Do a global find & relace, changing state from <state>0</state> to <state>1</state>
    Save and then save a copy with the next state's number. Rinse and repeat…
    Once all 4 states complete, carefully copy/paste each in order back into master file, after the last </pointitem> tag. So you'll go from having a text block with one set of states' code, to 4x blocks (if you have 4x viewstates)
    Save with new filename, and test by reloading into O2VR and checking all hotspots show as expected
This is an order of magnitude faster than manually creating point hotspots for each state (and the co-ords are pixel accurate too, which you could probably never do by eye). I don't think there would be another way I could have contemplated doing this amount of work…

Of course, having a checkbox in the hotspot editor saying 'apply to all states' or similar would replicate this functionality in a split second (as it is with polys) so I hope this will be a feature in the next iteration of my favourite object movie editor :D
Post Reply