a few good points and some more obvious ones, still worth reading.
January 14, 2015
July 14, 2011
A Technodolly motion control camera
is probably the fanciest way to write a simple ascii file like this:
X, Y, Z,
pan, tilt, roll,
zoom, focus, iris, ’\n’);
R0.00, 4.2376,-1.0234,1.1942, -65.029,3.959,0.000, 0.000, 0.001, 0.00
Simple to translate into a .chan file for loading it into Houdini. The coordinate system needs to be changed a bit but luckily one can easily compare results against their free Maya plugin.
June 7, 2011
While translating from mel to python is straight forward you might end up doing more than that just because python thinks different.
Mel script tends to tangle gui code, querying maya scene properties and "processing" code, so at least separating them properly is a good first step.
Rewriting the texture manager below using a texture class object shortened the code dramatically.
A 1200 lines melscript is now some 360 lines of python and a .ui file. Python rules...
Here is the code.
June 3, 2011
I decided to give good old texture checker tool a new gui as maya 2011 stopped supporting some formating features it was using.
After building a .ui in QtDesigner i added code to update the dynamic checkbox list (a QListWidget) and connect the other widgets.
I didn't find accessing the dynamically created check boxes too straight forward, so here is a code snippet:
#get the list listWidget=self.chLayout.itemAt(0).widget() #add check boxes item = QtGui.QListWidgetItem(listWidget) ch = QtGui.QCheckBox() listWidget.setItemWidget(item, ch) #query check boxes status for index in xrange(listWidget.count()): check_box = listWidget.itemWidget(listWidget.item(index)) state = check_box.checkState()
Here is a useful example for using pyQt in maya with Threads in a way that doesn't block the gui.
And here is the code.