Transferring UVs to a bound subdivision surface


Sometimes when we are on a tight schedule or inexperienced in the fine art of UV mapping, we need to squeeze a few extra days/hours/minutes into our workflow. I have painted myself into this corner before when dealing with Maya's subdivision surfaces and will now share my escape.

The texturing menu for subdivision surfaces in Maya stinks. The options are few and slow, especially compared to the Polygonal toolset. Unfortunately, sometimes a problem arises with the UV mapping of a subdivision surface once that surface has been bound and the rigging has begun. Or, sometimes there isn't enough time to tenderly arrange each and every uv the way we want to because the model needs to be rigged pronto. The following method allows the UV mapping and character rigging to be completed in parallel instead of series. This makes it possible to take a subdivision surface that has been rigged and change the UV layout at will(using an identical unbound mesh). It also allows for the unbound mesh to be non-adaptively converted to a polygonal mesh where the UVs can be easily mapped or corrected and then converted back to a subdivision surface and integrated into the bound mesh.

It is important to note that the mesh needs to remain identical and that edge creasing will be lost if the surface is converted to polygonal and then back.

Sorry for the rambling description and any confusion. I think that it will be really helpful if you look at the scene file and examine how everything is put together. The connections will begin to make sense and you will see why this works, and how simple it is. If you have any questions or problems, let me know. If you find any errors, let me know also.

Remember that the names of the nodes and will change depending on your particular scene.


Download and open THIS scene in order to follow along. (Right click the link and save it as a "uv.ma").


There are two DAG object nodes, B and Ub, that we are interested in.

B and Ub have identical control meshes.

B is bound to a skeleton and has the default UV layout.

Ub has the UVs mapped properly and is not bound. Look at the two in the UV Texture Editor.

Open the Hypergraph and go to "Options->Display" and turn on "Shape Nodes" and "Invisible Nodes".

You will find that:

  • B and Ub are parent transform nodes.
  • B has a child shape node BShape.
  • Ub has a child shape node UbShape.
  • BShape has an original shape node BShapeOrig.

    The following series of commands replace BShapeOrig with Ubshape, effectively transferring the UV map. (You will need to view the up and down stream connections to see all of the connections mentioned)

    /******************************************************/

    parent -s -r "UbShape" "B";

    /* The parent command makes the first object, “UbShape”, a child of the second object, “B”. The flag –s allows a shape to be added to the new parent, independent of the shape’s current parent DAG node. The –r flag preserves local transformations relative to the object’s parent node. The combination of the –s and –r flags, in that order, instructs Maya to place the UbShape into the DAG hierarchy of B, ignoring the Ub transform node. This is the only way to parent just the UbShape. */

    connectAttr -f "UbShape.ws" "groupParts2.ig";

    /* connectAttr connects the attributes of two dependency nodes if the types are compatible. The –f flag forces the connection if one of the attributes already has a connection. “UbShape.ws” is the output subdivision geometry of “UbShape” in world space. The group information of the components that make up a bound object is stored in a groupParts node. One attribute is the input geometry (ig). This command replaced the “BShapeOrig” node’s connection to the bound group with the “UbShape”. */

    setAttr "UbShape.io" yes;

    /* The original shape of an object is an intermediate object, which is an invisible node. This command makes “UbShape” an intermediate object of “Bshape”. Setting this flag enables functions that might rely on the presence of an intermediate object to work properly.*/

    delete "Ub" "BShapeOrig";

    /* The “BShapeOrig” shape node and “Ub” transform nodes are no longer needed so they are deleted. */

    /******************************************************/

    Copy and paste the following four lines into the script editor and hit enter on the numerical keypad.


    parent -s -r "UbShape" "B";
    connectAttr -f "UbShape.ws" "groupParts2.ig";
    setAttr "UbShape.io" yes;
    delete "Ub" "BShapeOrig";

    Now select the remaining surface and you will notice that the UVs are arranged now.

    As far as I can tell, there are no ill effects from this method. If by chance you do find something, please tell me.

    Don't worry, you will know when a situation arises that will require a solution like this.

    Thanks for reading.

    ww

    home