Editing Spline knots
Hi everyone!
In order to make a script that randomizes splines used for path constraint objects (that what i want does not work with pflow) .
I want to go through every Spline Knot and randomize its position
like this
addmodifier new_path (Edit_Spline ()) verts = numKnots new_path for i=1 to verts do( vert = getKnotPoint new_path 1 i offs = random -pos_off.value pos_off.value vert.x = vert.x + offs vert.y = vert.y + offs setKnotPoint new_path 1 i vert updateShape new_path )
but i found out, that the changes are made within the spline object and not within the modifier, how can i change that?
thanks in advance vor help
Comments
LOL!
Sometimes you suddenly notice that you think way to complicated!
just adding a noise modifier on every reference and changing the seed creates exacly what i want :-)
Is that simple :) Cheers,man!
Is that simple :)
Cheers,man!
bga
Thank you very much!
But sadly this does not work for this purpose.
I still want to have the fredom to change the vertex positions of the master path. as the referenced paths will have a spline ik mod on them they will not update the vertex movement on the master path.. so i really need to put the random position offset into a new edit_spline modifier.
I am trying a new way now:
in the for loop i just need a move selected knot funktioality. This way it is a bit slow to create (ui in max will flicker and stuff) but it recreates the workflow like you would do it by hand. I just need to move the selected knot now.
Any Ideas?
SOLUTON
This MAXScriptHelp say:
"When setting a Knot selection using the setKnotSelection method, you are always affecting the base object - the EditableSpline at the bottom of the stack. It is not directly possible to set the sub-object vertex selection of a specific Edit_Spline modifier using this method. The selection flows up the stack through any existing Edit_Spline modifiers and changes the sub-object selections of all of them."
But you can try this:
bga