- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Everybody,
3ds Max SDK :
I have a mesh object created using the Mesh class. I am trying to set face colors using setMapVert for the mesh.
I found some code in MaxScript (https://forums.cgsociety.org/t/vertex-color-in-viewport-max-2009/1563863/4), when I tried this without converting into either poly or mesh, then colors changes are not happening. If I convert my mesh into poly or mesh, then, the script is working fine.
I tried to implement this using SDK, but i am getting the same result which i got while running the script (not converting to poly or mesh)
The following codes, added as a script (for testing)
setCVertMode $ on
$.vertexColorType = 5
$.vertexColorMapChannel = 1
meshop.setmapsupport $.mesh 1 on
meshop.applyuvwmap $.mesh #face channel:1
The following, i have added in sdk.
the_mesh.setMapVert(1, the_mesh.faces[fIdx].v[0], clr);
the_mesh.setMapVert(1, the_mesh.faces[fIdx].v[1], clr);
the_mesh.setMapVert(1, the_mesh.faces[fIdx].v[2], clr);
I am updating the mesh and calling redrawviews also.
Is this the method of implementing? What i am doing wrong?
can anyone please suggest me ideas how to implement this logic?
Regards,
Gopinath.
Solved! Go to Solution.