theatre-js / theatre

Motion design editor for the web
https://www.theatrejs.com
Apache License 2.0
10.82k stars 337 forks source link

Need understanding how we can use types.image in case of three.js #483

Closed RaishavHanspal closed 1 month ago

RaishavHanspal commented 1 month ago

I'm trying to link the types.image theatre property to work with my MeshStandardMaterial map property, Could you suggest this is viable/feasible with the current implementation.

the onValuesChanges function return object in form

{ id: string; type: "image" }

The id only shows the image name. There is a suggestion in the Docs: that a custom interpolator might be required, please give insights on the usage?

Another thing: https://theatre-playground.vercel.app/shared/dom is down.

RaishavHanspal commented 1 month ago

Hi @AriaMinaei, Could you please suggest on this? Thanks :)

AriaMinaei commented 1 month ago

Looks like the link that is supposed explain this is broken. Here it is.

Basically:

onst object = sheet.object('My Object', {
  texture: types.image(undefined, {
    label: 'Texture',
  }),
})

object.onValuesChange(({ texture }) => {
  setImageUrl(project.getAssetUrl(texture))
})