MEL How-To #56 | ||
| ||
How do I determine which UV Set is being used to derive the UVs for the Texture of a given face component?Given a textured polymesh face component, there are five steps to determine the UV Set used to derive its UVs:
The first three steps can be accomplished using: getFacetSG(); getMaterialFromSG(); getTextureFromMaterial();These are all described in the How-To: The ‘ uvLink ’ MEL command is used to determine the relationship between a Texture and a UV Set.
You may query the relationship for all UV Sets or for the UV Set in a specific object.
To perform the latter, specify the −queryObject flag with the uvLink command.
string $object = "pSphere1"; string $texture = "myTexture"; // example, as returned from getTextureFromMaterial() string $uvSetPlug[] = `uvLink -queryObject $object -texture $texture`; // Result: pSphereShape1.uvSet[0].uvSetName // By my observations UV Set linking is mutually exclusive. Linking a UV
Set to one Texture (or linking a Texture to a UV Set) will unlink any
previous relationship. Thus you may expect there to be a 1:1
relationship. In short, if you query a uvLink for a single object you
will get only one ‘ The last step is to query the plug returned by ‘ getAttr $uvSetPlug[0]; // Result: map1 // Related How-To's | ||
Copyright ©2005 by Bryan Ewert, maya@ewertb.com Maya is a Registered Trademark of Alias |