Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
dynamic attributeの値をチェックする。主にSOuPやMash使ってる時用かも。
# とりあえず大急ぎで書いてる
# あれこれ書き方忘れてたので参考ページもメモ
from maya import OpenMaya
import pymel.core as pm
def mdg_from_name(name):
if not pm.objExists(name):
raise pm.MayaNodeError, name
slist = OpenMaya.MSelectionList()
dg = OpenMaya.MObject()
slist.getDependNode(0, dg)
return dg
# main
inst = mdg_from_name('instancer2')
instFn = OpenMaya.MFnDependencyNode(inst)
ip_plug = instFn.findPlug('inputPoints')
handle_data = ip_plug.asMDataHandle().data()
points_data = OpenMaya.MFnArrayAttrsData(handle_data)
indexs = points_data.getIntData('objectIndex')[:]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.