[Closed] A simple question
worth checking how it is implemented in EditSplineMod::DoAttach in editspl.cpp
btw, do you really have to re implement all of these basic methods ?
Just curious what king of a plugin you’re making that requires that. Most likely you won’t get much performance improvement over using what’s already there, I mean DoAttach and others
I used Maxscript to write a complex plugin,You’ll find that the base methods available to you are very limited.
For example, we use the “AddAndWeld” to attach some splineshape s.There are a lot of knots above them that are very close together,They are open and we don’t need them to be welded together.Otherwise the rest of the work is wrong.That’s when”AddAndWeld” seems powerless.So we had to build these most basic methods.
I know there’s a way (DoAttach)in Splineshape,I did, but it didn’t work.Maybe I didn’t understand meaning of this parameter:ref bool canUndo.
//spl is splineshape
bool undo = false;
spl.DoAttach(spls[i], ref undo);
CanUndo does exactly what it says. It is an option to make the attach operation undoable or not. Because the Undo Restore entry for attaching a spline can take quite a lot of memory.
Can you give me an example that works,My codes don’t work, Miraculous
your code seems correct to me…maybe it needs some updating. I do ComputeBezPoints for all Spline3Ds, and do InvalidateGeomCache for SplineShape object.
Because in Attach operations usually involves nodes, before DoAttach you have to delete attaching node.
If you want just to attach shapes I see no problem here. Use negative weld threshold and that’s it
gif
Default max text where every segment is detached. All copies are placed exactly above one another.
I made extra copy of the yellow one to show that it works even when segments overlay each other perfectly. Hope that helps
while selection.count > 1 and not keyboard.escPressed do addAndWeld selection[1] selection[2] -1