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

Scene passed in renderingCallback is not initialized #17

Closed
fpatzelt opened this issue Feb 2, 2023 · 2 comments
Closed

Scene passed in renderingCallback is not initialized #17

fpatzelt opened this issue Feb 2, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@fpatzelt
Copy link
Contributor

fpatzelt commented Feb 2, 2023

I noticed that the rendering of contact surfaces stopped working. The scene passed to the renderCallback has a geom buffer with size 0 (scene->maxgeom = 0).
Either mjv_makeScene is never called or a different scene is passed to the renderCallback.

@DavidPL1 DavidPL1 added the bug Something isn't working label Feb 2, 2023
@DavidPL1 DavidPL1 self-assigned this Feb 2, 2023
DavidPL1 added a commit that referenced this issue Feb 14, 2023
* Adds passing a scene to the render callback.
* `renderCallback` definition and declaration moved to render_utils.
* Rendering the main window now passes the correct scene for callbacks
to render additional content.

Fixes #17
@DavidPL1
Copy link
Contributor

The problem was that the environment just used its own scene for the plugin render callbacks, which is only initialized when cameras are defined in the scene and offscreen rendering is turned on. The result would also only have been visible in the rendered camera images, not the simulation GUI.
This is fixed in 7158fc0, i.e. the GUI rendering now passes the scene used to render the GUI frame.

I was wondering if we should include the option to let the plugins also render to offscreen scenes, because if you run the server headless the render callbacks currently don't get called.
Example use case: recording a video with e.g. contact surface visualization on a headless setup for demonstration purposes.

On the other hand this could interfere with cameras used as data processing sources, so we should use a user parameter in the model xml to flag cameras that are only used for visualization and only run callbacks for them.

@rhaschke, what's your take on this?

@rhaschke
Copy link
Member

I don't fully understand the problem yet. Let's talk tomorrow in person.

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

3 participants