Skip to content

Conversation

@damienmarchal
Copy link
Contributor

Currently only a camera at the root node of the scene is detected during initialization of the BaseViewer.
This is problematic as it is very usefull to have a camera embeded in some subnode of the scene.

The problem is because the Node::get() method with default parameter is searching "upward". As we are at root node this means that only a camera at root node is detected. It would be searching in the node and downward.


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

…ing.

The Node::get() method is by default searching upward. As we are at root node this means
that only a camera at root node is detected.

This is problematic as it is very usefull to have a camera embeded in some subnode of the scene.
@damienmarchal damienmarchal added pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request labels Oct 30, 2025
//currentCamera->d_position.forceSet();
//currentCamera->d_orientation.forceSet();
currentCamera->bwdInit();
msg_warning("BaseViewer") << "There is no camera in this scene, I created one. To remove this error message, add a camera in your scene.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we build a simulation, we expect users to address the warnings. I don't think adding a camera should be mandatory. So I think an info message would be more appropriate: msg_info("BaseViewer") << A default camera has been added because none was found in the scene graph.

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

Labels

pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants