Skip to main content

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的安装例子

注意:

  1. 请将Maya路径替换为自己的。
  2. 请使用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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maya_controller_hub-0.1.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

maya_controller_hub-0.1.1-py2.py3-none-any.whl (6.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file maya_controller_hub-0.1.1.tar.gz.

File metadata

  • Download URL: maya_controller_hub-0.1.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for maya_controller_hub-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e8c883512220b3a4ffcbced65239d6062884962b2dc5cd17563e76fb22d79ede
MD5 a7ef9bee9b9470b90a5f69f67dee0318
BLAKE2b-256 69bf1f7d062d2499bd35a441cf068845645c99641f33b8589a1337d566d618b7

See more details on using hashes here.

File details

Details for the file maya_controller_hub-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for maya_controller_hub-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bff0210ab7535ece03787f754d2a0567618b55ab4fad3c7160f8ecea3fbb720c
MD5 70628818bbf8e066472e7cca11d18150
BLAKE2b-256 35e95bf5b696775a6d748b0901692a376b5c397217b7107734fc7da14bb02251

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page