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?
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 while it’s really simple in Houdini, I can’t find any doc for maya about this topic.
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 ).
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.
@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
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…