6/11/2023 0 Comments Maya colorset script![]() ![]() This does require that a colorSet with the specified name exist. Work on, to be the color set corresponding to the name specified with theĬolorSet flag. ![]() This flag when used will set the current color set that the object needs to IfĪ color set with that name already exists, then no new color set will This flag when used will result in the creation of an empty color setĬorresponding to the name specified with the colorSet flag. To the name specified with the newcolorSet flag To name specified with the colorSet flag to the colorSet corresponding ![]() This flag when used will result in the copying of the color set corresponding This flag has to be specified for this command to do anything meaningful Specifies the name of the color set that this command needs to work on. This flag specifies if the color set will truncate any value that is This flag when used in a query will return a list of all Keywordspoly, colorSet, currentColorSet, renameColorSet, deleteColorSet, cop圜olorSet, createColorSetįlags allColorSets, clamped, colorSet, copy, create, currentColorSet, currentPerInstanceSet, delete, newColorSet, perInstance, rename, representation, shareInstances, unshared Long name (short name) In query mode, return type is based on queried flag. query the representation value or clamped value of the current color set query the name(s) along with representation value(s) modify sharing between instances of per-instance color sets set the current color set to a pre-existing color set. Pol圜olorSet is undoable, queryable, and editable.Ĭommand to do the following to color sets: Note: Strings representing object names and arguments must be separated by commas. MFnMesh mesh_fn ( houtput.asMesh(), &status) įor (geom_it.reset() !geom_it.isDone() geom_it.Go to: Synopsis. MDataHandle houtput = out_array.inputValue(&status) MArrayDataHandle out_array = block.outputArrayValue(MPxDeformerNode::outputGeom, &status) MStatus Inherits_mpxdeformer::deform(MDataBlock& block, Instead use setVertexColor s() it's faster anyway. The main trick is to not forget to call MPxDeformerNode::setDeformationDetails() note that setVertexColor() sometimes won't work for some strange reasons. Next I show how to change vertex color with Maya API inside a MPxDeformerNode deformer node. In this case you need a node to ensure the color stays the same even when the dependency graph is re-evaluated. per vertex color may get overwritten by some upstream nodes like a skin cluster.debug a node deformer by visualizing the algorithm's result.Using a node allows to detect easily any change through the node's attributes. 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().
0 Comments
Leave a Reply. |