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

Application halts prematurely when clearing scene and changing skybox too quickly #150

Open
kevinfoley opened this issue Jul 6, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@kevinfoley
Copy link

If nvisii.clear_all() and nvisii.set_dome_light_texture() are called too close together, the application will prematurely terminate.

Simple test case:

import nvisii
from nvisii import texture
import time

nvisii.initialize(headless=False, verbose=True)

while True:
    print('clearing...')
    nvisii.clear_all()
    print('loading skybox...')
    tex : texture = texture.create_from_file('Skybox', 'skybox.jpg')
    nvisii.set_dome_light_texture(tex, True)
    time.sleep(.01)

The output from the while loop should keep repeating forever, but in reality, the loop will run a couple of times and then the application will terminate:

clearing...
loading skybox...
clearing...
loading skybox...
Press any key to continue . . .
@natevm
Copy link
Collaborator

natevm commented Jul 7, 2022

This is likely a race condition somewhere...

A possible workaround might be to use nvisii.disable_updates() until the loop completes, then call nvisii.enable_updates() at the end.

In the meantime, I'll mark this as a bug to fix on the todo list.

@natevm natevm added the bug Something isn't working label Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants