|
From: James T. <ja...@fl...> - 2022-01-12 21:26:40
|
> On 11 Jan 2022, at 12:44, Benedikt Hallinger <be...@ha...> wrote: > > James, that would be nice, I already have some use case in mind :) I’m hacking this up, some comments: - the config option is called ‘property-path’, if anyone has a strong alternative idea, please let me know - if property-path is set, ‘property’ is ignored - changes to the property-path re-resolve the node at that time (via a listener), and I don’t poll for the property appearing later, since property lookups are slow and autopilot components run fast : so you can’t specify a non-existing node path and then create the node later. I don’t see a huge issue here but maybe it’s awkward for Nasal? But in that case an fdm-initialized script can just write to the path property (triggering the listener) and everything will work. - if the property path doesn’t resolve to a valid node, the input will be marked as disabled: this feels sensible since it allows cascading inputs as we do with conditions (conditions still work *as well*, it’s a logical AND) : so it’s easy to fall back to a value if no valid property is found - if there is a <value> defined, we will set it on the node pointed to by property-path : I’m not sure about this, but it’s also what inputs do when they have a <value> *and* a <property> (if anyone has a reason not to do this, I can be easily convinced to change it….) Going to add unit-tests for all this of course, before pushing. Kind regards, James |