[Closed] How to attach splines to an Edit Spline Modifier?
Hi guys,
I’d like to know if there’s a way to attach splines to an Edit Spline Modifier by MaxScript without user interaction. splineOps methods just activate the attach command, like pressing buttons in Command Panel, so they’re not an option.
On a side note, same question goes for an Edit Mesh Modifier.
Thank you.
- Enrico
there is no easy way to attach splines using Edit Spline Modifier methods. But you can do it on splineShape level adding new splines to the target shape, and coping knots number, knot types, positions, in/out vectors, and closed state from “attached” shapes.
After that you can delete “attached” shapes if necessary.
Thanks Denis, I was afraid of the answer, as it was the idea I got to solve the issue, but before giving it a shot, I wished for a second guess, to make sure I wasn’t missing something obvious. I think the same goes for Edit Mesh Modifier.
- Enrico
to attach meshes you can use meshop.attach method or attach (see MXS help for details)
I haven’t tested them, but I think meshOp.attach and attach work for Editable Meshes, and not for Modifiers, but I guess I can still find some fancy workaround for meshes.
- Enrico
the easiest way to attach 2 shapes is:
fn addShape sp1 sp2 = if iskindof sp1 SplineShape and iskindof sp2 SplineShape do
(
convertToSplineShape sp1 -- to make it undoable
convertToSplineShape sp2
addAndWeld sp1 sp2 -1
sp1
)
HI enrico,
for meshes, the easiest is to add them !!
(
a=teapot()
b=sphere()
a+=b
delete b
)
“+” operation for meshes doesn’t attach one to another. it performs on meshes boolean union.
Thank you guys, but the issue is with Modifiers only, the Editable Spline and Editable Mesh as base objects parts are already coded
- Enrico