How to setup shapespark viewer API locally

Hi, I am new to shapespark system, and I am trying setup a simple Javascript git Example shapespark-viewer-API(GitHub - shapespark/shapespark-viewer-api: JavaScript API for interacting with the Shapespark 3D scene.) ,but getting console error ‘Uncaught ReferenceError: WALK is not defined’
can any one help

Do you see this error from body-end.html file or head-end.html? head-end.html will not have WALK defined yet, it is rather intended for CSS styles modification.

so, how to fix ‘Uncaught ReferenceError: WALK is not defined’?

Do you encounter this error for a local or uploaded scene?

1 Like

i get this error when i load the scene and open the console it shows error

Do you use body-end.html or head-end.html in your scene folder to customize the scene? WALK can only be accessed from the body-end.html, it is not yet available in the head-end.html

Often such error indicates a syntax error somewhere earlier in the file, for example lack of a closing HTML tag. If you could upload the scene and send a link to us we will take a look and check what causes the issue.

1 Like

this is my source code, can you check what cause the error

You will need to do the following:

1 Like

It’s strange. I needed to generate the bundle file. So, I added a body-end.html into the folder, but it doesn’t work. Instead, adding scripts to index.html turns out effective.

body-end.html works for an unbundled Shapespark scene. Contents of body-end.html is inserted to index.html while bundling, but after the bundle is created, putting body-end.html to the bundle directory doesn’t work.

If don’t use <iframe> element how can I show the scene?

The default index.html is responsible for showing the scene, iframe is not needed. body-end.html file allows to extend this default index.html with your customization while keeping all the required parts of the index.html.

1 Like

If I don’t use iframe, how can I get the scene by path? isn’t src the link of the scene, how can the scene be displayed without using this path? I dont know how to show the scene without iframe. Please guide me.

The customized scene should be on your disk in the Documents\Shapespark\SCENE-NAME\ folder and should be uploaded from there after your customization is done. It is not possible to customize a scene that belongs to some other account and is already hosted on the Shapespark server ( in your case).

1 Like