maya控制器库实现
Project description
maya-controller-hub
maya控制器库实现
目录
快速开始
安装
注意下方的python是你的Python, 正常情况下可以直接通过python调用, 而Maya的python一般是C:\Program
Files\Autodesk<Maya版本>\bin\mayapy.exe
python -m pip install maya-controller-hub
在windows下maya的安装例子
注意:
-
请将Maya路径替换为自己的。
-
请使用cmd
"C:\Program Files\Autodesk\Maya2018\bin\mayapy.exe" -m pip install maya-controller-hub
使用
例子
# -*-coding:utf-8 -*-
from __future__ import unicode_literals, print_function, division
import cpmel.cmds as cc
from rig_core.all import *
from controller_hub import ControllerHub
ctx = Ctx()
for i in range(4):
cc.mel.eval('circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.1 -s 8 -ch 0;')
with ControllerHub(ctx, 'your-controller-hub-path') as control_hub:
print('control_hub', control_hub)
control_hub.use_template(
'cp.cube',
[cc.new_object('nurbsCircle1')],
translate=(1, 1, 1),
color='#19448e') # 一个蓝色的正方体控制器
control_hub.use_template(
'cp.octahedron',
[cc.new_object('nurbsCircle2')],
rotate=(45, 45, 45),
color=(0.8, 0.8, 0.8)) # 一个白色的正八面体控制器
control_hub.use_template(
'cp.flower',
[cc.new_object('nurbsCircle3')],
rotate='+y',
color=(0, 0, 0)) # 一个黑色的花形控制器
control_hub.use_template(
'cp.triangle',
[cc.new_object('nurbsCircle4')],
scale=(1.5, 1.5, 1.5),
color=14) # 一个绿色的三角形控制器
版权说明
该项目签署了Apache-2.0 授权许可,详情请参阅 LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for maya-controller-hub-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 591dab36d4eb2608f249c6ebca249cf31dd8f4c85719b28e5d1f84c5f6961c76 |
|
MD5 | 88e386351dec25a6c4cfdd4454ac657c |
|
BLAKE2b-256 | 28f3e4552e2bdef104075e7de83d8cd13769f326c1aac10342833da151aa4244 |
Close
Hashes for maya_controller_hub-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48ae9e1142b35314d73b03b7012fd12c2cd0e5b4984463a612d8e2c8d37d0092 |
|
MD5 | d7dd66258d30179f2919c6cf1f4a9e1b |
|
BLAKE2b-256 | 75876d46f2014ea3213d3e894fbfd1588cf0f8af088147dff685c6723b71fbd9 |