get scene name from plugin

  • Hi

    I'm trying to get the scene names form a custom plugin but all I get is the name I set inside the gui but I need the scene name like it's wirtten inside the index.xml file...

    For example my pano's name is C6-1 and the scene name is pano39... with the following code I create a javascript array with all my pano inside a group

    Code
    {% set 0 as countGroups %}{% for group in project.panoGroups %}	{% if group.isExplicit %}group['pano{{group.description.name}}'] = [{{% for pano in group.panos %}'{{countGroups}}':'{{pano.description.name}}',{% set countGroups|plus:1 as countGroups %}{% endfor %}}]{% endif %}{% endfor %}

    I get all my scene name and this is the output

    Code
    group['panogroup47'] = [{'0':'C6-1','1':'C6-2','2':'C6-3','3':'C6-4','4':'C6-5'}]group['panogroup106'] = [{'0':'27','1':'31'}]

    What I really need are the real scene names, so pano39, pano40, pano41 etc

    Does anyone know how do get that?$

    I appreciate any help

    Thank you

  • Hi,

    your code example doesn't seem to be related to krpano,

    but in a krpano plugin you could get the scene names e.g. this way:

    Code
    var scenes = krpano.get("scene").getArray();
    
    
    for (var i=0; i < scenes.length; i++)
    {
      var scene = scenes[i];
      
      console.log(scene.name);
    }

    Best regards,
    Klaus

  • Has the variable changed? I've tried your code and nothing is output at all to the console log apart from the initial output due to console log: true being set on embedpano:

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!