This file contains 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
-- Function that calculates a correct swivel target position for a IKHI solver | |
-- The returned position will not produce any kind of pop-up when setting the swivel target of an IKHI solver | |
-- NOTE: All the bones MUST be on the same plane | |
function GetSwivelTargetPosition boneA boneB boneC pvDst:1.0 createLoc:false = | |
( | |
boneAPos = boneA.position | |
boneBPos = boneB.position | |
boneCPos = boneC.position | |
-- Get initial vectors |
This file contains 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.mel as mel | |
mel.eval('SelectEdgeLoopSp;') |
This file contains 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
from pymel.core import runtime | |
runtime.SelectEdgeLoopSp() |
This file contains 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
from Qt import QtCore as qc | |
from Qt import QtGui as qg | |
from Qt import QtWidgets as qw | |
class ControlView(qw.QGraphicsView): | |
""" | |
Base class to create the control view | |
""" | |
This file contains 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
fn FreezeTransforms obj = | |
( | |
local curObj = obj | |
if classOf curObj.rotation.controller != Rotation_Layer do | |
( | |
-- Freeze rotation | |
curObj.rotation.controller = Euler_Xyz() | |
curObj.rotation.controller = Rotation_List() | |
curObj.rotation.controller.available.controller = Euler_Xyz() |
This file contains 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 | |
def snap_pivot(source=None, target=None): | |
sel = cmds.ls(sl=True) | |
source = sel[0] if not source else source | |
target = sel[1] if not target else target | |
pivot = cmds.xform(target, query=True, pivots=True, worldSpace=True) | |
cmds.xform(source, worldSpace=True, pivots=(pivot[0], pivot[1], pivot[2])) | |
snap_pivot() |
This file contains 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
rollout FramelessRollout "Frameless Rollout" width:210 height:25 | |
( | |
local wndHandle | |
local WM_SYSCOMMAND = 0x112 | |
local SC_MINIMIZE = 0xf020 | |
local SC_MAXIMIZE = 0xf030 | |
local SC_RESTORE = 0xf120 | |
button min_btn "Minimize" pos:[4,4] width:64 height:20 |
This file contains 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
opt = QStyleOptionSlider() | |
self.view.horizontalScrollBar().initStyleOption(opt) | |
style = self.view.horizontalScrollBar().style() | |
handle = style.subControlRect(style.CC_ScrollBar, opt, style.SC_ScrollBarSlider) | |
sliderPos = handle.center() |
This file contains 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 MaxPlus | |
def get_scene_nodes(): | |
""" | |
Return all nodes in current scene | |
:return: generator<INode> | |
""" | |
stack = [MaxPlus.Core.GetRootNode()] | |
while stack: |
This file contains 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 MaxPlus | |
def get_scene_nodes(): | |
""" | |
Return all nodes in current scene | |
:return: generator<INode> | |
""" | |
stack = [MaxPlus.Core.GetRootNode()] | |
while stack: |
OlderNewer