You are not logged in.

1

Friday, June 28th 2019, 1:42pm

Custom Plugin Action not called

Dear Krpano Team,
I seem to have made an error in my custom plugin, but could also not find a working example elsewhere in the internet. I suppose the mistake is obvious and hope one of you could point me to it with a few lines:
https://stackoverflow.com/questions/5680…nown-registered
In a nutshell:
I use

Source code

1
2
3
4
5
6
7
8
9
10
11
local.registerplugin = function(krpanointerface, pluginpath, pluginobject) {
        // get the krpano interface and the plugin object
        krpano = krpanointerface;
        plugin = pluginobject;

        // first - say hello
        krpano.trace(1, "Bridge Plugin loaded: [" + plugin.name + "]");

        // add plugin action (the attribute needs to be lowercase!)
        plugin.jsbmodal = action_jsbmodal;
    };

And try to call it via hotspot onclick

Source code

1
2
3
4
5
<hotspot  name="hotspot_171" style="link_hs_sm"  url="%CURRENTXML%/add_hotspot/picture/icon-text.png" distorted="true" alpha="1" capture="true" depth="1000" flying="0" handcursor="true" zorder="5" zoom="false"
            ath="160.8416" atv="-37.4461" width="50" height="prop" rx="0" ry="0" rz="0" ox="0" oy="0" rotate="0" scale="1" edge="center"
            install_onclick="3" name_hs="hotspot_171" scene_EL="scene_8" info_Ah="add_hotspot/text/leipzig-test.html" fov_EL="140" enabled2="true" visible2="true" drag_hs="true"
            onclick="jsbmodal('om')"
        />

But only get: WARNING: Unknown action: jsbmodal

Thx a lot for some insight on this!
Maybe also the documentation could be updated a bit to make more clear, how the "dosomething" example action is used lateron in the xml?
Thx a lot!
Andreas

light_line

Trainee

Posts: 75

Occupation: krpano freelancer || creating ideas & coding them || krpano developer

  • Send private message

2

Saturday, June 29th 2019, 3:44pm

try this :
onclick="plugin[YOUR_PLUGIN_NAME].jsbmodal('om')"

3

Saturday, June 29th 2019, 5:40pm

instead of (or additional to) plugin.jsbmodal = action_jsbmodal;
you can use krpano.actions.jsbmodal = action_jsbmodal;

then you can call jsbmodal() directly from action code

4

Tuesday, July 2nd 2019, 12:25am

Gentlemen, thx a lot! This is it :D