Transfering Material extra attribute between Maya and Houdini

   4375   4   0
User Avatar
Member
42 posts
Joined: Aug. 2016
Offline
I have been thinking a workflow to resolve this in the past a few days. Would be appreciated if you could help me along the process.

1. I have created an ‘extra attribute’ ( a string, for example a path to a file) to a Maya lambert material. The extra attribute is to be read by our custom game engine later.
2. Exported object with the material assigned, as fbx or any other format, I don't really mind.
3. Import object in Houdini. The material has been successfully imported in Houdini, but is there a way to keep the ‘extra attribute’ from Maya on the material to be accessible in MAT/Shop as an attribute ?
4. Do the mesh editing or whatever, export the object with the same Material assigned.
5. Import object back in Maya, open the material, Would it be possible to have the ‘extra attribute’ transferred nicely ?

Is there a workflow for such a case ? Much appreciated.
Edited by cgmagic.sunhe - March 9, 2017 18:34:28

Attachments:
Untitled.png (11.5 KB)

User Avatar
Member
17 posts
Joined: Jan. 2008
Offline
Pretty sure alembic is capable of this, under the export options there's a bit for extra attributes, but getting it all running smoothly will probably take some scripting both ends.
User Avatar
Member
42 posts
Joined: Aug. 2016
Offline
Hezza
Pretty sure alembic is capable of this, under the export options there's a bit for extra attributes, but getting it all running smoothly will probably take some scripting both ends.

Thanks Hezza, however, I think the Alemtic format does not contain material, and I need the extra atrribute under the material not the geo.

Cheers
Edited by cgmagic.sunhe - March 10, 2017 05:33:49
User Avatar
Member
260 posts
Joined: Nov. 2014
Offline
We are using custom attributes to create group for shading. (create groups in Maya and shade them in houdini)

This script might help.
Feed it into attribute create node value (set to primitive, string)




import _alembic_hom_extensions as abc

def getAbcAttr(attrName, useTransform=False):
“”“
Gets an alembic attribute from the cache
Requires an ‘abcFileName’ detail attribute

@attrName: name of attribute to retrieve
@useTransform: looks on the parent node instead. Equivalent to using maya's transform instead of shape
”“”
geo = hou.pwd().curPrim().geometry()
if geo.findGlobalAttrib(“abcFileName”) is not None:
abcPath = geo.attribValue(“abcFileName”)

path = hou.pwd().curPrim().attribValue(“path”)
if useTransform:
path = path.rsplit(“/”, 1)

x = abc.alembicArbGeometry(abcPath, path, attrName, 100)
if x:
return x
else:
return ‘'

return getAbcAttr(’ATTRIBUTE_NAME', useTransform=True)
User Avatar
Member
17 posts
Joined: Jan. 2008
Offline
cgmagic.sunhe
Hezza
Pretty sure alembic is capable of this, under the export options there's a bit for extra attributes, but getting it all running smoothly will probably take some scripting both ends.

Thanks Hezza, however, I think the Alemtic format does not contain material, and I need the extra atrribute under the material not the geo.

Cheers

Yeah I don't think you're going to find an out the box solution, going to take some scripting and development I reckon.
  • Quick Links