How to properly export/import meshes and SubDs with texture coordinates?

hi there,

I’m currently trying to figure out how to properly export meshes and SubD to any file format with the correct texture coordinates. Why you ask? I’d like to do modeling in Rhino, then be able to export the geometry to other DCC apps for rendering, animation, that kind of stuff.

There are a few issues I cam across:

1. Split texture coordinates / UV islands

  1. Create a 2x2 mesh plane
  2. Use the Unwrap command with UnweldSeams=No and select two seams in the middle, either horizontal or vertical to split the UVs.
  3. Open the UVEditor and scale one of the two mesh islands

You should end up with something like this:
image

I’ve tried exporting this to obj, fbx, usd and some other formats without success. Opening this in e.g. blender will result in this:
image

The file is only exported with one value per vertex for the texture coordinate and doesn’t export discontinuous texture coordinates. The file formats support this. Also tested with exports from other software, where this isn’t an issue.

2. Export of SubD

  1. Simply use ToSubD on the above mesh

FBX and USD support subdivision in the file format, however the exporters in Rhino both convert/mesh them to a mesh with a certain subdivision level (option during export).
It would be great if SubDs would be exported as such to these formats as best as possible. This keeps file sizes small and allows for further edits in other apps without having to manipulate a dense mesh.

The OBJ exporter has an option to export the control cage, but that doesn’t export texture coordinates. Which brings me to the next point.

3. Texture Coordinates for SubDs
First of, lets try the mesh from point 2.
FBX to blender:
image
USD to blender, huh?:
image

Now lets run the Unwrap command on this again in Rhino to get here:
image
USD or FBX to blender:
image

Cool, so something works, but as mentioned in 2. this is a mesh, not a SubD.

4. SubD Creases

Now I haven’t tested anything here yet, as I havend’t found a way to export SubDs as such. However, I want to mention it here as well.
It would be great to be able to export SubDs with creases as well. In my experience, this is usually done as some kind of vertex map.

I know, that there is some room for interpretation with SubDs and different apps implement some parts differently. Nevertheless, it would be great to be able to export this information somehow to get it out of Rhino. I believe, that there will always be problems with export/import in 3D software, but as long as the information is all there, the rest can be covered with scripts before or after import/export.

I appreciate any help and pointers. Let me know if something is wrong, I’ve been exporting/importing way to much today, mistakes may have snuck in.

Also curious to see how you may be dealing with this.

Thanks,
Bernd

Edit: this is on Rhino 8.2.23346.13001

I’ll continue here with a look at importing meshes and SubDs.

1. Import meshes
This is a similar mesh (as above in 1.) created in blender, plane with 4 polygons, 9 vertices and split UVs.
image image
Exported as OBJ, imported in Rhino, result in a mesh with 12 vertices, UVs are imported as expected.

Now lets test this with FBX, same mesh as above: A wild vertex appeared! Cool, there are now 13 vertices.

This means, importing split UVs will also split the mesh, which in my opinion is not ideal as it changes the mesh itself. Editing the mesh in Rhino behaves as if the mesh is not split (/unwelded), which I don’t understand. Why would I unweld a mesh in the first place if I can’t move the faces seperately afterwards?

2. Import SubDs
Slightly modified mesh from 1. with SubD:
image

Exported as FBX, import into Rhino:
image

It’s there, but not imported as a SubD, simple to fix, but annoying for proper production cases where there there can be hundreds of meshes and SubD in a scene, mixed together.

The FBX importer provides an option to import meshes as SubD, cool…:
image
…but using this will remove transforms and convert all meshes and UVs are not imported correctly:
image

To show, that other software can handle this, here is a screenshot after importing into Modo:
image image

Boundary rules are different in Modo by default, using creased edges by default, rather easy fix, can also be scripted.

Overall, this is a little frustrating for me, as some of the UV tools in Rhino are quite nice (e.g. curve constraints). Currently the exporting meshes and SubDs is more important for me, though there will likely be cases where we will import them into Rhino as well.
Currently these points limit us from properly using Rhino and all its tools. I’m happy to provide more use cases and examples. For this topic I kept it simple to show the actual problem we are facing without any distracting stuff and to easily reproduce it.

I’ve also looked into other ways to get it working, but ran into more issues, see here: How to get UVs for SubD with RhinoCommon or rhino3dm.py? - Rhino Developer / rhino3dm - McNeel Forum

For now this means I will have to jump to other tools for UVs as I can’t get them out of Rhino.