How can I change an attribute from another scene that is not the current one?

  • For example I want to

    Code
    trace(scene[notthecurrentscene].image.fov)

    , is that possible?

    I've tried several ways like

    Code
    trace(get(scene[notthecurrentscene].image.fov));
    
    
    trace(scene[notthecurrentscene].image.fov);
    
    
    trace(scene[notthecurrentscene].fov);

    Moreover, I would like to change it's value without having to load the scene like

    Code
    set(scene[notthecurrentscene].image.fov,100);

    ¿IS THIS EVEN POSSIBLE IN KRPANO?

    Thanks!

    Alberto.

  • Well, first observation - it's "view.fov", not "image.fov". And my guess to your question is "no". Because only "view.fov" of the currently loaded scene is parsed and available. You can trace(view.fov); of the currently loaded scene only. However, let's see what Klaus will say - maybe there's some kind of a trick there. *tongue*

    Regards,

    Alexey

  • But here are some thoughts from me *tongue*

    I made a quick test and it seems to work. Here we go with trying to alter the fov setting of another (not currently loaded) scene.

    Step one. Add

    Code
    target_fov="70"

    inside

    Code
    <scene name="your_scene" .... >

    Must look like this:

    Code
    <scene name="scene_8651" title="Бассейн и игровая площадка для детей" target_fov="70" thumburl="panos/8651.tiles/thumb.jpg" >

    now if you trace(scene[ scene_8651].target_fov); you will receive a trace.

    And now try this code in some action:

    Code
    showlog();trace(scene[scene_8651].target_fov);set(scene[scene_8651].target_fov,90);
    		loadscene(scene_8651, null, MERGE);copy(view.fov, scene[scene_8651].target_fov);
    		trace(view.fov);


    So, we trace original value of "target_fov" (70), then set it to 90, then load scene and set view.fov to 90 and then trace that, yeeeessss, its 90.

    this may be a direction to go *wink*

    Regards,

    Alexey

  • That's a pretty smart solution!, hehe, although the real situation in my case is that I want to put a condition in the startup action which makes all the multires attributes (inside all the tour scenes) go FALSE in case the device is old and not powerful enough to support it, something like:

    Code
    If(device.iosversion LT 7.0, set(scene[0].image.multires,false););

    of course it would have to be done through a FOR action i think, or Async FOR (I'm not too clear on the difference), so in a loop it sets all multires attributes to false, but the first thing I need is a way to call externally the multires attribute inside each of the scenes.

    Your solution might come in handy, I have a feeling it will work but still would be interesting and useful to know if there's a way to call attributes so far apart.

    Thanks, Alexey.

    Alberto.

  • Hi,

    iOS 5.1 and iOS 6 should work also fine with multires, only iOS 4 can be problematic, but that's not supported anyway anymore.

    Android stock browsers are way more problematic here.
    Btw - the next krpano version will have several improvements here - Androidstock browsers will not try to use multires by default and there will be several additional possibilities to control device specific settings.

    A note to the initial question - the content inside a <scene> element will not be loaded/parsed until the scene itself gets loaded. This has design and performance reasons. But if required, you can try manipulating the scene content by editing the scene[NAME].content variable - e.g. by a text search and replace with the http://txtreplace action.

    Best regards,
    Klaus

  • I'm trying to disable it as an attempt for our demo to work smoothly on some devices, for the time being it crashes on ipod 4 (ios 6.1) and sometimes on a iphone 4S (ios 7), we thought that it could work, otherwise we are not sure why is this happening, maybe we are over using a plugin or something. I would be so thankful if you could give it a try and perhaps you will find what's making it so slow (or crashy). Thanks to both!

    The demo link is http://www.demo.imagen360.com

  • Hi,

    the iPod devices are generally slower and more instable than their iPhone counterparts and the iPhone 4S is strangely also more instable than the normal iPhone 4.

    In the next krpano version the default limitations (hardwarelimit and maxmem) will be reduced for iPhone 4* devices to provide more stability for the 4S (detecting if 4 or 4S is not possible).

    For the moment you could try adding these code:

    Code
    <display hardwarelimit="800" devices="iphone" />
    <memory maxmem="40" devices="iphone" />

    But this would cover the iPhone 5 and 5S too, where these settings aren't necessary.

    Best regards,
    Klaus

Participate now!

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