import maya.OpenMaya as om
msh=om.MSelectionList()
om.MGlobal.getActiveSelectionList(msh)
mshdp=om.MDagPath()
msh.getDagPath(0,mshdp)
meshfn=om.MFnMesh(mshdp)
edgelist=om.MIntArray()
for i in xrange(meshfn.numEdges()):
edgelist.append(i)
smooths=om.MIntArray(edgelist.length(),1)
meshfn.setEdgeSmoothings(edgelist,smooths)
meshfn.cleanupEdgeSmoothing()
trying to get every edges to be smooth , and getting this error :
// Error: setEdgeSmoothings
# Traceback (most recent call last):
# File "<maya console>", line 16, in <module>
# File
"S:\Maya_2017_DI\build\Release\runTime\Python\Lib\site-packages\maya\OpenMaya.py",
line 6041, in <lambda>
# File
"S:\Maya_2017_DI\build\Release\runTime\Python\Lib\site-packages\maya\OpenMaya.py",
line 54, in _swig_getattr
# AttributeError: setEdgeSmoothings //
with no feedback on what's wrong, setEdgeSmoothings don't work in Python ?
both edgelist and smooths have equal length...
what's the doc says :
MStatus
<http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_status.html>
setEdgeSmoothings
( const MIntArray
<http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_int_array.html>
& *edgeIds*,
const MIntArray
<http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_int_array.html>
& *smooths*
)
This method sets the specified edges to be hard or smooth (soft).
You must use the *cleanupEdgeSmoothing* method after all the desired edges
on your mesh have had setEdgeSmoothing done. Use the *updateSurface* method
to indicate the mesh needs to be redrawn.
Parameters
[in] edgeIds The edges to set the smoothing information for
[in] smooths If true the edges will be smooth (soft), otherwise the edges
will be hard. ReturnsStatus code Status Codes:
- *MS::kSuccess
<http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_status.html#a02ab596f4febca68da503aaf8dde3a80af0536797208144380691e2b376ffc1d1>*
The method was successful.
- *MS::kFailure
<http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_status.html#a02ab596f4febca68da503aaf8dde3a80a1ef6c2d725fb4bec3e7e840d28adbc00>*
An object error has occurred.
- *MS::kInvalidParameter
<http://help.autodesk.com/cloudhelp/2017/ENU/Maya-SDK/cpp_ref/class_m_status.html#a02ab596f4febca68da503aaf8dde3a80af8c5f748892ec74b32719c8fba7767e1>*
The length of edgeIds does not match smooths.
--
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/6b26af6d-d8c1-4b2d-b8a1-5a6f1496786f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.