vuer icon indicating copy to clipboard operation
vuer copied to clipboard

Bug (or misunderstanding of semantics) in VuerSession.remove

Open jdubie opened this issue 6 months ago • 2 comments

To repro - run this code and observe the sphere doesn't get removed

from asyncio import sleep

from vuer import Vuer
from vuer.schemas import Scene, Box, Plane, Sphere

cert_file="./cert.pem"
key_file="./key.pem"
app = Vuer(
    host="0.0.0.0",
    cert=cert_file,
    key=key_file,
    queries=dict(
        grid=False,
        ws='wss://localhost:8012',
    ),
    queue_len=3,
)


@app.spawn(start=True)

async def main(session):
    #session.set @ Scene()
    while True:
        session.upsert @ Sphere(key='s', args=[0.5, 20, 20], position=[0, 1, -2], materialType="depth")
        await sleep(1.0)

        # Removing does nothing
        session.remove @ 's'

        # This works! So my work around is to make things small/move them b/c i can't remove
        #session.upsert @ Sphere(key='s', args=[0.5, 20, 20], position=[0, 1, -3], materialType="depth")
        await sleep(1.0)

jdubie avatar Aug 15 '24 21:08 jdubie