Also, I think that using references as Marcus suggested sounds like a good
solution for this particular problem. I just wanted to give you an example
of how to use the Python API.

/R


On Tue, Nov 18, 2014 at 10:40 AM, Risto Jankkila <[email protected]>
wrote:

> Hi,
>
> unfortunately it's nothing like the bridge command.
>
> Here's a simple example of using MFnMesh.addPolygon() from Python API 2.0:
>
> --
> import maya.api.OpenMaya as om
>
> # Assuming an object called pPlane1 exists
> kObjectName = "pPlane1"
> kMergeDistance =  0.01
>
> # Get our objects dagPath
> sel = om.MSelectionList()
> sel.add(str(kObjectName))
> dagPath = sel.getDagPath(0)
>
> # Pass dagPath to MFnMesh constructor
> meshFn = om.MFnMesh(dagPath)
>
> # Create a list of arbitrary points
> vtx1 = om.MPoint(1, 0, 0)
> vtx2 = om.MPoint(0, 1, 0)
> vtx3 = om.MPoint(0, 0, 1)
> vertexArray = [vtx1, vtx2, vtx3]
>
> meshFn.addPolygon(vertexArray, True, kMergeDistance)
> --
>
> As you can see I'm passing a list of arbitrary points to the
> addPolygon-method.  In your case you would have to retrieve those positions
> by using getPoints-method (for example). The MFnMesh-class also has a
> getHoles()-method that may or may not be useful for you :)
>
> Cheers,
> Risto
>
>
>
> On Mon, Nov 17, 2014 at 4:32 PM, sam williams <[email protected]>
> wrote:
>
>>
>> Cool, all good advice. Will look into reference files as well. You know
>> with the api. I get a bit stuck understanding how to write the methods out.
>> if i was using the addPolygon method. how do you specify the edges you need
>> filled. does it imitate the bridge command in the same way?
>>
>>
>> MObject MFnMesh::addPolygon (const MPointArray & vertexArray,
>> bool mergeVertices = true,
>> double pointTolerance = 1.0e-10,
>> MObject parentOrOwner = MObject::kNullObj,
>> MStatus * ReturnStatus = NULL
>> )
>> Thanks,
>> Sam
>>
>> --
>> 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/678546d1-e0e8-451f-adcd-a2dc535ce34e%40googlegroups.com
>> <https://groups.google.com/d/msgid/python_inside_maya/678546d1-e0e8-451f-adcd-a2dc535ce34e%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/CA%2B5uDBbFb26Ww_EPYdxNdX%3D%3DKx0A6XMSg45cbEUyz%3DhFJdopCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to