目录
maya导入bvh
maya python脚本测试
maya python脚本调用
maya重定向
Pose-to-Motion: Cross-Domain Motion Retargeting with Pose Prior
maya导入bvh
GitHub - jhoolmans/mayaImporterBVH: Importer script for BVH
maya python脚本测试
首先打开MAYA,然后点击软件上方,菜单栏上的窗口->常规编辑器->脚本编辑器。
在弹出的脚本编辑器的下方,选择python选项卡,然后把下面的案例代码复制粘贴进去。
测试脚本:
import maya.OpenMaya as om
import maya.cmds as cmds
import random, timedef arPolyNoise(geoObject, maxDisplacement):"""Apply noise to the supplied geometry object using the supplied max displacement."""# get the dag path for the shapeNode using an API selection listselection = om.MSelectionList()dagPath = om.MDagPath()try:selection.add(geoObject)selection.getDagPath(0, dagPath)except: raise# apply noise to the shape's pointstry: # initialize a geometry iteratorgeoIter = om.MItGeometry(dagPath)# get the positions of all the vertices in world spacepArray = om.MPointArray()geoIter.allPositions(pArray)# displace each of the verticesfor i in xrange(pArray.length()):displacement = om.MVector.one * random.random() * maxDisplacementpArray[i].x += displacement.xpArray[i].y += displacement.ypArray[i].z += displacement.z# update the surface of the geometry with the changesgeoIter.setAllPositions(pArray)meshFn = om.MFnMesh(dagPath)meshFn.updateSurface()except: raise# start the timer and add the noise
timeStart = time.clock()
# create a sphere and add noise
sphere = cmds.polySphere(radius=1, subdivisionsX=200, subdivisionsY=200)
arPolyNoise(sphere[0], 0.02)
# stop the timer
timeStop = time.clock()
print('Execution time: %s seconds.'%(timeStop-timeStart))
maya python脚本调用
使用Python在外部运行Maya-standalone库_maya.standalone-CSDN博客
maya重定向
https://github.com/joaen/animation-retargeting-tool/blob/main/animation_retargeting_tool/animation_retargeting_tool.py
maya导入bvh需要用插件,效果还没测
两个bvh必须 是T-Pose
是把source的动作拷贝给target
target只要t-pose就行。
关节映射。