<?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: SplitMeshWithProjectedCurve fails in Maya Standalone in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/splitmeshwithprojectedcurve-fails-in-maya-standalone/m-p/7061042#M11948</link>
    <description>&lt;P&gt;Hi TechToast. Thank you for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the suggestion but it doesn't work either.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately it fails at the same place:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Warning: Can't perform polySplit1 on selection&lt;BR /&gt;Error: file: C:/Program Files/Autodesk/Maya2017/scripts/others/makeCurveSplitConnections.mel line 83: Cannot convert data of type int to type string[].&lt;BR /&gt;Error: -projectedCurve flag used but curve not connected to mesh through polyProjectCurve node&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the script if someone is curious&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;from pymel import core

cube = core.modeling.polyCube()[0]

curve = core.modeling.curve(
    degree=1, point=((0, 1, 1), (0, -1, 1)))

projected_curve = core.modeling.polyProjectCurve(cube, curve, direction=(0, 0, -1))

splitted_cube = core.modeling.polySplit(
    cube, projectedCurve=curve, detachEdges=True, adjustEdgeFlow=1,
    smoothingangle=0, insertWithEdgeFlow=False, subdivision=1)[0]

core.modeling.polySeparate(splitted_cube)

core.system.renameFile("test_polySeparate.mb")
core.system.saveFile(save=True, type="mayaAscii")&lt;/PRE&gt;</description>
    <pubDate>Thu, 04 May 2017 11:11:49 GMT</pubDate>
    <dc:creator>Jiloc</dc:creator>
    <dc:date>2017-05-04T11:11:49Z</dc:date>
    <item>
      <title>SplitMeshWithProjectedCurve fails in Maya Standalone</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/splitmeshwithprojectedcurve-fails-in-maya-standalone/m-p/7055960#M11945</link>
      <description>&lt;P&gt;I am working on a plugin that should work with maya standalone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I just realized that&amp;nbsp;SplitMeshWithProjectedCurve doesn't work in the standalone mode.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I run the same commands within Maya, instead, it works flawlessly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a simple example that shows the problem&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import maya.standalone
maya.standalone.initialize("Python")

from maya import cmds

cube = cmds.polyCube()[0]

curve = cmds.curve(degree=1, point=((0, 1, 1), (0, -1, 1)))

projected_curve = cmds.polyProjectCurve(cube, curve, direction=(0, 0, -1))

cmds.select(cube, projected_curve)
cmds.SplitMeshWithProjectedCurve()

try:
    cmds.polySeparate("pCube2")
except Exception as e:
    print(e)

cmds.file(rename="test_polyseparate.mb")
cmds.file(save=True, type="mayaAscii")&lt;/PRE&gt;&lt;P&gt;Note: Of course the firsts 2 lines are required in the standalone only and not inside maya.&amp;nbsp;Also the last 2 lines are required just to save the standalone result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While the script inside maya works, the standalone will fail on the cmds.polySeparate line because the last function didn't split the mesh (you can check that from the saved file. It will be saved inside C:/Users/YOURUSER/Documents/maya/projects/default/scenes/ ).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone tell me if this is normal? Or a workaround?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can tell that it's like this, at least, since maya 2016, don't know if it worked before that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here you can see the screen taken from both executions: (the first one is from the standalone)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Maya standalone result" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/351631i256F1863D4A0322F/image-size/large?v=v2&amp;amp;px=999" role="button" title="2017-05-02.png" alt="2017-05-02.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Maya result" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/351632i05D0B1A4BD461761/image-size/large?v=v2&amp;amp;px=999" role="button" title="2017-05-02 (1).png" alt="2017-05-02 (1).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 17:10:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/splitmeshwithprojectedcurve-fails-in-maya-standalone/m-p/7055960#M11945</guid>
      <dc:creator>Jiloc</dc:creator>
      <dc:date>2017-05-02T17:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: SplitMeshWithProjectedCurve fails in Maya Standalone</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/splitmeshwithprojectedcurve-fails-in-maya-standalone/m-p/7057793#M11946</link>
      <description>&lt;P&gt;[Update] I tried to&amp;nbsp;avoid cmds.SplitMeshWithProjectedCurve to directly use cmds.polySplit.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, it works in normal maya and fails in standalone applications. At least this time it didn't fail silently and returned:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Warning: Can't perform polySplit1 on selection
Error: file: C:/Program Files/Autodesk/Maya2017/scripts/others/makeCurveSplitConnections.mel line 83: Cannot convert data of type int to type string[].&lt;BR /&gt;Error: -projectedCurve flag used but curve not connected to mesh through polyProjectCurve node&lt;BR /&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First I checked (and at least it looked like) the polyProjectCurve node is actually connected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Debugging makeCurveSplitConnections.mel however I found out that the&amp;nbsp;command "stringArrayIntersector" used in the MEL script fails to run in standalone mode. It returns 0 instead of the string expected (and that is returned in maya).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Surfing the net I found only this file from autodesk maya 2010&amp;nbsp;&lt;A href="http://images.autodesk.com/adsk/files/maya2010releasenotes00.pdf" target="_blank"&gt;http://images.autodesk.com/adsk/files/maya2010releasenotes00.pdf&lt;/A&gt; which states that "stringArrayIntersector" doesn't work in bach mode...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If someone could suggest me how to avoid the polySplit command, also low level suggestions using OpenMaya or whatever you could image, it would be a huge help.&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 09:51:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/splitmeshwithprojectedcurve-fails-in-maya-standalone/m-p/7057793#M11946</guid>
      <dc:creator>Jiloc</dc:creator>
      <dc:date>2017-05-03T09:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: SplitMeshWithProjectedCurve fails in Maya Standalone</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/splitmeshwithprojectedcurve-fails-in-maya-standalone/m-p/7057814#M11947</link>
      <description>&lt;P&gt;Hi jiloc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't looked into this, but have you tried using PyMel instead of standard maya python?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According the the documentation PyMel should be more robust...might be worth a try?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/PyMel/standalone.html" target="_blank"&gt;http://help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/PyMel/standalone.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 10:05:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/splitmeshwithprojectedcurve-fails-in-maya-standalone/m-p/7057814#M11947</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-03T10:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: SplitMeshWithProjectedCurve fails in Maya Standalone</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/splitmeshwithprojectedcurve-fails-in-maya-standalone/m-p/7061042#M11948</link>
      <description>&lt;P&gt;Hi TechToast. Thank you for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the suggestion but it doesn't work either.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately it fails at the same place:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Warning: Can't perform polySplit1 on selection&lt;BR /&gt;Error: file: C:/Program Files/Autodesk/Maya2017/scripts/others/makeCurveSplitConnections.mel line 83: Cannot convert data of type int to type string[].&lt;BR /&gt;Error: -projectedCurve flag used but curve not connected to mesh through polyProjectCurve node&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the script if someone is curious&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;from pymel import core

cube = core.modeling.polyCube()[0]

curve = core.modeling.curve(
    degree=1, point=((0, 1, 1), (0, -1, 1)))

projected_curve = core.modeling.polyProjectCurve(cube, curve, direction=(0, 0, -1))

splitted_cube = core.modeling.polySplit(
    cube, projectedCurve=curve, detachEdges=True, adjustEdgeFlow=1,
    smoothingangle=0, insertWithEdgeFlow=False, subdivision=1)[0]

core.modeling.polySeparate(splitted_cube)

core.system.renameFile("test_polySeparate.mb")
core.system.saveFile(save=True, type="mayaAscii")&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 May 2017 11:11:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/splitmeshwithprojectedcurve-fails-in-maya-standalone/m-p/7061042#M11948</guid>
      <dc:creator>Jiloc</dc:creator>
      <dc:date>2017-05-04T11:11:49Z</dc:date>
    </item>
  </channel>
</rss>

