Skip to content

WbDisplay Doesn't Detect Embedded Displays Until World is Reloaded #6964

Description

@CoolSpy3

Describe the Bug
Currently, WbDisplay::findImageTextures() is only called during prefinalization, so updates to its structure are not propagated to the simulation. Thus, if someone sets up a display to work in embedded mode, those changes are not applied until the world is reloaded. This is in contrast to most other Webots nodes which have changes that are applied immediately.

While working on this, it might also be nice to support shapes/groups in all the children slots rather than just the first one. That should be a simple fix as it just involves changing the top-level if to a loop.

Steps to Reproduce

  1. Open the display.wbt sample world
  2. Open MyBot > EMOTICONS Display
  3. Clear the appearance field of its first child
  4. Follow the documentation instructions to add back either an Appearance or a PBRAppearance with the correct structure
  5. Run the simulation
  6. Notice that the emoticons are not displayed

Expected behavior
We should listen for changes to the children and automatically rerun/incrementally update findImageTextures when required. Unfortunately, because that involves checking for both recursion on Groups AND changes in Shape.appearance AND THEN appearance.<textureNode> AND THEN <textureNode>.url, I'm having trouble thinking of a way to do it that doesn't get messy fast. (Maybe why it was written this way in the first place.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImplementation of a minor feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions