How to use "defineTemplate" and "useTemplate" flags ?

How to use "defineTemplate" and "useTemplate" flags ?

huseila
Enthusiast Enthusiast
576 Views
2 Replies
Message 1 of 3

How to use "defineTemplate" and "useTemplate" flags ?

huseila
Enthusiast
Enthusiast

Hi all,

 

I noticed that some maya python commands (scriptTable, swichTable) provide "defineTemplate" and "useTemplate" flags but totally have no idea how to use it. Does anyone know what string to be given to these flags ?

It would be appreciated if someone can provide an example. Thanks.

0 Likes
Accepted solutions (1)
577 Views
2 Replies
Replies (2)
Message 2 of 3

Kahylan
Advisor
Advisor
Accepted solution

Hi!

 

I'm not really familiar with the scriptTable and switchTable commands. But I'm assuming that the defineTemplate and useTemplate flags work similar as in the uiTemplate command. Which means that the string you choose with the defineTemplate flag is the name of the template you want to commit to memory and it can be any string you'd like as long as there isn't an object with that name in the scene, and the useTemplate flag will take any string you previously defined with defineTemplate.

 

In the doc of uiTemplate is an example for defining a template:

https://download.autodesk.com/us/maya/2011help/CommandsPython/uiTemplate.html

 

I hope this helps!

Message 3 of 3

huseila
Enthusiast
Enthusiast

Greatly appreciated !

I also noticed that with combination of using "uiTemplate" and "setUITemplate",  one can really setup a nested templated for UI.  This is really very helpful to organize UI arguments 👍

0 Likes