Last active
November 19, 2015 09:50
-
-
Save lukpazera/d92b01e6879b04c83997 to your computer and use it in GitHub Desktop.
Accessing base and evaluated meshes in MODO.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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