This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| ------------------------------------------------------------------------------------------------------------------------ | |
| # Maya 2017 PySide2 Docking Qt QMainWindow by Michael Davydov | https://github.com/Nixellion/ | |
| ## https://www.michaeldavydov.com | https://www.nixes.ru | |
| ------------------------------------------------------------------------------------------------------------------------ | |
| This module aims to have functions and classes that you can use to create your own Maya UI, with support of Maya with | |
| PySide and PySide2 (2014-2018+). Primary focus on dockable windows. | |
| Major changes have been made in Maya version 2017, when it moved from Qt4\PySide to Qt5\PySide2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ScatterToInstance_v1_Align | |
| # Select mesh, then scatter object | |
| from pymel.core import * | |
| import maya.cmds as cmds | |
| import random as r | |
| sl = selected() | |
| scatterObjs = sl[:-1] | |
| scatterBase = sl[-1] | |
| print scatterObjs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ScatterToInstance_v1 | |
| # Select mesh, then scatter object | |
| from pymel.core import * | |
| import maya.cmds as cmds | |
| import random as r | |
| sl = selected() | |
| scatterObjs = sl[:-1] | |
| scatterBase = sl[-1] | |
| print scatterObjs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| asadasdadasd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def RShowMatsOutliner(): | |
| #check if window exists | |
| if (cmds.window("R_MaterialLister", exists=True)): | |
| cmds.deleteUI("R_MaterialLister") | |
| else: | |
| # window and mainLayout | |
| window = cmds.window("R_MaterialLister", title="Material Lister") | |
| form = cmds.formLayout(numberOfDivisions=100, width=100) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import maya.cmds as cmds | |
| cam=cmds.ls(sl=True) | |
| if len(cam)<1: | |
| cmds.confirmDialog(message="select a camera") | |
| else: | |
| camShape=cmds.listRelatives(cam) | |
| def reset(): | |
| cmds.panZoom(camShape,abs=True,z=1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string $selection[] = `ls -sl -dag -lf`; // remember all Shapenodes in selection | |
| for ($node in $selection) | |
| { | |
| vray addAttributesFromGroup $node vray_roundedges 1; | |
| vrayAddAttr $node vrayRoundEdges; | |
| vrayAddAttr $node vrayRoundEdgesRadius; // 3 lines add Vray arrtibutes | |
| setAttr ( $node + ".vrayRoundEdgesRadius") 0.12; // Set it to 0.12 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def getCurrentCamera(): | |
| pan = cmds.getPanel(wf=True) | |
| cam = cmds.modelPanel(pan, q=True, camera=True) | |
| return cam | |
| def FlipCamera(): | |
| wootc = getCurrentCamera() | |
| cmds.rotate(0, 180, 0, wootc, r=True, pivot=(0,0,0)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def ScaleFacesProp(): | |
| os = cmds.selectPref(q=True, trackSelectionOrder=True) | |
| if os: | |
| cs = cmds.ls(orderedSelection=True) | |
| else: | |
| cs = cmds.ls(sl=True) | |
| cmds.select(cs[0]) | |
| q = cmds.polyProjection(t='Planar', md='b', ch=1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def Dicer(xmany, ymany, zmany): | |
| cs = cmds.ls(sl=True) | |
| cpc = cmds.objectCenter(cs, gl=True) | |
| cpcx = cpc[0] | |
| cpcy = cpc[1] | |
| cpcz = cpc[2] | |
NewerOlder