Hi everyone hope you’re doing alright,
I am creating an effect which relies on manipulating a bunch of objects, the effect uses the plane tracker and the update() is called everytime the phone moves (xyz or rotationX/Y/Z) - I may later change this to update on Time.ms.monitor().
I would like to dynamically create and destroy the objects based on the amount of lag the user experiences - instead of just removing them from the array.
My question concerns the functions “Scene.create” and “Scene.destroy” (there are similar ones for the Materials module). These functions have no documentation in the scripting object reference (https://sparkar.facebook.com/ar-studio/learn/reference/classes/scenemodule.sceneobjectbase). But they do have a JSDocs which reads as follows:
Scene.create:
function SceneModule.create(className: string, initialState?: {
[key: string]: any;
}): Promise<any>
create(className: string, initialState?: {[key: string]: any}): Promise
Create a scene object asynchronously. When creating the scene objects, keep the following in mind:
* All objects must have an existing class.
* New objects always get assigned a globally unique `identifier` .`
* `initialState` is optional, but encouraged to be used.
* `name` in `initialState` is being used, unless it's not provided - then `dynamicObject` is used. )
Even when ignoring the optional initialState
I have tried every key
I could imagine and it didn’t work - throwing the usual and unhelpful “Unhandled promise rejection”. I haven’t been able to test with Scene.destroy as only objects created dynamically with .create can be destroyed.
Does anybody know how these functions work? Are they working or is it just a “place holder” that does nothing for the moment (They silently appeared not so long ago)?
Any help is appreciated
EDIT: As of 25 AUG 2020 the .ts doesn’t seem to have any underlying code that makes it all work
Undefined is not a function
it’s a pity, hope this changes soon.