Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug (or misunderstanding of semantics) in VuerSession.remove #24

Open
jdubie opened this issue Aug 15, 2024 · 2 comments
Open

Bug (or misunderstanding of semantics) in VuerSession.remove #24

jdubie opened this issue Aug 15, 2024 · 2 comments

Comments

@jdubie
Copy link

jdubie commented Aug 15, 2024

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)
@geyang
Copy link
Contributor

geyang commented Aug 19, 2024

I will take a look and get back to you asap.

@geyang
Copy link
Contributor

geyang commented Sep 2, 2024

There is a new syntax that I added in v0.0.32 that allows you to hide components. You can now do:

sess.update @ ComponentName(hide=True, ...)

and it should hide that component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants