资源简介
可以导出maya骨骼动画到three.js 的插件,亲测可用,maya版本最好在2015以后
代码片段和文件信息
__author__ = ‘Sean Griffin‘
__version__ = ‘1.0.1‘
__email__ = ‘sean@thoughtbot.com‘
import sys
import os.path
import json
import shutil
from pymel.core import *
from maya.OpenMaya import *
from maya.OpenMayaMPx import *
kPluginTranslatorTypeName = ‘Three.js‘
kOptionscript = ‘ThreeJsExportscript‘
kDefaultOptionsString = ‘0‘
FLOAT_PRECISION = 8
class ThreeJsWriter(object):
def __init__(self):
self.componentKeys = [‘vertices‘ ‘normals‘ ‘colors‘ ‘uvs‘ ‘faces‘
‘materials‘ ‘diffuseMaps‘ ‘specularMaps‘ ‘bumpMaps‘ ‘copyTextures‘
‘bones‘ ‘skeletalAnim‘ ‘bakeAnimations‘ ‘prettyOutput‘]
def write(self path optionString accessMode):
self.path = path
self._parseOptions(optionString)
self.verticeOffset = 0
self.uvOffset = 0
self.normalOffset = 0
self.vertices = []
self.materials = []
self.faces = []
self.normals = []
self.uvs = []
self.morphTargets = []
self.bones = []
self.animations = []
self.skinIndices = []
self.skinWeights = []
if self.options[“bakeAnimations“]:
print(“exporting animations“)
self._exportAnimations()
self._goToframe(self.options[“startframe“])
if self.options[“materials“]:
print(“exporting materials“)
self._exportMaterials()
if self.options[“bones“]:
print(“exporting bones“)
select(map(lambda m: m.getParent() ls(type=‘mesh‘)))
runtime.GoToBindPose()
self._exportBones()
print(“exporting skins“)
self._exportSkins()
print(“exporting meshes“)
self._exportMeshes()
if self.options[“skeletalAnim“]:
print(“exporting keyframe animations“)
self._exportKeyframeAnimations()
print(“writing file“)
output = {
‘metadata‘: {
‘formatVersion‘: 3.1
‘generatedBy‘: ‘Maya Exporter‘
}
‘vertices‘: self.vertices
‘uvs‘: [self.uvs]
‘faces‘: self.faces
‘normals‘: self.normals
‘materials‘: self.materials
}
if self.options[‘bakeAnimations‘]:
output[‘morphTargets‘] = self.morphTargets
if self.options[‘bones‘]:
output[‘bones‘] = self.bones
output[‘skinIndices‘] = self.skinIndices
output[‘skinWeights‘] = self.skinWeights
output[‘influencesPerVertex‘] = self.options[“influencesPerVertex“]
if self.options[‘skeletalAnim‘]:
output[‘animations‘] = self.animations
with file(path ‘w‘) as f:
if self.options[‘prettyOutput‘]:
f.write(json.dumps(output sort_keys=True indent=4 separators=(‘‘ ‘: ‘)))
else:
f.write(json.dumps(output separators=(“““:“)))
def _allMeshes(self):
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-09-21 16:12 修改后的Maya导出THREE.js插件\
文件 14647 2016-09-21 16:12 修改后的Maya导出THREE.js插件\Maya Exporter 注意事项.docx
目录 0 2016-09-17 21:51 修改后的Maya导出THREE.js插件\plug-ins\
文件 16688 2016-09-21 15:20 修改后的Maya导出THREE.js插件\plug-ins\threeJsFileTranslator.py
目录 0 2016-09-17 21:51 修改后的Maya导出THREE.js插件\sc
文件 4395 2016-07-14 19:16 修改后的Maya导出THREE.js插件\sc
相关资源
- three.js的stl文件
- Three.js内部-贴花
- three.js加载obj+mtl文件源码
- 网页3D模型显示
- three.min.js多版本集合
- Autodesk Forge 的 SVF 格式离线转换引擎
- three.js+photo-sphere-viewer.js 全景场景切换
- three.js 导入fbx
- 星空天空盒子-六张图-three.js-普清图
- webgl 实现的炫酷地球 基于three.js
- Three.js全景漫游代码实现
- three.js学习PPT以及小
- threejs书籍集合
- three.js开发指南及其中文版
- Three.JS开发指南.中文完整版.pdf
- Three.Js开发指南
- Learn Three.js 第3版(英文)
- three.js 利用uv和ThreeBSP制作一个快递柜
- WebGLthree.js视频教程
- threejs加载obj文件
- three.js字体
- three.js加载obj模型添加点击事件及其他
- 面向Web的BIM三维浏览与信息管理
- three.js解析BIM中间数据JSON源代码
- Three.js开发指南pdf 最新版
- Three.js加载obj+mtl文件,机房演示效果
- 网页显示3D模型(obj和mtl格式)
- three.js加载坦克3D模型源码
- 微信小程序加载fbx模型
- three.js 3d 地球 国家 控制
评论
共有 条评论