Skip to content

Instantly share code, notes, and snippets.

def main():
#app = QtGui.QApplication(sys.argv)
winName = 'COLLADA_EXPORTER'
if pm.windows.window(winName, exists=True):
print 'Already exists, passing'
pass
else:
window = ColladaExporterUI()
window.setObjectName(winName)
window.show()
def addMenuItem(parentMenu=None, labelName='', callback=None, sub=False, tearable=False):
if callback == None:
newMenu = pm.menuItem(parent=parentMenu, label=labelName, subMenu=sub, tearOff=tearable)
return newMenu
else:
pm.menuItem(p=parentMenu, label=labelName, command=pm.Callback(callback))
def createReplacementCgfx(material='', texturePaths={}, cgfxChannels={}, cgfxShaderPath=''):
""" If we find a shaderFxShader type material we need to replace wiuth CGFX for export purposes """
print 'Replacing shader with CGFX'
#mel.eval('cgfxShader -fx "%s" ' %cgfxShaderPath)
matName = str(material)
shader = pm.listConnections(material, type='shadingEngine')[0]
members = list(set(shader.members(flatten=True)))
pm.delete(matName)
print 'got members'
@ben-hearn-sb
ben-hearn-sb / file_runner.py
Created November 22, 2015 13:50
file runner revised. Patched up a couple of bugs Added if name = main functionality
__author__ = 'ben.hearn'
"""
- File Runner is a handy Qt UI class that helps with constant batch processing on files or directories with a twist!
- You can apply any external script you have written to process the files
How to use:
- Simply drag in the directories you want to iterate over into the directories window
- Type in your desired file format
__author__ = 'ben.hearn'
"""
- File Runner is a handy Qt UI class that helps with constant batch processing on files or directories with a twist!
- You can apply any external script you have written to process the files
How to use:
- Simply drag in the directories you want to iterate over into the directories window
- Type in your desired file format