Esempio n. 1
0
 def importToScene(self, filePath='', name=''):
     """
     Add aiStandIn to Maya scene
     """
     standInNode = createStandIn()
     self.node = standInNode.name()
     cmds.setAttr('{0}.dso'.format(self.node),
                  filePath, type='string')
     # Rename transform node
     cmds.rename(self.transform, 'aiStandIn_{0}'.format(name))
Esempio n. 2
0
 def import_ass(self,*args):
     file_path = mc.textField("textFieldFile", q=True,tx=True)
     assFiles_list = glob.glob(os.path.join(file_path,"*.ass") )
     for assFile in assFiles_list:
         assName = os.path.basename(assFile).replace(".ass","")
         if mc.objExists(assName+'_aiStndn'):
             continue
         else:
             standin_node = createStandIn(path=assFile)
             mc.rename(mc.listRelatives(standin_node,p=True),assName+'_aiStndn')
Esempio n. 3
0
def createArnoldMenu():
    # Add an Arnold menu in Maya main window
    if not pm.about(b=1):
        pm.menu('ArnoldMenu', label='Arnold', parent='MayaWindow', tearOff=True )

        pm.menuItem('ArnoldStandIn', label='StandIn', parent='ArnoldMenu', subMenu=True, tearOff=True)
        pm.menuItem('ArnoldCreateStandIn', parent='ArnoldStandIn', label="Create",
                    c=lambda *args: createStandIn())
        pm.menuItem('ArnoldCreateStandInFile', parent='ArnoldStandIn', optionBox=True,
                    c=lambda *args: doCreateStandInFile())
        pm.menuItem('ArnoldExportStandIn', parent='ArnoldStandIn', label='Export',
                    c=lambda *args: doExportStandin())
        pm.menuItem('ArnoldExportOptionsStandIn', parent='ArnoldStandIn', optionBox=True,
                    c=lambda *args: doExportOptionsStandin())

        pm.menuItem('ArnoldLights', label='Lights', parent='ArnoldMenu', subMenu=True, tearOff=True)
        
        pm.menuItem('ArnoldAreaLights', parent='ArnoldLights', label="Area Light",
                    c=lambda *args: mutils.createLocator('aiAreaLight', asLight=True))
        pm.menuItem('SkydomeLight', parent='ArnoldLights', label="Skydome Light",
                    c=lambda *args: mutils.createLocator('aiSkyDomeLight', asLight=True))
        pm.menuItem('ArnoldMeshLight', parent='ArnoldLights', label='Mesh Light',
                    c=lambda *args: doCreateMeshLight())
        pm.menuItem('PhotometricLights', parent='ArnoldLights', label="Photometric Light",
                    c=lambda *args: mutils.createLocator('aiPhotometricLight', asLight=True))

        pm.menuItem(parent='ArnoldLights', divider=True)

        pm.menuItem('MayaDirectionalLight', parent='ArnoldLights', label="Maya Directional Light",
                    c=lambda *args: cmds.CreateDirectionalLight())
        pm.menuItem('MayaPointLight', parent='ArnoldLights', label="Maya Point Light",
                    c=lambda *args: cmds.CreatePointLight())
        pm.menuItem('MayaSpotLight', parent='ArnoldLights', label="Maya Spot Light",
                    c=lambda *args: cmds.CreateSpotLight())
        pm.menuItem('MayaQuadLight', parent='ArnoldLights', label="Maya Quad Light",
                    c=lambda *args: cmds.CreateAreaLight())
                    
        pm.menuItem('ArnoldVolume', label='Volume', parent='ArnoldMenu',
                    c=lambda *args: createVolume())
                    
        pm.menuItem('ArnoldFlush', label='Flush Caches', parent='ArnoldMenu', subMenu=True, tearOff=True)
        pm.menuItem('ArnoldFlushTexture', parent='ArnoldFlush', label="Textures",
                    c=lambda *args: cmds.arnoldFlushCache(textures=True))
        pm.menuItem('ArnoldFlushBackground', parent='ArnoldFlush', label="Skydome Lights",
                    c=lambda *args: cmds.arnoldFlushCache(skydome=True))
        pm.menuItem('ArnoldFlushQuads', parent='ArnoldFlush', label="Quad Lights",
                    c=lambda *args: cmds.arnoldFlushCache(quads=True))
        pm.menuItem('ArnoldFlushAll', parent='ArnoldFlush', label="All",
                    c=lambda *args: cmds.arnoldFlushCache(flushall=True))
                    
        pm.menuItem('ArnoldUtilities', label='Utilities', parent='ArnoldMenu', subMenu=True, tearOff=True)
        pm.menuItem('ArnoldBakeGeo', label='Bake Selected Geometry', parent='ArnoldUtilities',
                    c=lambda *args: arnoldBakeGeo())
        pm.menuItem('ArnoldRenderToTexture', label='Render Selection To Texture', parent='ArnoldUtilities',
                    c=lambda *args: arnoldRenderToTexture())
        pm.menuItem('ArnoldTxManager', label='Tx Manager', parent='ArnoldUtilities',
                    c=lambda *args: arnoldTxManager())                    
        pm.menuItem('ArnoldLightManager', label='Light Manager', parent='ArnoldUtilities',
                    c=lambda *args: arnoldLightManager())

        pm.menuItem('ArnoldHelpMenu', label='Help', parent='ArnoldMenu',
                    subMenu=True, tearOff=True)

        pm.menuItem('ArnoldUserGuide', label='User Guide', parent='ArnoldHelpMenu',
                    c=lambda *args: cmds.launch(webPage='https://support.solidangle.com/display/AFMUG/Arnold+for+Maya+User+Guide'))

        pm.menuItem('ArnoldTutorials', label='Tutorials', parent='ArnoldHelpMenu',
                    c=lambda *args: cmds.launch(webPage='https://support.solidangle.com/display/mayatut/Arnold+for+Maya+Tutorials'))

        pm.menuItem('ArnoldVideos', label='Videos', parent='ArnoldHelpMenu',
                    c=lambda *args: cmds.launch(webPage='https://support.solidangle.com/display/AFMV/Arnold+for+Maya+Videos'))

        pm.menuItem(divider=1, parent='ArnoldHelpMenu')

        pm.menuItem('ArnoldSolidAngle', label='Solid Angle', parent='ArnoldHelpMenu',
                    c=lambda *args: cmds.launch(webPage='https://www.solidangle.com'))

        pm.menuItem('ArnoldMailingLists', label='Mailing Lists', parent='ArnoldHelpMenu',
                    c=lambda *args: cmds.launch(webPage='https://subscribe.solidangle.com'))

        pm.menuItem('ArnoldAsk', label='Knowledge Base', parent='ArnoldHelpMenu',
                    c=lambda *args: cmds.launch(webPage='https://ask.solidangle.com'))

        pm.menuItem('ArnoldSupportBlog', label='Support Blog', parent='ArnoldHelpMenu',
                    c=lambda *args: cmds.launch(webPage='https://support.solidangle.com/blog/arnsupp'))

        pm.menuItem('ArnoldLicensing', label='Licensing', parent='ArnoldHelpMenu',
                    c=lambda *args: arnoldLicenseDialog())

        pm.menuItem(divider=1, parent='ArnoldHelpMenu')

        pm.menuItem('ArnoldDeveloperGuide', label='Developer Guide', parent='ArnoldHelpMenu',
                    c=lambda *args: cmds.launch(webPage='https://support.solidangle.com/display/ARP/Arnoldpedia'))

        pm.menuItem('ArnoldExperimentalMenu', label='Experimental', parent='ArnoldMenu', subMenu=True, tearOff=True)

        pm.menuItem('ArnoldRender', label='External RenderView', parent='ArnoldExperimentalMenu', subMenu=True, tearOff=True)
        pm.menuItem('ArnoldSelectCamera', label='Select Camera', parent='ArnoldRender', subMenu=True, tearOff=False, 
                    postMenuCommand=lambda *args: populateSelectCamera())
        populateSelectCamera()
        pm.menuItem('ArnoldStartRender', label='Render', parent='ArnoldRender',
                    c=lambda *args: startRender())
        pm.menuItem('ArnoldStartIPR', label='IPR', parent='ArnoldRender',
                    c=lambda *args: startIpr())
        pm.menuItem('ArnoldRefresh', label='Refresh', parent='ArnoldRender',
                    c=lambda *args: refreshRender())
        pm.menuItem('ArnoldStopRender', label='Stop Render', parent='ArnoldRender',
                    c=lambda *args: stopRender())
                    
        pm.menuItem('ArnoldAbout', label='About', parent='ArnoldMenu',
                    c=lambda *args: arnoldAboutDialog())
Esempio n. 4
0
def doCreateStandInFile():
    node = createStandIn()
    LoadStandInButtonPush(node.name())
Esempio n. 5
0
def createArnoldMenu():
    # Add an Arnold menu in Maya main window
    if not pm.about(b=1):
        pm.menu('ArnoldMenu',
                label='Arnold',
                parent='MayaWindow',
                tearOff=True)

        pm.menuItem('ArnoldStandIn',
                    label='StandIn',
                    parent='ArnoldMenu',
                    subMenu=True,
                    tearOff=True)
        pm.menuItem('ArnoldCreateStandIn',
                    parent='ArnoldStandIn',
                    label="Create",
                    c=lambda *args: createStandIn())
        pm.menuItem('ArnoldCreateStandInFile',
                    parent='ArnoldStandIn',
                    optionBox=True,
                    c=lambda *args: doCreateStandInFile())
        pm.menuItem('ArnoldExportStandIn',
                    parent='ArnoldStandIn',
                    label='Export',
                    c=lambda *args: doExportStandin())
        pm.menuItem('ArnoldExportOptionsStandIn',
                    parent='ArnoldStandIn',
                    optionBox=True,
                    c=lambda *args: doExportOptionsStandin())

        pm.menuItem('ArnoldLights',
                    label='Lights',
                    parent='ArnoldMenu',
                    subMenu=True,
                    tearOff=True)

        pm.menuItem(
            'ArnoldAreaLights',
            parent='ArnoldLights',
            label="Area Light",
            c=lambda *args: mutils.createLocator('aiAreaLight', asLight=True))
        pm.menuItem('SkydomeLight',
                    parent='ArnoldLights',
                    label="Skydome Light",
                    c=lambda *args: mutils.createLocator('aiSkyDomeLight',
                                                         asLight=True))
        pm.menuItem('ArnoldMeshLight',
                    parent='ArnoldLights',
                    label='Mesh Light',
                    c=lambda *args: doCreateMeshLight())
        pm.menuItem('PhotometricLights',
                    parent='ArnoldLights',
                    label="Photometric Light",
                    c=lambda *args: mutils.createLocator('aiPhotometricLight',
                                                         asLight=True))

        pm.menuItem(parent='ArnoldLights', divider=True)

        pm.menuItem('MayaDirectionalLight',
                    parent='ArnoldLights',
                    label="Maya Directional Light",
                    c=lambda *args: cmds.CreateDirectionalLight())
        pm.menuItem('MayaPointLight',
                    parent='ArnoldLights',
                    label="Maya Point Light",
                    c=lambda *args: cmds.CreatePointLight())
        pm.menuItem('MayaSpotLight',
                    parent='ArnoldLights',
                    label="Maya Spot Light",
                    c=lambda *args: cmds.CreateSpotLight())
        pm.menuItem('MayaQuadLight',
                    parent='ArnoldLights',
                    label="Maya Quad Light",
                    c=lambda *args: cmds.CreateAreaLight())

        pm.menuItem('ArnoldVolume',
                    label='Volume',
                    parent='ArnoldMenu',
                    c=lambda *args: createVolume())

        pm.menuItem('ArnoldFlush',
                    label='Flush Caches',
                    parent='ArnoldMenu',
                    subMenu=True,
                    tearOff=True)
        pm.menuItem('ArnoldFlushTexture',
                    parent='ArnoldFlush',
                    label="Textures",
                    c=lambda *args: cmds.arnoldFlushCache(textures=True))
        pm.menuItem('ArnoldFlushBackground',
                    parent='ArnoldFlush',
                    label="Skydome Lights",
                    c=lambda *args: cmds.arnoldFlushCache(skydome=True))
        pm.menuItem('ArnoldFlushQuads',
                    parent='ArnoldFlush',
                    label="Quad Lights",
                    c=lambda *args: cmds.arnoldFlushCache(quads=True))
        pm.menuItem('ArnoldFlushAll',
                    parent='ArnoldFlush',
                    label="All",
                    c=lambda *args: cmds.arnoldFlushCache(flushall=True))

        pm.menuItem('ArnoldUtilities',
                    label='Utilities',
                    parent='ArnoldMenu',
                    subMenu=True,
                    tearOff=True)
        pm.menuItem('ArnoldBakeGeo',
                    label='Bake Selected Geometry',
                    parent='ArnoldUtilities',
                    c=lambda *args: arnoldBakeGeo())
        pm.menuItem('ArnoldRenderToTexture',
                    label='Render Selection To Texture',
                    parent='ArnoldUtilities',
                    c=lambda *args: arnoldRenderToTexture())
        pm.menuItem('ArnoldTxManager',
                    label='Tx Manager',
                    parent='ArnoldUtilities',
                    c=lambda *args: arnoldTxManager())
        pm.menuItem('ArnoldLightManager',
                    label='Light Manager',
                    parent='ArnoldUtilities',
                    c=lambda *args: arnoldLightManager())

        pm.menuItem('ArnoldHelpMenu',
                    label='Help',
                    parent='ArnoldMenu',
                    subMenu=True,
                    tearOff=True)

        pm.menuItem(
            'ArnoldUserGuide',
            label='User Guide',
            parent='ArnoldHelpMenu',
            c=lambda *args: cmds.launch(
                webPage=
                'https://support.solidangle.com/display/AFMUG/Arnold+for+Maya+User+Guide'
            ))

        pm.menuItem(
            'ArnoldTutorials',
            label='Tutorials',
            parent='ArnoldHelpMenu',
            c=lambda *args: cmds.launch(
                webPage=
                'https://support.solidangle.com/display/mayatut/Arnold+for+Maya+Tutorials'
            ))

        pm.menuItem(
            'ArnoldVideos',
            label='Videos',
            parent='ArnoldHelpMenu',
            c=lambda *args: cmds.launch(
                webPage=
                'https://support.solidangle.com/display/AFMV/Arnold+for+Maya+Videos'
            ))

        pm.menuItem(divider=1, parent='ArnoldHelpMenu')

        pm.menuItem(
            'ArnoldSolidAngle',
            label='Solid Angle',
            parent='ArnoldHelpMenu',
            c=lambda *args: cmds.launch(webPage='https://www.solidangle.com'))

        pm.menuItem('ArnoldMailingLists',
                    label='Mailing Lists',
                    parent='ArnoldHelpMenu',
                    c=lambda *args: cmds.launch(
                        webPage='https://subscribe.solidangle.com'))

        pm.menuItem(
            'ArnoldAsk',
            label='Knowledge Base',
            parent='ArnoldHelpMenu',
            c=lambda *args: cmds.launch(webPage='https://ask.solidangle.com'))

        pm.menuItem('ArnoldSupportBlog',
                    label='Support Blog',
                    parent='ArnoldHelpMenu',
                    c=lambda *args: cmds.launch(
                        webPage='https://support.solidangle.com/blog/arnsupp'))

        pm.menuItem('ArnoldLicensing',
                    label='Licensing',
                    parent='ArnoldHelpMenu',
                    c=lambda *args: arnoldLicenseDialog())

        pm.menuItem(divider=1, parent='ArnoldHelpMenu')

        pm.menuItem(
            'ArnoldDeveloperGuide',
            label='Developer Guide',
            parent='ArnoldHelpMenu',
            c=lambda *args: cmds.launch(
                webPage=
                'https://support.solidangle.com/display/ARP/Arnoldpedia'))

        pm.menuItem('ArnoldExperimentalMenu',
                    label='Experimental',
                    parent='ArnoldMenu',
                    subMenu=True,
                    tearOff=True)

        pm.menuItem('ArnoldRender',
                    label='External RenderView',
                    parent='ArnoldExperimentalMenu',
                    subMenu=True,
                    tearOff=True)
        pm.menuItem('ArnoldSelectCamera',
                    label='Select Camera',
                    parent='ArnoldRender',
                    subMenu=True,
                    tearOff=False,
                    postMenuCommand=lambda *args: populateSelectCamera())
        populateSelectCamera()
        pm.menuItem('ArnoldStartRender',
                    label='Render',
                    parent='ArnoldRender',
                    c=lambda *args: startRender())
        pm.menuItem('ArnoldStartIPR',
                    label='IPR',
                    parent='ArnoldRender',
                    c=lambda *args: startIpr())
        pm.menuItem('ArnoldRefresh',
                    label='Refresh',
                    parent='ArnoldRender',
                    c=lambda *args: refreshRender())
        pm.menuItem('ArnoldStopRender',
                    label='Stop Render',
                    parent='ArnoldRender',
                    c=lambda *args: stopRender())

        pm.menuItem('ArnoldAbout',
                    label='About',
                    parent='ArnoldMenu',
                    c=lambda *args: arnoldAboutDialog())
Esempio n. 6
0
def doCreateStandInFile():
    node = createStandIn()
    LoadStandInButtonPush(node.name())