Notifications
Clear all

[Closed] Splines script

Hi, I´m newby wiht MaxScript and I`m trying to write a script to flatten selected vertex of a spline in one of three axis, X, Y or Z.
How can I get the position of selected knots to manage them to make some operations?

Here is the code

clearListener ()
if subobjectlevel == 1 then
(
for ns = 1 to (numsplines $) do
(
sv = getknotselection $ ns –sv selected knots
for vi in sv do
(
kp = getknotpoint $ ns vi – kp selected knots pos.
)
)
)

Sorry my English

T.I.A.

Luis Angel

9 Replies

You could just use the VertexPlacer script here…

http://www.neilblevins.com/blurscripts/blurscripts.htm

it works on splines too.

  • Neil

Thank You very much Neil, I work every day with yours scripts but I don´t see that. I´am trying to make some tools for my co-workers and we work with CAD splines sometimes.

Luis Angel

1 Reply
(@artofsoulburn)
Joined: 11 months ago

Posts: 0

Glad you’e found my scripts useful. You may not have seen that one because it’s quite old, written when I was back at Blur. I’ll probably rewrite a more recent version with new features at some point in the future. In the meantime, feel free to use that old script or steal code from it for the script you’re writing.

  • Neil

If I remember right one of the max script tutorials talks about how to flatten on Z. Might be useful as a learning tool.

Hi again Neil,
Sorry maybe you can help me.
When i work with VertexPlace, why Undo doesn`t work with splines?
Undo works fine with polys any reason to do this?
Can I make something in code to fix that?

Thanks again

Luis Angel

1 Reply
(@artofsoulburn)
Joined: 11 months ago

Posts: 0

When I added undo to the script, the mesh stuff worked but the spline stuff doesn’t, afraid it’s some sort of undo error inside max, not the script. So you’re probably stuck with it, sorry.

  • Neil

Thanks again Neil, I will live with it .

Luis Angel

hmmm. can’t you just scale all the vertices to 0 using group pivot?
much faster imo.

1 Reply
(@artofsoulburn)
Joined: 11 months ago

Posts: 0

Well, your technique involves clicking the scale tool, choosing the right viewport to scale in, making sure you move to the right part of the scale manipulator to do non uniform scales, clicking once, dragging down. That’s 5 actions.

Or you can click a single button in the script (2 if the script’s UI isn’t open already).

  • Neil