Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

How can I use tesselate to match the result of Maya's tesselation?

How can I use tesselate to match the result of Maya's tesselation?

morinnicolas8944
Advocate Advocate
1,010 Views
3 Replies
Message 1 of 4

How can I use tesselate to match the result of Maya's tesselation?

morinnicolas8944
Advocate
Advocate

I need to convert a NURBS surface to a mesh that can be used by my plugin. To do so, I get the MFnNurbsSurface for the object and use MFnNurbsSurface::tesselate to get the mesh.


However, the mesh after tessellation is sometimes different from the mesh rendered by the Maya renderer. How can I get a mesh that matches the result from the Maya renderer?


I am thinking that the difference might be caused by differences in the tessellation options seen in the attribute editor when selecting the NURBS surface, or in the Render menu > Set NURBS Tesselation options on one hand and the values of MTesselationParams used for calling tesselate. But I cannot figure out if and how the 2 sets of values correspond. There is some resemblance between the names of some parameters, but many parameters do not seem to have direct equivalents.

0 Likes
Accepted solutions (1)
1,011 Views
3 Replies
Replies (3)
Message 2 of 4

lanh.hong
Alumni
Alumni

Hi morinnicolas8944,

 

You can use MFnNurbsSurface::tesselate() and MTesselationParams to convert a nurbs surface into a mesh. By default, the tessellation options are:
  • Polygon type: triangles
  • Tessellation format: standard fit
If you want the tessellation to be similar to the Maya renderer, you must use the methods provided in MTesselationParams to set your options.
 
What might be helpful is to select the nurbs surface and click Modify > Convert > Nurbs to Polygons. Look at the nurbsTessellate node and you can see the different options in the attribute editor.
 
Regards,
Lanh

Lanh Hong
Developer Technical Services
Autodesk Developer Network



Message 3 of 4

morinnicolas8944
Advocate
Advocate

Thank you. Using the nurbsTessellate node is very useful for testing values of MTesselationParams.

 

However, I am still unable to reproduce the surface rendered by Maya. For instance, there is no tesselation format matching "Simple Tessellation Options" in the Tessellation settings of the NURBS surface. I came close to approximating it by using the General format, but it's not an exact match. Of course, I can get a perfect match if I also use simple tessellation in the nurbsTessellate node, but that option is not available in MTesselationParams.

 

I included an image with a blue NURBS surface in the background and the poly generated by nurbsTessellate in transparent red on top of it. I cannot get the 2 surface to overlap exactly. I can also send the scene file if it can be useful (it can't be attached here).

 

Is there some way to match the simple tessellation?

0 Likes
Message 4 of 4

morinnicolas8944
Advocate
Advocate
Accepted solution

I was finally able to reproduce the results of Maya's tessellation by using the MEL command "nurbsToPoly" instead.

 

One important note is that the documentation for "nurbsToPoly" provides the parameters for simple tessellation in the docs for Maya 2018 and up, and the parameters for advanced tessellation in the docs for Maya 2017 and older.

But sets of parameters seem to be usable regardless of the version of Maya.