Notifications
Clear all

[Closed] growing a spline

Is there any ready made tool or a possibility to cut a spline by sliding start/end knots?
Houdini has a carve SOP which does it and works on all geometry types.

Edit:
I have some ideas :
-make sliders for new start/end positions (
-add new knots using pathinterp MySpline MyStartpos
pathinterp MySpline MyEndpos
-build new spline from knots of indices between start and end
-delete old spline

Make it dependant on knotslider based changehandlers

How far am I?

5 Replies

GOTCHA!

Hehe, I went mad and desperate! This is a rough and ugly prototype of what I need…
a carve SOP in max…a slider that lets you control the length of a spline.

Now there is a huge neccesity to make it animatable so if anybody could advice something this time I’d be grateful.

Should I add a custom parameter to a spline or try turning it into a scripted modifier which is said to fail most of the times.

If you have any clues how to improve it (it’s very rough by now) I’d be grateful


--Carve SOP proto by Peter Twardo (temporary web www.twardo.mazurek.info) pt@twardo.pl
--22 12 06
--feel free to criticize ;)


macroScript myCarveScript category:"kojakScripts"
(--start macro
	
	if (myCarve!=undefined) and (myCarve.isdisplayed) do (destroyDialog myCarve)
	
	rollout mycarve "mycarve_OP"
	
	(--start rollout
		spinner mySlider "mySlider	" range:[-0.99,0,0.50]
		--button pickACurve "pickACurve"
		button start "start"
		button  hideSrc "toggleHideSrc"
		button delRef "deleteReference" color:red
		
		on hideSrc pressed do 
		(
			if (myRefCurve != undefined) and (myRefCurve.isDeleted == false) do 
			(
				myRefCurve.isHidden = not myRefCurve.isHidden
			)
		)
		
		on delRef pressed do (if myRefCurve != undefined do delete myRefCurve)
		
		on start pressed do
		(--start on start pressed
				global myCurve = selection[1]
				global myRefCurve = copy myCurve
				global knotPos = #()
				global knotParam = #()
				myCurve.vertexticks = true
				mycurve.wirecolor = blue
				
				for i = 1 to (numKnots myCurve) do
				(
					knotPos[i] = getKnotPoint myRefCurve 1 i
					knotParam[i] = nearestPathParam myRefCurve 1 knotPos[i]
				)
		)--end on start pressed
		
		
		
			on mySlider changed value do
			(--start on slider change
				
					
				
				for i = 1 to ((numKnots myCurve)) do
				(
					
					newKnotParam = knotParam[i]+(knotParam[i]*mySlider.value)
					if newKnotParam >= 0.99 then newKnotParam = 0.99
					if newKnotParam <= 0 then newKnotParam = 0.01

					newKnotPos = lengthInterp myRefCurve newKnotParam
					setKnotPoint myCurve 1 i newKnotPos
				)
				
				updateShape myCurve	
		
	
		)--end on slider change
		
	)--end rollout
	createDialog mycarve 200 200
)--end macro


 rdg

I did something similiar a few weeks ago.

I used #smooth knot types for fitting the curves.
I tried to get the tangents and align the bezier-handles, but got stuck.

To animate the growing of the spline just use:

with animate on ( 
 at time ...
)

Georg

Thanks, I know I can key positions but looked for some more interactive way.
Now I set it up using a scripted op on some helper obj. modifying my spline.
Not too clean but I don’t have a bloody idea about any other way.
It seems to be impossible with simpleMod, there is a problem with storing data.

 rdg

what do you mean:
some more interactive way ?

I often use dummy objects for such tasks.
There is no need to install plugins on render slaves.

simpleMod is not really usable.

Georg

More interactive than keys, scripted ops work great.
By the way…I had the same experience with freaked bezier handles:)