Skip to main content

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

注意:

  1. 请将Maya路径替换为自己的。
  2. 如果你需要安装到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


Download files

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

Source Distribution

maya_rig_operation_graph-0.7.2.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

maya_rig_operation_graph-0.7.2-py2.py3-none-any.whl (22.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file maya_rig_operation_graph-0.7.2.tar.gz.

File metadata

File hashes

Hashes for maya_rig_operation_graph-0.7.2.tar.gz
Algorithm Hash digest
SHA256 a4621caab01917f72526fdc428c6fbe6b4a4e16f1094efe83858bd2a0bd1d1aa
MD5 31bdc0a333b4feada71dbcaece123800
BLAKE2b-256 8f9d6c21aaf926ec783c505e97de7f7b50ff6511ebd3a0d0d4f3fc02ed3bdf90

See more details on using hashes here.

File details

Details for the file maya_rig_operation_graph-0.7.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for maya_rig_operation_graph-0.7.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 daa718423b3ae850eb80a48c7673d1cee67ddb322a4379832e29071b6d16b8c2
MD5 2e401f9028e8d1a273f616b54cb8a3fa
BLAKE2b-256 0ddf0b41734e85be3a539a086988bfe1c7c2674a172cdb949b9c4574f505e68c

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