Message 1 of 4
IntersectRay parameters for Mesh
Not applicable
08-23-2018
02:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello ! Recently started testing python api to automate my purposes, but i have some trouble with using IntersectRay method for Mesh object. First I create a box with dimensions 10x10x10 on the path of ray tracing in scene and convert it to mesh object. After executing this code i get Runtime error
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)
Runtime error content:
-- Runtime error: Traceback (most recent call last): File "C:\Program Files\Autodesk\3ds Max 2017\MaxPlus.py", line 12333, in <IntersectRay> NotImplementedError: Wrong number or type of arguments for overloaded function 'Object_IntersectRay'. Possible C/C++ prototypes are: Autodesk::Max::Object::IntersectRay(Autodesk::Max::Ray &,float &,Autodesk::Max::Point3 &,TimeValue) Autodesk::Max::Object::IntersectRay(Autodesk::Max::Ray &,float &,Autodesk::Max::Point3 &)
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.