On this page

The plug-in supports both inputting and outputting Maya mesh.

Input

Maya mesh is input into a Houdini asset as polygons. When inputting a Maya mesh, the plug-in also includes various other information of the mesh as additional Houdini geometry attributes.

Normals

Attribute

Type

Description

N

vertex float3

Stores the normals of all the vertices

maya_locked_normal

vertex int

Stores whether the normal of the vertex is locked. If the value is non-zero, then the normal is locked. If the value is 0, then the normal is unlocked

maya_hard_edge

vertex int

Stores whether the edge represented by the vertex is a hard edge. In Maya, this is a property on the edge. However, since Houdini doesn’t have the concept of edge attribute, the property is stored on the first vertex of the edge. If the value is non-zero, then the edge is a hard edge. If the value is 0, then the edge is smooth

When building an asset, the Convert Maya Hard Edge to Group shelf can be used to convert the maya_hard_edge vertex attribute into the maya_hard_edge edge group. This allows the rest of the asset to work with hard edges as an edge group representation, which is often simpler to work with

UVs

Attribute

Type

Description

uv, uv2, uv3, …

vertex float3

Stores the UVs of the vertices. Each UV set is stored as a different attribute

maya_uv_name

detail string tuple (size is the number of UV sets)

maya_uv_mapped_uv

detail string tuple (size is the number of UV sets)

This can be used by the asset to lookup the name of the original UV set from Maya. The maya_uv_name stores the original name of the UV sets in Maya, and the maya_uv_mapped_uv stores the name of corresponding vertex attribute in Houdini. The two strings should have the same number of elements.

For example, if the asset expects a Maya UV set named dirt. First, the asset would search the maya_uv_name string for dirt, which might be the second element. Then, the asset would access the second element of the maya_uv_mapped_uv string for the corresponding name of the Houdini attribute, which might be uv2.

maya_uv_name

detail string

stores the name of the current UV set

Color sets

Attribute

Type

Description

Cd, Cd2, Cd3, …

vertex float3

Alpha, Alpha2, Alpha3, …

vertex float

stores the vertex color and alpha of each color set. The colors and alphas of each color set are stored as separate attributes. The Alpha attribute is only present if the Maya color set contains alpha

This set of attributes can be used by the asset to lookup the name of the original color set from Maya. The maya_colorset_name stores the original name of the color sets in Maya, and the maya_colorset_mapped_Cd and maya_colorset_mapped_Alpha stores the name of corresponding vertex attribute in Houdini.

For example, if the asset expects a Maya color set named diffuse. First, the asset would search maya_colorset_name for diffuse, which might be the second element. Then, the asset would access the second element of maya_colorset_mapped_Cd for the corresponding name of the Houdini attribute, which might be Cd2.

Attribute

Type

Description

maya_colorset_name

detail string tuple

size is the number of color sets

maya_colorset_mapped_Cd

detail string tuple

size is the number of color sets

maya_colorset_mapped_Alpha

detail string tuple

size is the number of color sets

maya_colorset_current

detail string

stores the name of the current color set

maya_colorRep

detail string tuple

size is the number of color sets

This attribute keeps track of the color representation of each of the mapped color sets. It uses the Maya UI representation names: RGBA, RGB, and A. While we also determine whether or not to create the corresponding Cd and Alpha attributes based on the incoming color representation, it seemed more straightforward to keep the representation explicitly than to reconstitute it from the color mapping on output.

Note

While Maya supports empty and partial color sets, houdini does not, so any unset colors are initialized to a default (black for unset RGB and RGBA going in to Houdini, white going back to Maya if there is only Alpha in houdini), and unset alpha is set to 1.

Shading Groups

Attribute

Type

Description

maya_shading_group

primitive or detail string

stores the name of the shading group that is assigned to the object, or to each polygon

Component Selection

When mesh components are selected doing addToSelection on an input, the inputComponents attribute is set on the inputGeometry node, and corresponding groups are created on the input geo. The asset still needs to use the named component group for it to have any effect. The inputComponents attribute is a componentList attribute, so that while it doesn’t show up in the attribute editor, it can be set like this:

setAttr houdiniInputGeometry1.inputComponents -type "componentList" 5 "f[106:116]" "f[126:136]" "f[146:156]" "f[166:176]" "f[186:196]" ;

getAttr houdiniInputGeometry1.inputComponents;
// Result: f[106:116] f[126:136] f[146:156] f[166:176] f[186:196] // 

The groups to use for component selection can be specified on the houdiniInputGeometry node once it has been created. In this example the primitive group is specified but the point group is not, e.g. if point selection is not relevant for the hda

If components are selected but no groups are specified the default groups are created:

  • inputPrimitiveComponent - selected faces

  • inputPointComponent - selected vertices

Sets

Almost all Maya sets that the mesh belongs to are converted into Houdini primitive groups. Certain types of sets that are used interally by Maya tools are omitted, since adding components from the output geo to those sets could cause incorrect tool behavior. This includes verticesOnly, edgesOnly, editPointsOnly and renderableOnly sets. An option has been added on the houdiniInputGeometry node to allow facetsOnly sets to be included.

Output

Polygons output from a Houdini asset are output as a Maya mesh. When the polygons are output, the plug-in recognizes various Houdini geometry attributes. The recognized attributes are then converted into the Maya equivalent.

Normals

Attribute

Type

Description

N

vertex float3

set the normals of all the vertices

maya_locked_normal

vertex int

set whether the normal of the vertex is locked. If the value is non-zero, then the normal is locked. If the value is 0, then the normal is unlocked

maya_hard_edge

vertex int

set whether the edge represented by the vertex is a hard edge. In Maya, this is a property on the edge. However, since Houdini doesn’t have the concept of edge attribute, the property is stored on the first vertex of the edge. If the value is non-zero, then the edge is a hard edge. If the value is 0, then the edge is smooth.

When building an asset, the Convert Maya Hard Edge to Attribute shelf can be used to convert the maya_hard_edge edge group into the maya_hard_edge vertex attribute. This allows the rest of the asset to work with hard edges as an edge group representation, which is often simpler to work with.

UVs

Attribute

Type

Description

uv, uv2, uv3, …

point,vertex float2,float3

assign UVs of the vertices. Each UV attribute is used for assigning a different UV set

maya_uv_name

detail string tuple

size is the number of UV sets

maya_uv_mapped_uv

detail string tuple

size is the number of UV sets

This set of attributes is used to map the names of the Houdini UV attributes into the names of the UV set in Maya. The maya_uv_name is used to set the name of the UV set in Maya, and the maya_uv_mapped_uv is the name of the corresponding UV attribute in Houdini. The two strings must have the same number of elements.

If you are adding mapping information to a mesh created in houdini, or adding new UVsets to output on a mesh created in maya, you can use a python node to create or set the size of the string attributes. (see the color example for more details)

maya_uv_current

detail string

set the current UV set

Color sets

Attribute

Type

Description

Cd, Cd2, Cd3, …

detail, primitive, point, vertex float3

Alpha, Alpha2, Alpha3, …

detail, primitive, point, vertex float

set the vertex color and alpha of each color set. The Alpha attribute is optional

maya_colorset_name

detail string tuple

size is the number of color sets

maya_colorset_mapped_Cd

detail string tuple

size is the number of color sets

maya_colorset_mapped_Alpha

detail string tuple

size is the number of color sets

This set of attributes is used to map the names of the Houdini Color and Alpha attributes into color sets in Maya. The maya_colorset_name sets the name of the color sets in Maya, and maya_colorset_mapped_Cd and maya_colorset_mapped_Alpha are used to map the color and alpha attributes in Houdini to the corresponding color set in Maya.

If you are adding mapping information to a mesh created in houdini, or adding new color sets to output on a mesh created in maya, you can use a python node to create or set the size of the string attributes: e.g.

cs_mapped_Cd = geo.addAttrib( hou.attribType.Global, "maya_colorset_mapped_Cd", "Cd")
cs_name = geo.addAttrib( hou.attribType.Global, "maya_colorset_name", "NewCol")
cs_mapped_Alpha = geo.addAttrib( hou.attribType.Global, "maya_colorset_mapped_Alpha", "Alpha")
cs_mapped_Cd.setSize(2)
cs_name.setSize(2)
cs_mapped_Alpha.setSize(2)
geo.setGlobalAttribValue( "maya_colorset_mapped_Cd", ("Cd", "Cd2") )
geo.setGlobalAttribValue( "maya_colorset_name", ("NewCol","NewCol11"))
geo.setGlobalAttribValue( "maya_colorset_mapped_Alpha", ("Alpha", "Alpha1"))

Attribute

Type

Description

maya_colorset_current

detail string

set the current color set

maya_colorRep

detail string tuple

size is the number of color sets

If you have added new color attributes that did not come from Maya, the maya_colorRep attribute can be used to set the color representation on the output color sets, and to determine which color channels to set on the output. It uses the Maya UI representation names: RGBA, RGB, and A. If maya_colorRep is not found, or it’s not valid, or if there is no mapping specified for the color sets, the resulting color set will be RGBA

Shading Groups and Materials

Attribute

Type

Description

maya_shading_group

primitive string

assign the named shading group in Maya to the polygon. The shading group must already exist in the scene

If your HDA has materials where file textures are being baked out for Maya, we recommend that in Maya’s Display Preferences you set the MaterialLoadingMode to Immediate in order to be able to see the changes to the output textures updating

Sets

All Houdini primitive groups are converted into Maya sets. If a Maya set doesn’t already exist, it will be created.

Note

Houdini groups can easily change from one cook to the next. Since Maya sets are created and modified at the Dependency Graph level, it is more rigid than Houdini groups. So outputting Houdini groups this way suffers from the sync issue. If a Houdini group changes, this change will not be reflected in Maya until a sync happens.

Unsupported Polygons

Geometries that are output by an asset may occasionally contain polygons that are not supported in Maya. These polygons have multiple vertices referring to the same point, which are used in Houdini for bridges and holes. A common source of these polygons is fractured geometry.

Maya will internally convert these polygons. However, this leads to the topology being changed, and as a result other Houdini attributes (like UVs and colors) can no longer be applied to the converted polygons. When the plug-in detects such polygons, it will print out a warning message.

Multiple Pieces

Input

Multiple Maya meshes can be connected to each asset input. It is possible select a hierarchy, or multiple objects, and do Set to Selection. Each mesh shape is input separately, and all the inputs are then joined together on the Houdini side using a Merge SOP. To add or remove inputs, select the desired inputs and Set To Selection again.

Output

When outputting geometry from Houdini, you may want to want to split up the geometry so that they become Maya mesh objects. For example, when fracturing geometry. Unfortunately, there is no ideal solution at the moment, but there are some workarounds you could try.

One way is to make use of Houdini groups. The asset would put the separate pieces into separate Houdini groups, which would then be converted into Maya sets. Then inside Maya, the Maya sets can be used to identify and manipulate the individual pieces.

Another way is to use Maya’s Edit Mesh → Separate to separate the mesh into different objects. However, this is only possible if the pieces are already separate shells.

Maya

Getting started

Input and Output Geometries

Using Houdini Engine for Maya

Reference