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

Nodes Cannot Be Inserted into an Unconnected Field of a PROTO #6604

Open
CoolSpy3 opened this issue Aug 1, 2024 · 0 comments
Open

Nodes Cannot Be Inserted into an Unconnected Field of a PROTO #6604

CoolSpy3 opened this issue Aug 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@CoolSpy3
Copy link
Contributor

CoolSpy3 commented Aug 1, 2024

Describe the Bug
This is a bug I discovered while working on #6574 and then forgot to open an issue for. If there is an unconnected SFNode or MFNode field in a proto, no nodes can be inserted into it. The cause appears to be WbNodeUtilities:1514. isParameter() is actually checking that mInternalFields.size() != 0, which is not true for unconnected fields. The fix should be to fix isParameter to work for unconnectedFields. The code will then have to be updated as some methods assume that isParameter() == true => internalFields().size() > 0. However, I haven't yet thought of a good way for determining whether a field is a parameter. So far my thoughts are either: 1) adding another flag, or 2) maybe something like parentNode()->isProtoInstance() (If that doesn't give false positives).

Steps to Reproduce

  1. Create the following proto:
#VRML_SIM R2023b utf8

PROTO Test [
    unconnectedField SFNode node NULL
]
{
    Solid {
    }
}
  1. Add it to a world
  2. Try to insert something in the node field
  3. Notice that the "Add a node" dialog is empty

Expected behavior
In this case, all available nodes (that do not require a robot ancestor) should be displayed. If there were any node restrictions on the node, those should also be considered.

System

  • Operating System: Windows 10
  • Graphics Card: NVIDIA GTX 1050 Ti
@CoolSpy3 CoolSpy3 added the bug Something isn't working label Aug 1, 2024
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

1 participant