Add Get Property from Node expression block#34
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
manuq
left a comment
There was a problem hiding this comment.
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".
| test_list.append(b) | ||
|
|
||
| b = BLOCKS["statement_block"].instantiate() | ||
| b.block_format = "print value {value: VARIANT}" |
There was a problem hiding this comment.
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 <manuel.por.aca@gmail.com>
6c2ef3a to
7f9a689
Compare
https://phabricator.endlessm.com/T35497