How to hide an specific thumbnail?

  • I've been digging everywhere and trying everything. Nothing is working properly.
    When I hide the thumbs, then I receive errors. It's a simple task, I don't know why is so complicated.

    Can someone point me in the right direction? Once again, I tried all the suggestions that I found in the forum.

  • Easiest is to remove scene for which you don't want thumb to to displayed, in case you don't need this scene at all.

    If you want to keep the scene but not to have thumb for it than it is more complicated:
    - You have to add attribute to scene e.g. include_thumb="true" or "false" for that you dont want to be in the thumbs listed

    Code
    <scene name="yourscenename" include_thumb ="true".....

    - than you have to adapt skin_addthumbs

    Code
    set(number_of_used_scenes,0);
    	  for(set(i,0), i LT scene.count, inc(i),
          if(scene[get(i)].include_thumb , inc(number_of_used_scenes););
        );


    This is needed to have number of those matching your attribute true to be able to define correct width of the skin_thumbs layer:

    Code
    add(thumbxoffset, thumbwidth, thumbpadding);
    		mul(thumbxcenter, thumbxoffset, 0.5);
    		mul(thumbbarwidth, thumbxoffset, get(number_of_used_scenes));

    Here is where width is set later on (no change needed there, jut for you to know why we are changing calculation):

    Code
    copy(layer[skin_thumbs].width, thumbbarwidth);

    Than before lopp is started make some new variables e.g.:

    Code
    set(number_of_active_thumbs,0);
    		set(adding_thumbs_from_zerro,0);
    		for(set(i,0), i LT scene.count, inc(i),


    Than some changes are needed:

    Code
    for(set(i,0), i LT scene.count, inc(i),			      		
          if(scene[get(i)].include_thumb,      
              inc(number_of_active_thumbs);
              txtadd(thumbname,'skin_thumb_',get(adding_thumbs_from_zerro));
    Code
    mul(thumbx, adding_thumbs_from_zerro, thumbxoffset);
    Code
    if(skin_settings.thumbs_text,    				
        				txtadd(thumbtext, 'skin_thumbtext_', get(adding_thumbs_from_zerro));

    Before closing IF statemets add:

    Code
    inc(adding_thumbs_from_zerro);
     );
    );

    And that's all. Have included lines that need change to default generated code for you to know where changes are needed. This all valid if you use make vtour droplet and use generated code out of it.

  • Hi Umalo,

    It worked, it now only displays thumbnails for scenes where include_thumbs="true"
    But the Thumb Border is is always sticking to the next scene in advance rather than sticking to the current scene being viewed, and if you go to the last shown thumbnail the thumb Border goes to the upper left part of the screen and you get the No Parent "skin_thumb" found. Is there a fix for this please?

    For others, to save your time, I've compiled Umalo's codes above. So here's the updated skin_addthumbs action just replace the one in your vtourskin.xml file:


    <action name="skin_addthumbs">
    set(number_of_used_scenes,0);
    for(set(i,0), i LT scene.count, inc(i),
    if(scene[get(i)].include_thumb , inc(number_of_used_scenes););
    );

    copy(thumbwidth, skin_settings.thumbs_width);
    copy(thumbheight, skin_settings.thumbs_height);
    copy(thumbpadding, skin_settings.thumbs_padding);
    copy(thumbcrop, skin_settings.thumbs_crop);

    if(device.mobile,
    mul(thumbwidth,2);
    mul(thumbheight,2);
    mul(thumbpadding,2);
    );

    add(thumbxoffset, thumbwidth, thumbpadding);
    mul(thumbxcenter, thumbxoffset, 0.5);
    mul(thumbbarwidth, thumbxoffset, get(number_of_used_scenes));
    add(thumbbarwidth, thumbpadding);
    add(thumbbarheight, thumbpadding, thumbheight);
    add(thumbbarheight, thumbpadding);

    if (skin_settings.thumbs_scrollindicator,
    copy(layer[skin_thumbs_scrollindicator].y, thumbbarheight);
    add(thumbbarheight, layer[skin_thumbs_scrollindicator].height);
    );

    copy(layer[skin_thumbs].height, thumbbarheight);
    copy(layer[skin_thumbs].width, thumbbarwidth);

    mul(halfheight, thumbbarheight, 0.5);
    copy(layer[skin_thumbs_scrollleft].y, halfheight);
    copy(layer[skin_thumbs_scrollright].y, halfheight);

    set(number_of_active_thumbs,0);
    set(adding_thumbs_from_zerro,0);
    for(set(i,0), i LT scene.count, inc(i),
    if(scene[get(i)].include_thumb,
    inc(number_of_active_thumbs);
    txtadd(thumbname,'skin_thumb_',get(adding_thumbs_from_zerro));
    addlayer(get(thumbname));
    copy(layer[get(thumbname)].url, scene[get(i)].thumburl);
    set(layer[get(thumbname)].keep, true);
    set(layer[get(thumbname)].parent, 'skin_thumbs');
    set(layer[get(thumbname)].align, lefttop);
    copy(layer[get(thumbname)].crop, thumbcrop);
    copy(layer[get(thumbname)].width, thumbwidth);
    copy(layer[get(thumbname)].height, thumbheight);
    mul(thumbx, adding_thumbs_from_zerro, thumbxoffset);
    add(thumbx, thumbpadding);
    copy(layer[get(thumbname)].x, thumbx);
    copy(layer[get(thumbname)].y, thumbpadding);
    add(scene[get(i)].thumbx, thumbx, thumbxcenter);
    copy(scene[get(i)].thumby, thumbpadding);
    set(layer[get(thumbname)].linkedscene, get(scene[get(i)].name) );
    set(layer[get(thumbname)].onclick, copy(layer[skin_thumbborder].parent, name); loadscene(get(linkedscene), null, MERGE, BLEND(0.5)); );
    if(skin_settings.tooltips_thumbs,
    set(layer[get(thumbname)].tooltip, get(scene[get(i)].title) );
    layer[get(thumbname)].loadstyle(skin_tooltips);
    );
    if(skin_settings.thumbs_text,
    txtadd(thumbtext, 'skin_thumbtext_', get(adding_thumbs_from_zerro));
    inc(adding_thumbs_from_zerro);
    );
    );
    addlayer(get(thumbtext));
    layer[get(thumbtext)].loadstyle(skin_thumbtext_style);
    set(layer[get(thumbtext)].keep, true);
    set(layer[get(thumbtext)].parent, get(thumbname));
    set(layer[get(thumbtext)].html, get(scene[get(i)].title));
    );
    </action>

  • Thanks Umalo for your example & code. It's working if you are completely hiding those scenes.
    The difference between your example and mine is that you are not showing the hidden scenes at all, and mine is.
    The white border of the selected thumb is randomly appearing over the wrong thumb and sometimes in the top left corner of the screen. Is there any way to force it to appear over some specific thumb?
    Something like:
    if the scene3 is showing, then put the white border over the thumb representing the scene4.

    Test page: http://your360virtual.com/bigsteelbox2/tour.html

  • Catch is that you missed to update significant part of your code. Simple compare of vtourskin.xml from my example and yours is revealing that you correctly updated skin_addthumbs action but missed to update: skin_updatescroll (index -> newindex), complete skin_update_scene_infos is reworked to support thumb exclusion. Additionaly new have to update: skin_nextscene and add new action find_next_scene.

    Border is not appearing randomly but exactly as your code is telling him to do. Update above mentioned actions and you will have proper thumbborder appearance.

    My code is not hiding scenes. Maybe I was not clear on how to call it, but it does just not display thumbs from scenes you don't want to be in the list.
    If you still want to use some of scenes where thumbs are excluded than there is a decision to be made: what to do with thumbborder if scene is defined to not use thumbs and what to do with next/previous scene in that case.

    I made extension of the code to support also linking (by hotspots) to such a scenes.
    Follow this link to have all at one place.
    regards
    Umalo

  • Thanks Umalo. It's finally working but I had to delete the original plugins folder, and the files tour.swf & tour.js then replace them with your files.
    I have a question: Where should I place a conditional to show the white border over some specific thumb? The hidden scenes are the same scenes but with a different POV. There are 2 way to go inside the bathroom but the POVs are different.

    I am thinking on something like: if the scene3 is selected through a hotspot, then put the white border over the thumb representing the scene4.

  • you should't replace your files with mine as my contains my license. Anyway you still have some code inconsistencies like click on map is triggering non existing action: closemap
    Still not sure what you are talking about with doubled scenes? If one of two same scenes is "hidden" and to go to one of them is only possible via hotspots why you simple don't define hlookat, vlookatand fov directly in this scene.
    I'm not fan of not needed IF in the code. Imagine you have 100+ panos and you have to deal with all that conditions...
    I have another system for setting hlookat, vlookat and fov based on previous scene but this is out the the topic now.
    regards
    Umalo

  • Thanks Umalo. I am using the last krpano version, and your example is using a lower version. When I used your files, I was just trying to find the source of the problem. It looks like was a glitch with FileZilla transferring my files.
    I know there is not a closemap action yet, I am still working in the design of the floor plan. One step after another one.
    If I have to deal with 100+ panos definitely the conditional won't be the best way to go, but I have only 6.

    Thanks for everything! *thumbsup*

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!