Jump to content

Mesh Face Numbers in Maya


You are about to reply to a thread that has been inactive for 2411 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

How do the face number assignment works in Maya?
I need control over which face number is assigned to a certain face on my object.
For example:
In a shirt with a tie, I need the tie to be face 0, the shirt front face 1, and so on.
Then I model a shirt with rolled up sleeves, and need it to use the same face numbers for the same shirt parts. Tie 0, and so on. Any clues? Thanks a lot!

Link to post
Share on other sites

Try naming the Lambert that is applied to the tie 0 or "A" and the Lambert applied to the shirt name it 1 or "B".

I think that should work.  If not they you may have to edit the DAE file in a word processor program just don't use Microsoft Word because it has a tendency to save it in a word format instead of a DAE format them you save your changes.

I hope that helps. :)
Cathy

Link to post
Share on other sites

I am sorry Limer. I am completely stumped. :(

I tried editing the DAE file in ever way I could think of with no luck. :matte-motes-crying:

After two and a half hours I give up.

I know in Blender it can be done so I don't know why it can't be done in Maya.

I will be following this thread to see if anyone comes up with a solution.

I take it you are using some sort of script in your mesh and can't edit the script to the appropriate faces?

I hate not being able to figure something out that should be fairly easy.

Link to post
Share on other sites

Hey, I could create a script that figures out where to put the textures, but the ideal solution would be that I can myself decide such a thing in the model. This is really strange seems like anything one could do won't change anything. Tried changing the order in which I assign the materials, tried with letters and numers on materials names, altering the order of things in the DAE, but as you said, nothing changes ever. Makes no sense to me or we are missing something.
I don't know how to use blender. 
Maybe you could do this test:

Create a simple cube and create 6 materials, one for each face with names like A1, B2, and so on. Export DAE with Maya.
Do same in Blender.

Compare and see what changes in both daes?

There must be something.
What do you think?

Link to post
Share on other sites

Here's a dae file opened in notepad++ free text editor. The advantage of an editor like this is that you can tell it it's XML (which dae is) with the language menu. Then it will let you collapse sections as I have done here, and do the proper syntax highlighting. It's also guaranteed to save only on proper text format. This is produced by Blender, and the red and green boxes are the <polylist> sections for each of the two materials in this mesh. It is the order of these sections that determines the face numbers (at least, it used to be!). So swapping these two should invert their face numbers. They will always appear between <mesh> and </mesh>, and those (there may be multiple sets if there are multiple meshes) with always appear inside <library geometries>  and </library geometries> at the outermost level. There is a whole lot of other stuff defining the materials and a series of indirect links from here to that (via the material= here), but none of that matters - only the order here matters. Maya may use one of the alternatives instead of <polylist>, such as <triangles> or <polygons>, but the arrangement and effect on ordering of face numbers should be the same. It may also use a whole lot of <extra>, forMaya-specific information, tags making the arrangement less obvious.

dae_mat_edit.png

Link to post
Share on other sites

OK got it to work inside Maya! :D

Drongle pointing out it is the order in which the materials appear in the DAE file was the key.   Thanks Drongle! :D

OK there may be a better way but here is how I was able to do it in Maya without having to edit the DAE file.

1. Extract all the faces of the different materials so each material is a separate object.
     In your case you have two materials.  One for the shirt and one for the tie.  So extract the tie faces from the shirt making them separate objects not just one object with two materials with boarder edges.  The extract function under the Mesh menu has an option to either "Separate Extracted Faces" or not.  If this is not checked then the selected faces of the tie will not become a separate object.

2. Once separated into two objects delete history of each object.  Then, in object mode, select the object you want to be FACE 0 in SL first.  Then while holding down the SHIFT key click on the object you want to be FACE 1 in SL.

3. Under the "Mesh" menu click "Combine".  Then click the "Edit Mesh" menu and click "Merge".  NOTE: This will make the edges where the two object combine hard edges so you may need to soften these edges for your particular needs.

4. Delete history of the newly combined object in this case your shirt and tie.

5. Export your mesh as a DAE file as usual. :D  NOTE: This is for mesh that isn't already rigged.

If your shirt and tie are already rigged and you don't want to rig them all over again duplicate the mesh first and separate, combine and merge as in steps 1 through 5.  Then do a quick Smooth Bind to the skeleton and then Copy Weights from your original to the duplicate but don't use the "Use smooth skin weight copy" option in the "Copy Skin Weights Options" window.  The "Copy Skin Weights" function is under the "Skins" menu > Edit Smooth Skin> Copy Skins Weights.

What you are doing when separating your mesh into separate objects and then combining them back into one object is really reordering the vertiex order.  Maya creates the DAE file by exporting the vertex in order.  Lower vertex numbers first then higher. Vertex named vtx(0) exports first.  So if the material you want to be FACE 0 is made up of 10 vetices then they need to be named vtx(0) through vtx(9) so they are exported to the DAE file first.

Here is a link to a nice little MEL script that I use that automatically separates a mesh into separate objects by materials.

http://www.creativecrash.com/maya/script/poly-split-per-assigned-shader

It is only for Maya 7 through 8 but it seems to be a simple script so it may work for newer versions of Maya as well.  New versions of Maya may even have this feature already built in.

Hope that helps. :D
Cathy

Link to post
Share on other sites

Awesome info Drongle!

I downloaded Notepad++ from CNet but when I open the DAE file I don't get the nice highlighted colors or the ability to open and close sections by clicking on + signs.

Is there a preference setting I need to use? :)

UPDATE: Never mind Drongle I found it. :)  Under "Language" menu at the top changed it to XML. :D

Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 2411 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...