is autoalpha malfunctioning?

  • I'm using krpano 1.20.8

    actually autoalpha works!!
    however i'd like to pointing out the below.

    if i set alpha value on hotspots set autoalpha is true on 'onstart', it's not working that i expected.


    the below doesn't work.

    Code
    <action name='onStartScene' autorun='onstart'>
    	if(scene[get(xml.scene)].hidenadir,  set(hotspot[nadirlogo].alpha, 0);,  set(hotspot[nadirlogo].alpha, 1););</action>


    the below works fine.

    Code
    <action name='onStartScene' autorun='onstart'>
      delayedcall(0.1,    if(scene[get(xml.scene)].hidenadir,      set(hotspot[nadirlogo].alpha, 0);    ,      set(hotspot[nadirlogo].alpha, 1);    ););</action>


    is it malfunctioning? or it's just normal? or a bug?

  • maybe try to use the <scene .... onstart="..." /> action

    yes I already tried that.
    in the scene element and in the 'onstart' attribute, the scene calls an action defined out of the scene (like global) which is manipulating the alpha of hotspots. only for the hotspots having "autoalpha=true" acts like that.

    it's weird.

  • in the scene element and in the 'onstart' attribute, the scene calls an action defined out of the scene (like global) which is manipulating the alpha of hotspots.


    like this ?

    Code
    <action name="onStartScene">...</action>
    <scene .... onstart="onStartScene();" />...</scene>


    you should not use autorun='onstart' in that case !

  • I know that, it's just an example i provided to make someone understand.
    I know that there's an action in scene onstart attribute it won't fire autorun action.

    Sorry for complicated explanation.

    But to make sure,
    I'm just wondering if it's malfunctioning or not.
    that's why i wrote this post.

    You may try that by yourself.
    I will leave some lines as like the below - the example as below;

    If it's working, let me know.
    For some reason, it's not working unless i set it in delayedcall with at least 0.1s delay.
    YES, I also think that I set the alpha of the hotspot before it's actually yet rendered.
    Since that, it is working when setting it in delayedcall with pretty much enough time.


    You may lost my point from somewhere.
    I'm ACTUALLY pointing out it's working only when only setting alpha IN DELAYEDCALL.


  • in such cases just try to debug what happens.
    for example add a debugvar() at the beginning to check if the hotspot exists when onStartScene() is executed

    Code
    <action name="onStartScene">
        debugvar(hotspot[nadirlogo]);
        if(scene[get(xml.scene)].hideonstart,
            set(hotspot[nadirlogo].alpha, 0);
        ,
            set(hotspot[nadirlogo].alpha, 1);
        );
    </action>

    i guess it doesnt.

    an option would be to do the call in the hotspot itself :
    <hotspot name="nadirlogo" onloaded="onStartScene();" ... />

    another option would be a callwhen()
    (delays are always bad, bc you can't know the needed time)

    Code
    <action name="onStartScene">
        callwhen(hotspot[nadirlogo] !== null,
            if(scene[get(xml.scene)].hideonstart,
                set(hotspot[nadirlogo].alpha, 0);
            ,
                set(hotspot[nadirlogo].alpha, 1);
            );
        );
    </action>
  • callwhen() , onloaded attribute call

    Wow. Thank you.

    I've never used callwhen, it's a good chance for me to use the pre defined action.

    And, to use onloaded attribute on the hotspot it self,

    I think you guide me to another level of thinking and approaching.


    I wonder why this happens.
    Now all things are clear.

    Thank you again. *thumbsup* *thumbup*

  • [quote='klaus.krpano','index.php?page=Thread&postID=84518#post84518']Hi,

    about autoalpha - right, there is unfortunately a bug - will be fixed in the next release:
    Hi,

    about autoalpha - right, there is unfortunately a bug - will be fixed in the next release:
    autoalpha ?


    Best regards,
    Klaus
    Alright.
    It happens case by case(project by project) to me.

    For an alternative way, I set visible as well as setting alpha.
    I will be glad if autoalpha's health is back.

    As regards to Klaus,
    Be careful of covid19.

Participate now!

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