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
- Open the
display.wbt sample world
- Open
MyBot > EMOTICONS Display
- Clear the
appearance field of its first child
- Follow the documentation instructions to add back either an
Appearance or a PBRAppearance with the correct structure
- Run the simulation
- 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.)
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
childrenslots rather than just the first one. That should be a simple fix as it just involves changing the top-levelifto a loop.Steps to Reproduce
display.wbtsample worldMyBot > EMOTICONS Displayappearancefield of its first childAppearanceor aPBRAppearancewith the correct structureExpected behavior
We should listen for changes to the children and automatically rerun/incrementally update
findImageTextureswhen 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.)