By using AWS re:Post, you agree to the Terms of Use

Pass scripting variables to html in Sumerian


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?


asked 8 months ago22 views
2 Answers
Accepted Answer

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 picture
answered 8 months ago

Awesome, thank you!

answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions