AWS Thinkbox Discussion Forums

scripting API in v6.x

Hi,
I’ve converted a load of v5 based general scripts over to v6.x and discovered a few things in my travels:

  1. latest beta release - scripting API chm is missing sections: “FranticX”, “ScriptControl” & “ScriptDialog”…strange…

  2. Tooltips. I assume it’s an overloaded option when defining a control now? ie: doesn’t matter if you do or don’t, add an additional [, “”] at the end of defining a UI control element? Also, I notice there is a setTooltip function now. Does that mean the referenced tooltips txt file is deprecated?

  3. “ProgressBar.refresh()” - to ensure the dotNET progress bar was refreshed within a loop, you used to have to force a refresh of its graphic. This function isn’t available in the QT based control? Deprecated? no longer necessary?

  4. “MultilineTextControl” - this got me for a minute or 2! Is now with a capital “L” - “MultiLineTextControl”. No backwards support for lowercase “l”?

  5. dotNET treeView isn’t possible anymore? Possible via QT? Example, please!

panel = scriptDialog.AddRow() treeView = TreeView() panel.controls.add( treeView )

  1. “scriptDialog.ShowGroupBoxMenu()” - not working anymore? gone / forgotten about / maybe not relevant anymore?

I have a few more specific script based errors and will submit an OS ticket independently for those…

Thanks,
Mike

Hey Mike,

  1. Thanks! We’ll address that for the next beta.

  2. Yes, the tooltips txt file is deprecated. The function is defined for backwards compatibility, but it currently doesn’t do anything. The tooltip parameter for the AddControl function defaults to “”, so if you don’t include it, it will just be set to its default value.

  3. The Refresh() function was actually just a built in function:
    msdn.microsoft.com/en-us/library … fresh.aspx

As long as you’re updating the progress in a proper thread or event handler, you don’t need to manually refresh the control (see the Shotgun UI code in \your\repo\events\Shotgun\ShotgunUI.py for an example). However, Qt has a similar function called update():
qt-project.org/doc/qt-5.0/qtwidg … tml#update

  1. Yeah, we renamed it to make it consistent with the the other controls that had “Multi” in the name. No backwards compatibility unfortunately.

  2. You’ll need to use a QListView or QTreeView:
    qt-project.org/doc/qt-4.8/qlistview.html
    qt-project.org/doc/qt-4.8/qtreeview.html

Examples of model/view programming with controls like this can be found here:
qt-project.org/doc/qt-4.8/modelview.html

  1. The collapse/expand group box menu is built right into the ScriptControl class, so an explicit function shouldn’t be necessary anymore.

Cheers,

  • Ryan

Great. Thanks for the notes! (I have submitted an OS ticket for my other issues)

doesn’t sound ideal? Maybe default to “”?

Yup, got your ticket! I’ll try to look at it tomorrow.

Not sure I follow. What should default to “”?

Cool.
Ah, sorry, I may have misread your previous comment. Are you saying that backwards compatibility support has been added to the tooltips function or the addcontrol function?
(I assumed you were referring to the tooltips function).
Essentially, the only way in v6.x+ to get tooltips for UI elements is to define them when you create them and any legacy tooltips.txt files that may exist, will be ignored?

Yes, that’s correct. Sorry, when I mentioned backward compatibility for the LoadTooltips function, I should have said that this function definition only exists so that calls to it don’t error out. The function itself does nothing in 6.x.

Privacy | Site terms | Cookie preferences