The documentation for MFnMesh::createColorSetWithName() says 

> This operation will only work when the MFnMesh 
> <http://help.autodesk.com/cloudhelp/2018/ENU/Maya-SDK/cpp_ref/class_m_fn_mesh.html>
>  refers to a shape.
>
I never understood what that meant. I now guess it means that you can't use 
that function on an object which is the output of a deformer node. There 
must be some way to do it, since I assume it's possible to create a custom 
node which adds a color set to its input, but I've never had to do it.

Sorry, that's probably not any help. It might trigger a brainwave for 
someone though.

On Saturday, 6 October 2018 10:13:28 UTC+10, miarmy wrote:
>
> hi!...i want create color set for my shape;
> but below C++ API code don't work!(The important thing is that, output 
> geometry attribute of one deformer node is connected to inMesh attribute of 
> my shape)
>
> MSelectionList sel_list;
>  sel_list.add(mesh_n);
>  MDagPath dag_path;
>  sel_list.getDagPath(0, dag_path);
>  MFnMesh shape(dag_path);
>
>
>  shape.createColorSetWithName(colorSetName);
>  shape.createColorSet(colorSetName);
>  shape.setCurrentColorSetName(colorSetName);
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/23b8ad1e-05af-47b4-8d87-084f5b918cb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to