Most suitable when you need real-time update, and you want the update to occur automatically without having to track down every single changes. MObject curr_node = dg_it.currentItem(&status) Static_assert( std::is_same::value,"not Vec3" ) īool find_node_of_type(MPlug source_plug, You must set both vertexColor and vertexFaceColor to the same color to change a vertex' color: int $nb_verts = `polyEvaluate -vertex pCylinder1` This list size equals the number of faces adjacent to $i vertexFaceColor is a sparse list of the "face-vertex" indices So, the structure of the node pol圜olorPerVertex attributes is as follows: // vertexColor contains list every vertex indices This knowledge will be needed to implement faster access through C++ and MPlug. Here I explain how to directly access the colors through attributes. # pol圜olorSet -currentColorSet -colorSet "colorSet1" Īlthough using the command line is the easiest way to change colors programatically it is quite slow. For instance change the active color set to "colorSet1" using: You can manage color sets (creation, deletion etc.) with pol圜olorSet. This will change the per vertex color of the currently active color set, or create a new color set along with necessary dependency nodes (e.g. But most likely your mesh is going to be the end result of another node (skin cluster, subdivision, poly node generation etc.) and in this case an intermediate node of type pol圜olorPerVertex will be placed right before inMesh. If your mesh node does not receive any input mesh in his attribute inMesh then color sets and color values will be stored directly into the mesh node. You can manage the sets of colors through the UI with: Mesh Display ➞ Color Set Editor Maya allows you to define several color sets associated to a single mesh. You can check wether or not the shade mode is enabled/disabled by checking the mesh attribute displa圜olors with the MEL command: getAttr "mesh_name.displa圜olors" Color set Or call the MEL equivalent: toggleShadeMode(). Maya 2016 = Mesh Display ➞ Toggle Display Colors Attribute. To display per vertex color in Maya's viewport, select the mesh and enable in Maya's menu: Code snippet in C++ to be able to update the color of a mesh with Maya API on a per vertex basis.
0 Comments
Leave a Reply. |