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

Can't select Transform node in 3D View #6266

Closed
ShuffleWire opened this issue Jun 28, 2023 · 3 comments
Closed

Can't select Transform node in 3D View #6266

ShuffleWire opened this issue Jun 28, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@ShuffleWire
Copy link
Contributor

ShuffleWire commented Jun 28, 2023

Describe the Bug
ditto
Especially bad because I can't move it, to do so I need to select it in the tree.

Steps to Reproduce
Open

#VRML_SIM R2023a utf8

EXTERNPROTO "webots://projects/objects/backgrounds/protos/TexturedBackground.proto"
EXTERNPROTO "webots://projects/objects/backgrounds/protos/TexturedBackgroundLight.proto"
EXTERNPROTO "webots://projects/objects/floors/protos/RectangleArena.proto"

WorldInfo {
}
Viewpoint {
  orientation -0.36630783562978425 0.2247870123314165 0.902933756508936 2.12964342923002
  position 0.9655655585952454 -1.6769303338209047 1.9200352561851333
}
TexturedBackground {
}
TexturedBackgroundLight {
}
RectangleArena {
}
Solid {
  translation -0.24 0 0
  children [
    Shape {
      appearance PBRAppearance {
      }
      geometry Sphere {
        radius 0.1
      }
    }
  ]
}
Transform {
  children [
    Shape {
      appearance PBRAppearance {
      }
      geometry Box {
        size 0.1 0.1 0.1
      }
    }
  ]
}

Click on the sphere, the Solid is selected
Click on the cube, the Transform is not selected
Idem when using a Pose instead of the Transform

Expected behavior
Object should get selected.

System

  • Operating System: Webots master@5e8af90ac90158ef640a47ab932f8d7727da7594

Partial solution
Is the bug hiding near void WbView3D::selectNode(const QMouseEvent *event) or void WbSelection::selectPoseFromView3D(WbAbstractPose *p, bool handlesDisabled) ?

in WbSelection:81 in WbSelection::selectNode(WbBaseNode *n, bool handlesDisabled)
I got mSelectedAbstractPose == NULL when clicking on the transform node.

@ShuffleWire ShuffleWire added the bug Something isn't working label Jun 28, 2023
@stefaniapedrazzi
Copy link
Member

This is not a bug but a design choice.
Only Solid nodes can be selected from the 3D view.
If you want to move a Transform node using the handles in the 3D view, you have to select it from the scene tree.

The reason of this design choice is to make it easier to select the part of the robots that are commonly defined using Solid nodes.

@ShuffleWire
Copy link
Contributor Author

ShuffleWire commented Jun 28, 2023

I see !

But when the top level of a PROTO is a transform, I can't select it...

@ShuffleWire
Copy link
Contributor Author

BTW : reading the code I've seen
mSelectedAbstractPose = mSelectedNode ? dynamic_cast<WbAbstractPose *>(mSelectedNode) : NULL;
could it be replaced by
mSelectedAbstractPose = dynamic_cast<WbAbstractPose *>(mSelectedNode); ?
it seems safe according to https://stackoverflow.com/questions/5155820/portably-safe-to-pass-null-zero-to-dynamic-cast
but I'm not a C++ expert !

@omichel omichel mentioned this issue Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants