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
已提問 2 年前檢視次數 263 次
2 個答案
1
已接受的答案

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
已回答 2 年前
0

Awesome, thank you!

batfink
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南