[Maya-Python] Programmatically create and connect Alembic nodes

765 views
Skip to first unread message

Marcus Ottosson

unread,
Aug 14, 2015, 5:28:04 AM8/14/15
to python_in...@googlegroups.com

Is there any way of doing something this?

from maya import cmds

# Create
mesh = cmds.createNode("mesh")
alembic = cmds.createNode("AlembicNode")

# Set
cmds.setAttr(alembic + ".abc_File", "/folder/file.abc", type="string")

# Connect
cmds.connectAttr(alembic + ".outPolyMesh[0]", mesh + ".inMesh")

I figure the Alembic needs some form of “initialisation” in order for it to create the compound output attribute outPolyMesh, but even if it did, how can I find out which mesh is coming from which attribute?

Thanks,
Marcus

--
Marcus Ottosson
konstr...@gmail.com

Colas Fiszman

unread,
Aug 14, 2015, 10:45:47 AM8/14/15
to python_in...@googlegroups.com
Hi Marcus,
I don't think there is a easy way to know which mesh is coming from which outPolyMesh attribute.

Why won't you use the AbcImport command?

From the code of the AbcImport Command "...Creating and managing an AlembicNode without the AbcImport command is not currently recommended..."

Greets,
Colas

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBe2H4ARBvMu_ygWwjj8%2B8Ts4nF3LEEyxu9Gh%3DTvtFbew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Marcus Ottosson

unread,
Aug 14, 2015, 11:20:04 AM8/14/15
to python_in...@googlegroups.com
Thanks for the reply, Colas.

The reason is quite simply familiarity; most other things I connect to various things and they update procedurally. If I were able to treat Alembic this way, that would be great.

It's also because I was looking to use this as a means of updating an alembic path and have it's output updated, but it is my understanding that the node itself doesn't support having it's input file-path modified, which is just another cherry on the top gone missing..

I did notice the "connect" option on AlembicImport and was planning on having a look at this next.


For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Reply all
Reply to author
Forward
0 new messages