[Closed] GetKnotPosition with modifiers on and off
Wondering about how to get a knots position of a spline at the root (before any modifiers are applied) through the SDK.
At the moment, I use a copy of the spline with modifiers removed so I can get spline->GetKnotPosition(i) but of course that makes I need 2 spline objects all the time (with and without modifiers).
Is it possible to get the knots when modifiers are on and off all from the same spline object?
Thank you,
Davy
you can find source code for getPointPos function in max sdk samples. it may answer your question.
oops. there is no source code of getPointPos. i thought it’s in avg_dlx.cpp. alas!
Yes, maybe it is not possible at all to get knot positions before and after modifiers without having 2 separate spline objects?
here is a plan:
const ObjectState& os = node->EvalWorldState(<time>);
Object* ob = os.obj;
ob->GetPoint(<index>));
// where [b]node [/b]is INode*
you know that point is not the same index as node, do you?
easier:
const ObjectState& os = node->EvalWorldState(<time>);
ShapeObject* sh = (ShapeObject*)os.obj;
after that all shape ‘things’ are opened…
Yes, I already had that part but where does it specify to get the spline at the root without modifiers?
what do mean? do you want to get splineshape before Edit_Spline modifier applied?
it’s a baseobject…
Yes, I have a regular spline object with 1 Edit_Spline modifier.
spline->GetKnotPosition(i) gets the knot position at the top of the stack.
But I want to get the knot position at the bottom of the stack as well.