Notifications
Clear all

[Closed] How to Outline Line/Splineshap

I’m a new developer using 3dsmax sdk.More tools used to be developed using MXS.
Now,I want to outline the line.But I’m in trouble! If I use *.dlx to solve it,I can’t do when there are modifiers on the line.as follows:

Value* SRYOutline_cf(Value arg_list, int count)
{
check_arg_count(SRYOutline, 2, count);
Value
pSpline = arg_list[0];
Value
pvalue = arg_list[1];
INode* node = pSpline->to_node();
float offset = pvalue->to_float();
Object* ob = node->GetObjectRef();
SplineShape* pSplineShape = (SplineShape*)ob;
pSplineShape->BeginOutlineMove(0);
pSplineShape->OutlineMove(0, offset);
pSplineShape->EndOutlineMove(0, true);
return_value(pSpline);
)

I need your help,thanks!

6 Replies

if I use second way to solve it,but I can’t use “with undo on” in mxs.as follows:

    fn InCoreOutline spl _spn = 
        (
            local g = (dotNetClass "Autodesk.Max.GlobalInterface").Instance
            local t = g.COREInterface.Time
            inode = g.COREInterface.GetINodeByHandle spl.inode.handle asdotnetobject:true
            iobj  = (inode.EvalWorldState t true asdotnetobject:true).Obj
            iobj.BeginOutlineMove t 
            iobj.OutlineMove t _spn
            iobj.EndOutlineMove t true
        )

Because of the above method,doesn’t work on the line.So I must firstly convert it to splineshap.But I can’t use “with undo on” on the whole code .

don’ t do it that way (using the command mode) have a look in the file maxsdk/samples/modifiers/editpatch/editspl.cpp there you will find the source code for offseting a spline just use that directly.

Because I’m familiar with MaxScript ,and Developing small plug-ins is fast.If there are many loops in mxs,it is so slow.and there are not enough methods to use in maxscript.So I wanted to solve this problem with hybrid mode .You think feasible this?You know Plug-ins developed in c++ are versioned.I look forward to hearing your advice.

Yes it’s possible, but probably not get the result you expect. That is it will (and can) only have a effect on the base object. If you want it to effect the “current” stack state the you’ll need to implement it as a modifier.

thank you,KIvnk.You mean that my ideas can have unpredictable results! It is best to write plug-ins in a single way.

“best” In it is best suited to a modifier. It’s a pretty simple implementation use nspline.cpp (maxsdk\samples\modifiers) as the basis and using the code from editspl.cpp as mentioned above.