Maya计算图的实现
Project description
maya-rig-operation-graph
maya计算图的实现
目录
快速开始
安装
注意下方的python是你的Python, 正常情况下可以直接通过python调用, 而Maya的python一般是"C:\Program Files\Autodesk\<Maya版本>\bin\mayapy.exe"
python -m pip install maya-rig-operation-graph
在windows下maya的安装例子
注意:
- 请将Maya路径替换为自己的。
- 如果你需要安装到maya的python的site-packages下时, 请使用管理员身份运行安装命令. ( 在你没有安装到一个特定目录下时建议你这么干)
"C:\Program Files\Autodesk\Maya2018\bin\mayapy.exe" -m pip install maya-rig-operation-graph
使用
例子
# -*-coding:utf-8 -*-
from __future__ import unicode_literals, print_function, division
from rig_core.all import *
from rig_operation_graph.all import *
ctx = Ctx()
# 使用计算图进行数学运算
out_attr = float_min(ctx, 0, 1)
print(out_attr, out_attr.get_value())
out_attr = float_max(ctx, 0, 1)
print(out_attr, out_attr.get_value())
out_attr = float_mean(ctx, 0, 1)
print(out_attr, out_attr.get_value())
out_attr = float_pow(ctx, 10, 10)
print(out_attr, out_attr.get_value())
out_attr = float_sin(ctx, 0.5)
print(out_attr, out_attr.get_value())
out_attr = float_cos(ctx, 0.5)
print(out_attr, out_attr.get_value())
out_attr = float_tan(ctx, 0.5)
print(out_attr, out_attr.get_value())
# 使用计算图进行向量数学运算
out_attr = vector_add(ctx, (1, 1, 1), (-1, -1, -1))
print(out_attr, out_attr.get_value())
out_attr = vector_sub(ctx, out_attr, (-1, 1, -1))
print(out_attr, out_attr.get_value())
out_attr = vector_mul(ctx, out_attr, (1.5, 1.5, 1.5))
print(out_attr, out_attr.get_value())
out_attr = vector_div(ctx, out_attr, (3, 3, 3))
print(out_attr, out_attr.get_value())
out_attr = vector_pow(ctx, out_attr, (3, 3, 3))
print(out_attr, out_attr.get_value())
out_attr = vector_mean(ctx, out_attr, (0, 0, 0), (0, 0, 0), (0, 0, 0))
print(out_attr, out_attr.get_value())
out_attr = vector_sum(ctx, out_attr, out_attr, out_attr, out_attr)
print(out_attr, out_attr.get_value())
版权说明
该项目签署了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
File details
Details for the file maya_rig_operation_graph-0.7.2.tar.gz
.
File metadata
- Download URL: maya_rig_operation_graph-0.7.2.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4621caab01917f72526fdc428c6fbe6b4a4e16f1094efe83858bd2a0bd1d1aa |
|
MD5 | 31bdc0a333b4feada71dbcaece123800 |
|
BLAKE2b-256 | 8f9d6c21aaf926ec783c505e97de7f7b50ff6511ebd3a0d0d4f3fc02ed3bdf90 |
File details
Details for the file maya_rig_operation_graph-0.7.2-py2.py3-none-any.whl
.
File metadata
- Download URL: maya_rig_operation_graph-0.7.2-py2.py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | daa718423b3ae850eb80a48c7673d1cee67ddb322a4379832e29071b6d16b8c2 |
|
MD5 | 2e401f9028e8d1a273f616b54cb8a3fa |
|
BLAKE2b-256 | 0ddf0b41734e85be3a539a086988bfe1c7c2674a172cdb949b9c4574f505e68c |