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
from __future__ import annotations | |
import maya.cmds as cmds | |
class Solver(object): | |
""" class object that will initialize and create a native maya collision solver using pfxToon. | |
the solver has an option to create an HUD slider that can dynamically update solver width on viewport. | |
Args: | |
slider: (bool): - True will create an interactive slider on viewport. |
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 mc | |
def resetSkinCluster(skinClusterNode): | |
''' | |
Originaly created by Macaronikazoo - edited by Steffano | |
Splats the current pose of the skeleton into the skinCluster | |
The current pose is becomes the bindpose | |
''' | |
numInputs= len(mc.listConnections(skinClusterNode + '.matrix',destination=False)) |
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
from maya import cmds | |
def proximityWrap(driven, drivers, name=''): | |
from maya.internal.nodes.proximitywrap import node_interface | |
kwargs = {'type': 'proximityWrap'} | |
if name: | |
kwargs['name'] = name | |
pw = cmds.deformer(driven, **kwargs) | |
pwni = node_interface.NodeInterface(pw[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
import maya.cmds as cmds | |
import maya.internal.nodes.proximitywrap.node_interface as node_interface | |
def createProximityWrap(source, target): | |
""" | |
Creates a proximity with the given source and target transforms. | |
Args: | |
source (pm.nodetypes.Transform): Transform with skinned mesh that will drive given target. |
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
""" | |
Functions for generating spline weights. | |
Usage: | |
This modules functions each take curve parameters and output control point weights. The weights are generated using | |
a modified version of de Boor's algorithm. These weights can be used to create a weighted sum to find a point or | |
tangent on a spline. | |
While these functions are written for usage in Autodesk Maya, they don't actually have any Maya-specific libraries. | |
Additionally none of these functions actually care about the data type of provided control points. This way these |
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
# -*- coding: utf-8 -*- | |
import maya.cmds as mc | |
import maya.mel as mel | |
# 33 のビュー変換で使用する名前の一覧クラス. 変更時に文字列指定するので事前にこのように用意しておくと楽そう | |
class ViewTransformName(): | |
ACES_RRT_v_0_7 = "ACES RRT v0.7" | |
ACES_RRT_v_1_0 = "ACES RRT v1.0" | |
Log = "Log" |
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 pymel.core as pm | |
import maya.cmds as cmds | |
import maya.api.OpenMaya as om | |
def parent_constraint(parent, child, offset=True, scale=True, rotation=True, translation=True): | |
parent_pn = pm.PyNode(parent) | |
child_pn = pm.PyNode(child) | |
mmatrix = pm.createNode('multMatrix') | |
dmatrix = pm.createNode('decomposeMatrix') | |
parent_wim = om.MMatrix(parent_pn.worldInverseMatrix[0].get()) |
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
SET MAYABATCH="C:\Program Files\Autodesk\Maya2020\bin\mayabatch.exe" | |
SET mayafile=%1 | |
SET outfile=%2 | |
SET VER=FBXExportFileVersion -v FBX201800; | |
SET TRI=FBXExportTriangulate -v true; | |
SET PROPS=%VER%%TRI% | |
%MAYABATCH% -file %mayafile% -command "%PROPS%FBXExport -f ""%outfile%"";" |
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
from shiboken2 import wrapInstance | |
from PySide2 import QtGui, QtCore, QtUiTools, QtWidgets | |
import maya.OpenMayaUI as omui | |
from maya.app.general.mayaMixin import MayaQWidgetDockableMixin | |
def maya_main_window(): | |
""" | |
This function gets the pointer to the Maya's Main window. | |
Our window will be parented under this. |
NewerOlder