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
feita há 2 anos263 visualizações
2 Respostas
1
Resposta aceita

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 há 2 anos
0

Awesome, thank you!

batfink
respondido há 2 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas