more get_node() sugar, please! #5474
BaddRadish
started this conversation in
Engine Core
Replies: 2 comments 2 replies
-
Have you seen scene-unique nodes ( |
Beta Was this translation helpful? Give feedback.
1 reply
-
See #1776 (comment). Also see #5064 and #5064 for more... possibly savoury, sugary related Proposals. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
currently
$child
is sugar forget_node("child")
. great. love it.i think we should consider expanding this...
(1) GENERAL NODE ACCESS
sometimes we need to access the child of a node that is stored in a variable, instead of the current script's context.
so instead of
get_node("child")
, sometimes we needmy_var.get_node("child")
.currently there's no sugar for this.
but we should add some:
my_var.$child.attribute
$
behavior and.
behavior.(2) PARENT NODE ACCESS
to access the parent or siblings right now we need quotes:
$"../sibling"
.as far as i can tell this is the only time you need to put quotes around the path.
i cant imagine it would be too hard to make
$../sibling
work.i suppose the problem would be
.attribute
.anyway some kind of sugar for
.get_parent()
would be nice.$".."
just feels wrong.get_node()
.$../sibling
work.i suppose the problem would be
.attribute
.anyway some kind of sugar for
.get_parent()
would be nice.(3) $ FOR NON LITERAL STRINGS
suppose i wanted to dynamically generate a path. i could do that with
get_node("path"+my_str)
.but if i want to use
$
i can only use literals.how about
$("path"+my_str)
?$".."
, in this special case we also have to add the parens back in.get_node()
, so its not complicating the$
toget_node()
relationship at all.i'm not too worried about this one, just an idea.
thanks for your time and input!
Beta Was this translation helpful? Give feedback.
All reactions