Sie sind nicht angemeldet.

1

Mittwoch, 6. April 2022, 12:38

ERROR: loadscene() - scene "..." not found

Guys, hi

just stuck on the basic stuff. Can't debug.

version of krpano 1.20.10 (build 2021-10-01)
and / or
version of krpano 1.20.11 (build 2022-03-07)
running on MAMP local mac server
Brave Version 1.37.109 Chromium: 100.0.4896.60 (Official Build) (x86_64)
and / or
Chrome Version 99.0.4844.84 (Official Build) (x86_64)

Fun that the file with scenes loaded by include, and 0 scene is loaded. As usual with:

Quellcode

1
2
3
4
...
if(startscene === null OR !scene[get(startscene)], copy(startscene,scene[0].name););
loadscene(get(startscene), null, MERGE, LIGHTBLEND(0.77, 0xFFFFFF, 2.0 easeincubic));
...

But than simple loadscene() action just fall down with:

Quellcode

1
2
3
...
onclick="loadscene(scene_NameOfTheScene);"
...

Zitat

ERROR: loadscene() - scene "scene_NameOfTheScene" not found



Even if tried load the same 0 scene again, which already loaded, error comes up..

Quellcode

1
2
3
...
onclick="loadscene(get(scene[0].name));"
...


Did some action which trace list of scene and load some scene. Scene name given as parameter to test_scene_load() action. So whole scene names printed, but same error. So action can see the scenes and their names but loadscene() can't.
Tried to convert scene name tolower() before loadscene() the same error.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
<action name="test_scene_load">
        trace("TEST LOADSCENE");
        trace(%1);
        set(lowcase_scene_name, %1);
        tolower(lowcase_scene_name);
        trace(lowcase_scene_name);
        loadscene(get(scene[%1].name));
        loadscene(%1);  
        loadscene(get(lowcase_scene_name));
        for(set(sc_no, 0), sc_no LT scene.count, inc(sc_no),
            trace(get(scene[get(sc_no)].name));
        );
</action>


Tried delete startscene at the end of startup() action:

Quellcode

1
2
3
...
        delete(startscene);
</action>



How it's even possible?
How else to debug?

Any guess please.

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

2

Mittwoch, 6. April 2022, 13:36

Hi

Can you paste the tour.xml file or its contents. It can also be a link.


Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

3

Donnerstag, 7. April 2022, 10:27

Piotr,
thank you for asking.

Just found the line which responsible for that error. So it is last line in the startup action:

Quellcode

1
2
3
...
    set(global, variable:string='string value');
</action>


Fun thing is I created this string variable just for debug mode only. So it's contains just '|' sign and four spaces in ascii code. I used it to make traced INFO: looks a bit more readable)

set(global, variable:string='| ');

ascii code works fine, btw
Can't put ascii in here without replacing)

Anyway the issue is not ascii, checked.

So tried do define global variable before loading startscene.
startscene doesn't load at all.

If define global variable after loading startscene.
And try load new scene with loadscene()
We'll have this missed scene error:

Zitat

ERROR: loadscene() - scene "scene_NameOfTheScene" not found

Seems like a bug, huh?
Or is it something wrong with defining global variables in startup action, please?

4

Donnerstag, 7. April 2022, 10:36

set(global, variable:string='| ');
Or is it something wrong with defining global variables in startup action, please?

where did you find this syntax ? *huh*

if your action has no scope, then every variable is global.
set(variablename, 123); // is global

if your action has a scope (eg scope="local") then you would use
set(global.variablename, 123);

https://krpano.com/docu/xml/#action.normal
https://krpano.com/docu/xml/#action.scope

to define a variable with type
https://krpano.com/docu/actions/#def

5

Donnerstag, 7. April 2022, 11:43

Thank you, indexofrefraction.

Zitat

where did you find this syntax ? *huh*

Here https://krpano.com/docu/actions/#set
in an example area)

Quellcode

1
2
3
4
5
6
set(global,
    test='Test text',
    havesomething:boolean=true,
    var2:string=get(var1),
    value:number=calc(1 + 2*3)
);


Zitat

if your action has no scope, then every variable is global.

Great to know, thank you. Get used to python's functions behavior...


Yeah, as in manual https://krpano.com/docu/xml/#action.scope

Zitat

global or not set (the default)
  • New variables will be added to the global variable scope.
  • ...


Thank you, guys!
 

6

Donnerstag, 7. April 2022, 11:49

Zitat

Here https://krpano.com/docu/actions/#set
in an example area)

ah ok, i didn't know this shortcut... tx *squint*