You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project:
Sometimes it happens that I have to print a node to see if a proper node is where I want it. My problem is that print(some_node) doesn't give really useful information. It gives node type and... instance ID. I don't need the ID, I'd like the name. Most often I can't just do print(some_node.name) because some_node can be null too (safe navigation operator would help here actually...).
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Doing print on node should display its type and name, not type and ID.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
We should either make to_string virtual and override it in node or add an if checking if the Object is a node. The latter is quite simple to do actually.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
Printing nodes is rather frequent operation IMO.
Is there a reason why this should be core and not an add-on in the asset library?:
It's core thing.
The text was updated successfully, but these errors were encountered:
Could we also print a node's position if it extends from Node2D, Node3D or Control? This may give some additional context when debugging. I'm not sure how far we should go about this to ease debugging.
Also, I'd still print the instance ID so you can distinguish unique instanced nodes with the same name. Like this: MyCoolNode [Node3D] (#<instance ID>)
Describe the project you are working on:
A game.
Describe the problem or limitation you are having in your project:
Sometimes it happens that I have to print a node to see if a proper node is where I want it. My problem is that
print(some_node)
doesn't give really useful information. It gives node type and... instance ID. I don't need the ID, I'd like the name. Most often I can't just doprint(some_node.name)
becausesome_node
can be null too (safe navigation operator would help here actually...).Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Doing
print
on node should display its type and name, not type and ID.Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
We should either make
to_string
virtual and override it in node or add anif
checking if the Object is a node. The latter is quite simple to do actually.If this enhancement will not be used often, can it be worked around with a few lines of script?:
Printing nodes is rather frequent operation IMO.
Is there a reason why this should be core and not an add-on in the asset library?:
It's core thing.
The text was updated successfully, but these errors were encountered: