Wrote something cool, implemented all the required method, doIt() and redoIt works , undoIt() don't.
When I undo the object disappear, why ??? I didn't touch anything related to object visibility, I even tried to refresh the viewport , still nothing... In doIt/redoIt method I use setVertexNormals() MStatus <http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_status.html> setVertexNormals ( MVectorArray <http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_vector_array.html> & *normalsIn*, MIntArray <http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_int_array.html> & *vertexList*, MSpace::Space <http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_space.html#ab11a1dda34491acff014ddfc9e6bafb8> *space* = MSpace::kObject <http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_space.html#ab11a1dda34491acff014ddfc9e6bafb8ad74f4c7c6562dc3f8339a8bba2d28dd0> ) Set Shared Normals for these vertices. The length of the normalsIn array should be same as the length of the vertexList array. Parameters [in] normalsIn The normals to set [in] vertexList The object-relative (mesh-relative/global) vertex indices to set them for [in] space World space or Object space as you can see it doesn't take a MDGModifier but setVertexNormal do : MStatus <http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_status.html> setVertexNormal ( MVector <http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_vector.html> & *normalIn*, int *vertexId*, MSpace::Space <http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_space.html#ab11a1dda34491acff014ddfc9e6bafb8> *space* = MSpace::kObject <http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_space.html#ab11a1dda34491acff014ddfc9e6bafb8ad74f4c7c6562dc3f8339a8bba2d28dd0>, MDGModifier <http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_d_g_modifier.html> * *modifier* = NULL ) Set Shared Normal for this vertex. Parameters [in] normalIn The normal to set [in] vertexId The object-relative (mesh-relative/global) vertex index to set it for [in] space World space or Object space [in,out] modifier Since this method may modify the DG, if you wish to undo its effects, you need to keep track of what needs to be undone. If the modifier is non-null, and this MFnMesh <http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_fn_mesh.html> refers to a shape, then it will add the command to be undone to the modifier. Use MDGModifier::undoIt <http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_d_g_modifier.html#a0789a8d51244cad0495abb2b811c39db> to undo the effects of this method. setVertexNormal is a pain in the ass performance wise, so I don't want to use it... -- 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/01a5ef8d-1cb4-4d56-a2b5-3573cb2514e9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
