Message 1 of 13
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I just want to recreate InterpCurve3D in c++ and publish it to the MaxScript. this is the c# version:
using Autodesk.Max; namespace MyProject { public static class MyClass { static IGlobal g = GlobalInterface.Instance; static IInterface14 i = g.COREInterface14; public static IPoint3 InterpCurve3D(uint handle,float param) { IINode node = i.GetINodeByHandle(handle); IObject obj = node.EvalWorldState(g.COREInterface.Time, true).Obj; ISplineShape shape = obj as ISplineShape; return shape.InterpCurve3D(0, 0, param, 0); } } }
and this is the c++ version that I'm trying to create:
#include <maxscript/maxscript.h> #include <maxscript/macros/define_instantiation_functions.h> #include <maxscript/foundation/numbers.h> def_visible_primitive(SampleFunction, "SampleFunction"); Value* SampleFunction_cf(Value** arg_list, int count) { INode* node = arg_list[0]->to_node; float param = arg_list[0]->to_float; ReferenceTarget* ref = node->GetObjectRef(); TimeValue t = GetCOREInterface()->GetTime(); ObjectState os = node->EvalWorldState(t); ShapeObject* spline = (ShapeObject*)os.obj; Point3 result = spline->InterpCurve3D(t,1,param,0); }
In "IntervalArray" example, I saw return_value_tls for returning value, but actually I don't know how I can use it. I'm using VS 2017, Max 2018
Solved! Go to Solution.