How to assign hotkey for these commands? (vertices properties in spline)

These command list below in this image. Spline \ corner, bezier, smooth, etc... Haven't figure out to assign hotkey to any of them. I know rightclick menu is quite fast, but for some tasks in my current work, those command need to execute a lot of time and I prefer hotkey than context menu.

http://i.imgur.com/otfuhmL.gif

And I know how to assign hotkey/shortcut key in 3ds max for other commands. Normal way is rightclick>customize>Keyboard tab, pick the right Category (or Group), then navigate to the wanted command, assign a letter/symbol,key to it. But these vertex command such as corner, bezier... I couldn't find out in entire list of commands in 3ds max. They must be somewhere there but I can't find. Could this issue be solved with a little script or..?

Comments

Comment viewing options

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

wonderfull! but if add undo

wonderfull! but if add undo it will be excellently!

jahman's picture

.

you need to modify these macro a little for undo to work

if classOf curO == SplineShape or classOf curO == Line do
		(
			convertToSplineShape curO
			splinesCnt = numSplines curO
...
...
miauu's picture

.

macroscript miauuConertSplineKnotsToSmooth
category:"miauu"
tooltip:"Convert Knots to Smooth"
buttonText:"Convert Knots to Smooth"
(
	if selection.count == 1 do
	(
		curO = selection[1]
		if classOf curO == SplineShape or classOf curO == Line do
		(
			splinesCnt = numSplines curO
			for ss = 1 to splinesCnt do
			(
				selKnotsArr = getKnotSelection curO ss
				for k in selKnotsArr do
					setKnotType curO ss k #smooth
			)
			updateShape curO
		)		
	)	
)
 
macroscript miauuConertSplineKnotsToCorner
category:"miauu"
tooltip:"Convert Knots to Corner"
buttonText:"Convert Knots to Corner"
(
	if selection.count == 1 do
	(
		curO = selection[1]
		if classOf curO == SplineShape or classOf curO == Line do
		(
			splinesCnt = numSplines curO
			for ss = 1 to splinesCnt do
			(
				selKnotsArr = getKnotSelection curO ss
				for k in selKnotsArr do
					setKnotType curO ss k #corner
			)
			updateShape curO
		)		
	)	
)
 
macroscript miauuConertSplineKnotsToBezier
category:"miauu"
tooltip:"Convert Knots to Bezier"
buttonText:"Convert Knots to Bezier"
(
	if selection.count == 1 do
	(
		curO = selection[1]
		if classOf curO == SplineShape or classOf curO == Line do
		(
			splinesCnt = numSplines curO
			for ss = 1 to splinesCnt do
			(
				selKnotsArr = getKnotSelection curO ss
				for k in selKnotsArr do
					setKnotType curO ss k #bezier
			)
			updateShape curO
		)		
	)	
)
 
macroscript miauuConertSplineKnotsToBezierCorner
category:"miauu"
tooltip:"Convert Knots to BezierCorner"
buttonText:"Convert Knots to BezierCorner"
(
	if selection.count == 1 do
	(
		curO = selection[1]
		if classOf curO == SplineShape or classOf curO == Line do
		(
			splinesCnt = numSplines curO
			for ss = 1 to splinesCnt do
			(
				selKnotsArr = getKnotSelection curO ss
				for k in selKnotsArr do
					setKnotType curO ss k #bezierCorner
			)
			updateShape curO
		)		
	)	
)

If you don't like the category or the names/tooltips of the macros - change them.

nnq2603's picture

Return some errors.

I get this error:

---------------------------
MAXScript MacroScript Error Exception
---------------------------
-- Runtime error: Spline operation on non-spline: Rectangle
---------------------------
OK   
---------------------------

Edit Spline modifier above Rectangle. How to add Edit Spline object to script? (beside spline and line)

miauu's picture

.

I can't find how to add support for Editable Spline modifier.

nnq2603's picture

Thanks for detailed answer.

Thanks a lot, miauu. I'll use it and get back later if there's any problem (probably there's not).

Comment viewing options

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