<?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: IntersectRay parameters for Mesh in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/intersectray-parameters-for-mesh/m-p/8219925#M9857</link>
    <description>&lt;P&gt;I&amp;nbsp;found short description of "IntersectRay" function in 3d max docs&amp;nbsp;&lt;A href="http://docs.autodesk.com/3DSMAX/16/ENU/3ds-Max-Python-API-Documentation/py_ref/class_max_plus_1_1_mesh.html#aead9decb14718cb5b55a2348b521f1dd" target="_blank"&gt;link&lt;/A&gt;.&amp;nbsp;I think the symbol " &amp;amp; " in C++ means that the argument must be passed by reference and the result of the intersection will be written there . I can not understand how to do it using Python, all in vain.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Aug 2018 15:32:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-08-23T15:32:22Z</dc:date>
    <item>
      <title>IntersectRay parameters for Mesh</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/intersectray-parameters-for-mesh/m-p/8218885#M9855</link>
      <description>&lt;P&gt;Hello !&amp;nbsp;&lt;SPAN&gt;Recently started testing python api to automate my&amp;nbsp;&lt;/SPAN&gt;purposes, but i have some trouble with using&amp;nbsp;IntersectRay&amp;nbsp;method for Mesh object.&amp;nbsp;&lt;SPAN&gt;First I create a box with dimensions 10x10x10 on the path of ray tracing&amp;nbsp; in scene and convert it to mesh object.&amp;nbsp;After executing this code i get&amp;nbsp;Runtime error&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import MaxPlus
direction_point = MaxPlus.Point3(0, 1, 0)
start_point = MaxPlus.Point3(0, 0, 0)
ray = MaxPlus.Ray()
ray.SetPoint(start_point)
ray.SetDirection(direction_point)
r_node = MaxPlus.Core.GetRootNode()
obj = r_node.GetChild(0).GetObject()
mesh = MaxPlus.GeomObject._CastFrom(obj)
p = 0.1
n = MaxPlus.Point3(1, 1, 1)
bool = mesh.IntersectRay(ray, p, n)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Runtime error content:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;-- Runtime error: 
Traceback (most recent call last):
 File "C:\Program Files\Autodesk\3ds Max 2017\MaxPlus.py", line 12333, in &amp;lt;IntersectRay&amp;gt;
NotImplementedError: Wrong number or type of arguments for overloaded function 'Object_IntersectRay'.
 Possible C/C++ prototypes are:
 Autodesk::Max::Object::IntersectRay(Autodesk::Max::Ray &amp;amp;,float &amp;amp;,Autodesk::Max::Point3 &amp;amp;,TimeValue)
 Autodesk::Max::Object::IntersectRay(Autodesk::Max::Ray &amp;amp;,float &amp;amp;,Autodesk::Max::Point3 &amp;amp;)&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;I can't understand what I need to pass as parameters to get the working result. Searching examples in 3DS Max help is too unsuccessful.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 09:43:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/intersectray-parameters-for-mesh/m-p/8218885#M9855</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-23T09:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: IntersectRay parameters for Mesh</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/intersectray-parameters-for-mesh/m-p/8219140#M9856</link>
      <description>&lt;P&gt;Is it because you are passing too many parameters to the intersect ray? In the docs, you need to pass 2 parameters to intersect ray (node, ray) and you are passing 3 values. Whats the third for?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps its different for MaxPlus, not looked into it yet. Just thoughts on initial look at your code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 11:47:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/intersectray-parameters-for-mesh/m-p/8219140#M9856</guid>
      <dc:creator>malcomarmstrong</dc:creator>
      <dc:date>2018-08-23T11:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: IntersectRay parameters for Mesh</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/intersectray-parameters-for-mesh/m-p/8219925#M9857</link>
      <description>&lt;P&gt;I&amp;nbsp;found short description of "IntersectRay" function in 3d max docs&amp;nbsp;&lt;A href="http://docs.autodesk.com/3DSMAX/16/ENU/3ds-Max-Python-API-Documentation/py_ref/class_max_plus_1_1_mesh.html#aead9decb14718cb5b55a2348b521f1dd" target="_blank"&gt;link&lt;/A&gt;.&amp;nbsp;I think the symbol " &amp;amp; " in C++ means that the argument must be passed by reference and the result of the intersection will be written there . I can not understand how to do it using Python, all in vain.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 15:32:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/intersectray-parameters-for-mesh/m-p/8219925#M9857</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-23T15:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: IntersectRay parameters for Mesh</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/intersectray-parameters-for-mesh/m-p/8229094#M9858</link>
      <description>&lt;P&gt;AH, you are using python in max 2014. Known to have issues. The current implementations (MaxPlus and pymxs) do not currently fare better. Autodesk have been a bit lapse with a proper wrapped version, so I am not at all surprised that the implementation you are using has issues. Maxplus is too longwinded and pymxs does not even have a complete set of documentation, let alone a complete wrapper for maxscript commands. Prob best to wait till 2020, see if they get it together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Probably not what you wanted to hear, but its pretty much what is going on with max python.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 08:13:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/intersectray-parameters-for-mesh/m-p/8229094#M9858</guid>
      <dc:creator>malcomarmstrong</dc:creator>
      <dc:date>2018-08-28T08:13:27Z</dc:date>
    </item>
  </channel>
</rss>

