A pair of observations:
1. apply function is automatically called if present in PianoRoll Scripting, but not in Edison Scripting.
So for example, the following code will be automatically executed in PianoRoll scripting, but not in Edison.
Full script content:
Code: Select all
def apply():
raise Exception('APPLY CALLED')
What would be the ideal solution? Should apply be called even if createDialog does not exist? I am not sure, but I think the behaviour should be equal in both Edison and PianoRoll.
I know this might seem silly, but it caused me a few headheaches when trying to implement a mechanism to indicate using a bool if a ScriptDialog should be run "live" (like in createDialog+apply) or only once (like through .execute() ).
2. ScripDialog.AddInputCombo splits list/tuple items by comma.
So, when passing an str, it is expected that it will splitted. For example: "blue,red,yellow"
However, when a list/tuple of strings is passed, they are expected to remain unchanged. For example: ['(-1, 1)', '(0, 1)']
For example, this code creates 4 list items.
Code: Select all
from flpianoroll import ScriptDialog
form = ScriptDialog('','')
form.AddInputCombo('Range', ['(-1, 1)', '(0, 1)'], 0) # -> 4 items created
form.execute()
Please, let me know your thoughts!
Thank you!!