Skip to content

Instantly share code, notes, and snippets.

@lukpazera
Last active November 19, 2015 09:50
Show Gist options
  • Save lukpazera/d92b01e6879b04c83997 to your computer and use it in GitHub Desktop.
Save lukpazera/d92b01e6879b04c83997 to your computer and use it in GitHub Desktop.
Accessing base and evaluated meshes in MODO.
unsigned index;
CLxUser_Scene scene;
CLxUser_ChannelRead rchan;
CLxUser_Mesh umesh;
// Base mesh is CLxUser_Mesh
if (LXx_OK(item.ChannelLookup (LXsICHAN_MESH_MESH, &index))) {
item.GetContext (scene);
scene.GetChannels (rchan, LXs_ACTIONLAYER_EDIT);
if (rchan.Object (itm, index, umesh))
// umesh is the mesh interface.
}
// Evaluated mesh comes as mesh filter and mesh interface has to be obtained from the filter.
int index = item.ChannelIndex (LXsICHAN_MESH_MESH);
if (index != -1)
{
CLxUser_Mesh mesh;
CLxUser_MeshFilter mfilt;
if (rchan.Object (item, index, mfilt) && mfilt.test () && mfilt.GetMesh (mesh) && mesh.test ())
{
// mesh is your mesh item.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment