I have a widget button with the following in the OffToOn Script:
p = ui.panes.createFloating(type=PaneType.NETWORKEDITOR, name="Output"); p.owner = getattr(op,me.name)
The first time I press the button, I get the following error
File "/project1/perform_ui/container1/perform_ui/output/valuesParexec", line 14, in onValueChange
td.tdError: File "</project1/perform_ui/container1/perform_ui:p = ui.panes.createFloating(type=PaneType.NETWORKEDITOR, name="Output"); p.owner = getattr(op,me.name)>", line 1
AttributeError: 'td.Shortcut' object has no attribute 'launch'
Results of run operation resulted in exception.
…and it opens a floating network pane to the root of the project…
But then, if I press the button again, it works fine, and it opens the correct path in a floating pane.
I just navigated to where these buttons are as well as to /project1/perform_ui/container1/perform_ui/output/valuesParexec, and it seems that just by the act of looking at them, they don’t throw an error on first execute.
Gonna change this to a bug, as it seems there’s an inconsistency somewhere under the hood (and also it didn’t use to happen several builds ago).
By widget-button you mean a button from the widgets from the palette or just like a regular button that you can place via the op-create dialog?
Best would be to create a simple file and upload it. Pinging @Ivan
To reproduce, simply click the button called ‘base1’, and the floating network will open to project root. Then, press the button again, and it’ll open the Base called ‘base1’ as expected.
So still investigating, but as a work around if you add ui.refresh() after the pane creation, it allows things to settle down before continuing with the script.
It’s a timing issue with refreshing the UI and the python that executes.
Cheers
p = ui.panes.createFloating(type=PaneType.NETWORKEDITOR, name=“Output”); ui.refresh(); p.owner = getattr(op,me.name); print(‘me’, me.path)