Hello
I try to have 2 different shapeDivers in the same page but they are both loading in the same
The objective :
- 1 Viewer in the main page
- 1 Viewer in a pop-up
The code
Main page :
<div class="wpb_wrapper main_wrapper" id="SD_visual">
<span id="project_infos"></span>
<div id='sdv-container' att="<?php echo get_option('ip_frontend_ticket') ?>">
<canvas id="canvas"></canvas>
</div>
</div>
function initSdvApp(){
$('#loading').show();
viewer = SDV.api.createViewer({
canvas: document.getElementById('canvas'),
id: 'myViewer'
}).then(function(viewer) {
});
session = SDV.api.createSession({
ticket: document.getElementById('sdv-container').getAttribute('att'),
modelViewUrl: 'https://sdeuc1.eu-central-1.shapediver.com',
id: 'mySession'
}).then(function(session) {
/************************************
DEFAULT PARAM load into the configurator
********************************************/
SDV.api.sessions.mySession.getParameterByName('Compute Fixations Holes')[0].value = false;
session.customize().then(function(session) {
console.log(session.name);
getOutputs() ;
$('#loading').hide();
});
});
}
Pop-up
<div class="" id="SD_visual_folding">
<span id="folding_infos"></span>
<div id='sdv-container-folding' att="12345">
<canvas id="canvasFolding"></canvas>
</div>
</div>
function initSdvAppFolding(){
//$('#loading').show();
viewerFolding = SDV.api.createViewer({
canvas: document.getElementById('canvasFolding'),
id: 'myViewerFolding'
}).then(function(viewerFolding) {
/************************************
DEFAULT SCENE SETTINGS load into the configurator
********************************************/
console.log("viewer folding");
console.log(viewerFolding);
});
sessionFolding = SDV.api.createSession({
//ticket: document.getElementById('sdv-container').getAttribute('att'),
ticket: "456789",
modelViewUrl: 'https://sdeuc1.eu-central-1.shapediver.com',
id: 'mySessionFolding'
}).then(function(sessionFolding) {
/************************************
DEFAULT PARAM load into the configurator
********************************************/
console.log("session folding");
console.log(sessionFolding);
});
}
Can you help me ?
Thanks