<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Issues with MFnMesh object in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/issues-with-mfnmesh-object/m-p/14202038#M18217</link>
    <description>&lt;P&gt;No AD employee will tell you. Its unpredictable and the only save way is to reset the function set to the resulting mesh object.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jul 2026 16:06:57 GMT</pubDate>
    <dc:creator>BurkhardRammner</dc:creator>
    <dc:date>2026-07-16T16:06:57Z</dc:date>
    <item>
      <title>Issues with MFnMesh object</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/issues-with-mfnmesh-object/m-p/14191716#M18212</link>
      <description>&lt;P&gt;&amp;nbsp;In the documentation for MFnMesh::create it says:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Creates a new polygonal mesh given an array of vertices, edge and polygon connection data &lt;STRONG&gt;and sets this function set to operate on the new surface.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If parentOrOwner is kMeshData, then it doesn't appear to operate on the newly created mesh data. In the code I initially encountered the issue (which was C++) in I had to run setObject() to make my&amp;nbsp;closestIntersection call work.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Som functionality seemed to work without doing that though, like checking the number of vertices.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;I thought that maybe it was just something unique about the&amp;nbsp;kMeshData use case, that the documentation didn't mention. But I did some testing, and MFnMesh has the tendency to return inaccurate information about the object it is set to.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I encountered this issue with Maya 2026.2 on Windows 11&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Below is a simple example to show some of the odd behavior:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import maya.api.OpenMaya as om

points = om.MPointArray([
    om.MPoint(0, 0, 0),
    om.MPoint(1, 0, 0),
    om.MPoint(0, 1, 0)
])

polygon_counts = [3]
polygon_connects = [0, 1, 2]

mesh_data_obj = om.MFnMeshData().create()

mesh_fn = om.MFnMesh()

mesh_geom = mesh_fn.create(
    points,
    polygon_counts,
    polygon_connects,
    parent=mesh_data_obj
)

print("mesh_data:", mesh_data_obj.apiTypeStr)
print("mesh_geom:", mesh_geom.apiTypeStr)

print(mesh_fn.object().apiTypeStr)
print(mesh_fn.object().isNull())

mesh_fn.setObject(mesh_data_obj)

print(mesh_fn.object().apiTypeStr)
print(mesh_fn.object().isNull())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2026 21:38:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/issues-with-mfnmesh-object/m-p/14191716#M18212</guid>
      <dc:creator>jonah_reinhart</dc:creator>
      <dc:date>2026-07-07T21:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with MFnMesh object</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/issues-with-mfnmesh-object/m-p/14201808#M18215</link>
      <description>&lt;P&gt;I only 'know' the c++ API.&lt;BR /&gt;When you use the create method, you get 2 outputs. When MFnMesh was initialized with a MObject that was constructed using MFnMeshData, then you get:&lt;BR /&gt;1. the 'mesh object' as the return object&lt;BR /&gt;2. the 'mesh data', which you can output to the DG&lt;BR /&gt;When you then want to continue to do work with the result, you got to set a MFnMesh to the 'mesh object'.&lt;BR /&gt;Thats the only really save way to do it.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2026 12:58:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/issues-with-mfnmesh-object/m-p/14201808#M18215</guid>
      <dc:creator>BurkhardRammner</dc:creator>
      <dc:date>2026-07-16T12:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with MFnMesh object</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/issues-with-mfnmesh-object/m-p/14202000#M18216</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;SPAN&gt;When you then want to continue to do work with the result, you got to set a MFnMesh to the 'mesh object'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thats the only really save way to do it.&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes, you can see that in the example I provided. After setObject it returns the expected thing, but the behavior prior to doing that is somewhat mixed.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question is whether this is intended behavior, and the documentation is inaccurate, or if this is a bug.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2026 15:30:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/issues-with-mfnmesh-object/m-p/14202000#M18216</guid>
      <dc:creator>jonah_reinhart</dc:creator>
      <dc:date>2026-07-16T15:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with MFnMesh object</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/issues-with-mfnmesh-object/m-p/14202038#M18217</link>
      <description>&lt;P&gt;No AD employee will tell you. Its unpredictable and the only save way is to reset the function set to the resulting mesh object.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2026 16:06:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/issues-with-mfnmesh-object/m-p/14202038#M18217</guid>
      <dc:creator>BurkhardRammner</dc:creator>
      <dc:date>2026-07-16T16:06:57Z</dc:date>
    </item>
  </channel>
</rss>

