# 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 setEdgeSmoothings
| ( | const MIntArray & | edgeIds, | |
| const MIntArray & | 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.
| [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. |
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 setEdgeSmoothings
( const MIntArray & edgeIds, const MIntArray & 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.
- Returns
- Status code
- Status Codes:
- MS::kSuccess The method was successful.
- MS::kFailure An object error has occurred.
- MS::kInvalidParameter 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 python_inside_m...@googlegroups.com.
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.
| ( | ) |
setEdgeSmoothings(edgeIds, smooths) -> self Sets the specified edges to be hard or smooth. You must use the cleanupEdgeSmoothing() method after all the desired edges on your mesh have had setEdgeSmoothings() done. Use the updateSurface() method to indicate the mesh needs to be redrawn."
there is no reason for Python 1.0 to not have such a simple thing, I searched on google before and no one talks about edge smoothing in the API..
edit : OMG It's a new feature in Maya 2017 Update 3
here is it :
http://help.autodesk.com/view/MAYAUL/2017/ENU/?guid=__files_GUID_20D778B6_325A_4B06_B4A8_AE60D8DAB43D_htm
guess I'll have to use setEdgeSmoothing without the s for compatibility matters
thanks!