Normalize Spline

13 votes
Version: 
1.7.1

This scripted plug-in normalizes a spline by number of segments instead of the segments length. With options to show the vertex ticks, to close the splines, and optimize by deleting points relative to an angle threshold.

Additional Info: 

Launch the script.
Select an editable spline or line and apply the modifier "Normalize Spl. 2"
Change the parameters as you like.
If you want to reset the modifications, just click the button "reset spl.".

All the parameters are saved in the object properties -> "user defined".
If you modify the spline and delete the modifier, the spline will stay
to its current state. To reset after deleting, apply again the modifier
and click the button "reset spl.".
So, important : never delete or change manually the "user defined properties".

To load automatically the script at startup, copy it in the following folder :
C:\Users\[your name]\AppData\Local\Autodesk\3dsMax\2012 - 64bit\enu\scripts\startup
------------------

v1.4:
-Like the version 1.3 but in the modifier list.
-Record properties of each spline object in its user defined properties.
-The "Optimization" is corrected to always keep the first and last point.
-You cannot disable the modifier (click "reset spl." to get the initial state)
-This scripted plug-in is not animatable.

v1.5:
-When normalizing, now it always keeps the last point and give a correct number of segments.
-In "Optimization", change the default parameter to "Keep < 180°"

v1.6:
-Works with 3ds Max 2013
-Corrected an issue with closed splines

v1.7:
-Corrected a small issue with the "close spline" check box
-Added a button "Bake spl. state" that will copy the spline state in the user properties

v1.7.1:
-Corrected a bug with "relative to total spl. length" check box when the number
of segments was too low to close one of the splines.

Version Requirement: 
2009, 2010, 2011, 2012, 2013
Video URL: 
AttachmentSize
normalizespline_v1.3.mse3.92 KB
normalizespline_v1.4.mse6.4 KB
normalizespline_v1.5.mse6.59 KB
normalizespline_v1.6.ms6.68 KB
normalizespline_v1.7.ms7 KB
normalizespline_v1.7.1.ms7.03 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
harumscarum's picture

hi!

thanks for modifier but is it works inside out. here i attach illustration what i mean - when i need 200 points on the spline do ш have to apply modifier and turn it off?

harumscarum's picture

hi!

thanks for modifier but is it works inside out. here i attach illustration what i mean - when i need 200 points on the spline do ш have to apply modifier and turn it off?

AttachmentSize
spline.png 42.83 KB
LittleLordPotala's picture

About the optimization

It calculates the angle (between 0° and 180°) of each point relative to its adjacent points.
It doesn't take in account the tangent of the curve.
So, on a line with a lot of points, the angle will be often between 150° and 180°
and if you choose to keep points with angles > 30°, almost nothing will happen
because the angles are much higher.
I'm still searching a way to put all this in the modifier list and to optimize
while taking in account the tangents.

Best regards.

harumscarum's picture

thank you for update

just tested latest version i'm really missing plugin, but I understand these limitations. unfortunately don't get how optimization works - is it affecting only one (first) point?

LittleLordPotala's picture

Good ideas

I will see if it's possible.
Notice that the scripted plug-ins have more limitations than
the normal scripts.
Anyway, I'll try.

harumscarum's picture

simple and useful - thank you!

and i have some suggestions if possible:

- keep base points with threshold in degrees (for example if 30 - it will keep all points which have 30 and more degrees between segments)

- EQUAL MODE (all segments are same length with the value closest to a given. for example - base segments are 6m, 9m and 13m - so first one is 3 segments by 2m, second is 5 segments by 1.8m and third is 7 segments by 1.857m

LittleLordPotala's picture

Script corrected

Thank you for the bug report.
I corrected it and it works on my system 3ds max 2012 64bits sp2 (+win 7 64bits).

Script_Butler's picture

It seems really buggy.

Hi.

I've just been using your script and every time i change the Seg number max just hangs and i have to crash it out to close it.

I get no error messages at all......

Cheers.

Script_Butler

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.