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
# -*- coding:utf-8 -*- | |
import maya.cmds as cmds | |
import maya.api.OpenMaya as om | |
def setLocatorOnNurbsCurve(value, connect=True): | |
u""" | |
概要: | |
選択したNurbsCurve上にLocatorを作成。 |
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
#-*- coding:utf-8 -*- | |
import maya.cmds as cmds | |
import maya.api.OpenMaya as om | |
# closestPointを取得する関数 | |
def getClosestPoint(thisPt,searchMesh,ID) : | |
# セレクションリストからメッシュの関数セットに代入 | |
sl = om.MSelectionList() | |
sl.add(searchMesh) |
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
#-*- coding:utf-8 -*- | |
import maya.cmds as cmds | |
import maya.api.OpenMaya as om | |
def getPointAtUV(U,V): | |
u""" | |
概要: | |
選択したDAGノードのUV値からワールド位置情報を取得。 | |
例 : getPointAtUV(0.5,0.5) |
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
// frameHittingWithTimeRemap | |
// タイムリマップでコマ打ち | |
// コマ打ちするコマ数 | |
var frameHit = 2; | |
// アクティブなコンポジションを取得 | |
var activeComp = app.project.activeItem; | |
// アクティブなレイヤー名を取得 | |
var selectedLayers = activeComp.selectedLayers; | |
// フレームレートを取得 |
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
#-*- coding:utf-8 -*- | |
#MayaからAEへカメラ&ヌルをコンバート | |
import math | |
import maya.cmds as cmds | |
class CameraToAfterEffects(object): | |
def __init__(self): | |
self.windowName = "MayaCameraToAfterEffects" | |
def UI(self): |
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
# -*- coding:utf-8 -*- | |
import maya.cmds as cmds | |
def createCurveOfVertexTrail(startF, endF): | |
u""" | |
概要: | |
選択した頂点の軌跡をカーブで作成。 | |
選択しているのがオブジェクトの場合、ピボット位置にカーブ作成。 |
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
# -*- coding:utf-8 -*- | |
import maya.cmds as cmds | |
def createCurveOfParticleTrail(startF, endF): | |
u""" | |
概要: | |
選択したパーティクルの軌跡をカーブで作成。 | |
particle, nParticle どちらでもOK。 |
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
# -*- coding:utf-8 -*- | |
""" | |
選択したメッシュ内部を埋め尽くす、または表面に散布されるポイントのポジション情報を取得。 | |
Houdini の 【 PointFromVolume 】,【 scatter 】 ノードを再現。 | |
""" | |
import random | |
import maya.cmds as cmds | |
import maya.api.OpenMaya as om |
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
// Run Over を Detail で実行 | |
// ポイントの数 | |
int count = chi("count"); | |
// ポイントの半径 | |
float radius = chf("radius"); | |
// ポイントの半径減衰 | |
float radiusFalloff = chf("radiusFalloff"); | |
// ポイント毎の角度 | |
float angle = 0; |
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
u""" | |
パーティクルインスタンスをオブジェクトにベイク | |
インスタンサーノードを選択して実行 | |
""" | |
import math | |
import maya.mel as mel | |
import maya.cmds as cmds | |
import maya.api.OpenMaya as om2 | |
import maya.OpenMaya as om |