-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add Get Property from Node expression block #34
base: main
Are you sure you want to change the base?
Conversation
I did start to rebase this, but it looks like there's an unrelated issue in main blocking me from testing it (and fixing my examples), so I'll leave this with the conflicts for now. I did realize that a |
1b1415e
to
8dfa35c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I left a comment for the Variant type and suggestions.
Ideally learners should not have to enter property names or node names by text. I remember plugins opening a node selector. Maybe we should do that for blocks with a node parameter. It seems that PROPERTY_HINT_NODE_TYPE
can be useful. The alternative is to traverse the tree and create blocks like "This object".
@@ -83,6 +83,11 @@ static func get_general_categories() -> Array[BlockCategory]: | |||
b.statement = "print({text})" | |||
test_list.append(b) | |||
|
|||
b = BLOCKS["statement_block"].instantiate() | |||
b.block_format = "print value {value: VARIANT}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about not passing a type at all when type is not needed? Something like "print value {value}"
is assumed to have no type. So this can match #43 better.
Ultimately I think we should get rid of serialized_props
and stop converting back and forth from enum types to strings. And have resources for every block, with parameters as exported properties.
A property is always returned as a variant, which must be cast to a concrete type by using a type casting block.
Co-authored-by: manuq <[email protected]>
6c2ef3a
to
7f9a689
Compare
https://phabricator.endlessm.com/T35497