Maya - Recreate a mesh procedurally

Hi,
I need to re create some meshs procedurally in Maya.

  • I have some meshs
  • I want to recreate exactly the same meshs from scratch (same vertex order, winding order, etc… basically, blendshapes, uv and skinweights from the source meshs must work on the new meshs).

I saw some informations about that in this topic, but I doubt I’ll be able to keep the vertex order with the techniques described here.

Is there a way to grab the vertex / faces datas from a mesh and recreate it with those needs?

Thanks

Hello Ben,
Why not just copy the mesh?

The meshs are created by someone else’s tool and cause problems in the pipeline (even if maya show them as just a transform and a shape, alembic will fail to “initialize” the shapes when exporting.

I don’t have control over this other tool.

The meshs are pretty simple (not a lot of vertex), so i don’t think recreating them would be too heavy.

Plus i’m a bit curious about how to do that in maya :slight_smile: while it’s really simple in Houdini, I can’t find any doc for maya about this topic.

Ok, that makes sense!
The first thought was to use Houdini for that :slight_smile:

Sometimes export to obj and import back helped with such cases.

I’ve got some stuff that does that.
It does a little trick to create the object. It creates a plane using cmds, but then it overwrites that mesh data using the api. It’s a little hack that will let undo work (but not redo. Redo will just recreate the original plane :slight_smile: ).

There’s other functions in that file for quickly getting data from a mesh. It uses numpy in some places, but it shouldn’t be too hard to remove that dependency if you need to.

1 Like

Do you have an example how this does work in Houdini?

@tfox_TD Thanks a lot for sharing that, it’s awesome!

I ended up following @kiryha advice and setuped an automatic export / import as FBX to clean them up , as I sadly have some deadlines to match… But I’ll definitly test this out over the weekend :slightly_smiling_face:

EDIT: just had the time to test it, it works perfectly out of the box. Thanks a lot.

I found the origin of my initial problem : the meshs were originally created with transformatilns in the offset matrix transform nodes, which apparently are not supported by FBX or ABC, even when exporting in world.

@mudoglu In Houdini, I achieved that with VEX. I don’t have any code to share as it was in another company, but basically the idea is to :

  • grab data from your source (for each point, get P, neighbours() and pointprim() )
  • recreate each point and connect them with your neighbours arrays with addpoint / create the faces with addprim

The important part is to keep a consistant @ptnum and connections between the meshs.
Winding order was a bit more complicated if I remember correctly…

Shane on the Bifrost Discord created a graph for it. And did a short explaination how its done.

If @mudoglu 's graph works that seems like a good way to do it. But – old dog that I am – i’d put in a good word for the dirty-ol-bastard method:

  1. export to obj
  2. remport and replace original
1 Like