Scripting problem with snapshotToTexture

Hi,
I’m stuck with a problem in a script.

I am using the “snapshotToTexture” function and it’s working fine.

BUT…The snapshot that is taken always includes the camera button I’m implementing the script (pointerdown) with.
I built a state in where this camera button is invisible and tried to activate it in the script before the snapshotToTexture functions appears.
So technically it should first activate the state in which the camera button is invisible and after that take the snapshot and apply it to my texture.
Unfortunately the camera button is still visible on the snapshot that is used for the texture.

I’m fairly new into scripts and the snapshotToTexture function but I included some screenshots to help you to understand my problem.

I hope someone can help me out here,
Felix :slight_smile:

Try this thread. It will solve the button problem you describe. Add camera sharing function to scene. Good luck!

Thank you! It worked fine after I adapted the script to my situation.
I’ll share it with you if anyone is stuck with the same problem.

I changed the Name of the Button from “Snapshot.png” to “Snapshot” so don’t mistake it with the snapshot function I’m using as well.

const Plane = symbol.nodes.Plane
symbol.nodes.Snapshot.on(“pointerup”, ()=>{
symbol.nodes.Snapshot.visible(false);
symbol.nodes.Plane.visible(false);
Z.device.snapshotToTexture(undefined,(texture) => {
Plane.skin(texture)
});
Z.after(250, ()=>{
symbol.nodes.Snapshot.visible(true);
symbol.nodes.Plane.visible(true);
});
});

1 Like