Pass scripting variables to html in Sumerian

0

Hi folks, I've got an html3d element for use in a scene (it's actually part of a group of entities). I want to pass data to it from a script that reads JSON content from S3.

1. My understanding is that I can't use the script tags inline or with src= from within the html, so how do I get the variables into the html?
2. I'm looking at module://sumerian-aws/api, but can't see how to issue an API call to read from S3 - is there a tutorial on this?

Thankyou!

batfink
preguntada hace 2 años263 visualizaciones
2 Respuestas
1
Respuesta aceptada

Regarding item 1, here's a useful approach...

In Sumerian, with your HTML3D entity selected, open it for editing in the text editor. Set the entity's HTML code to something like this:

<div id="my-html3d-content">Hello world.</div>

You'll then be able to change the content of the HTML3D entity using standard Javascript DOM code like this:

var contentElement = document.getElementById('my-html3d-content');
contentElement.innerText = 'My new content.';  // or .innerHTML

Regarding item 2, Sumerian doesn't have built-in integration with Amazon S3. But no worries, you can still make calls to S3 if you first add the AWS Javascript SDK as an external dependency to your project.

profile pictureAWS
Kris
respondido hace 2 años
0

Awesome, thank you!

batfink
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas