LW Spline to Unreal Spline by converting 3DsMax scripts?

papou

··'
This is a script that convert 3DSMAX linear spline to Unreal Spline.
I'm looking for the exact same tool for Lightwave.
Anybody, with 3dsmaw code knowledge want to attemp a conversion?
Regards,

Code:
(
/*	Export linear spline from 3dsmax to Unreal Blueprint												*/
/*	By Alexander Bereznyak, www.alsber.com																*/

/*	Not much testing done, so save your work before using												*/
/*	Select the spline in max, run the script, open blueprint in Unreal, Ctrl+V							*/
/*	Set Reparameter Steps Per Segment value of component to 10, then to 4 to make spline editable	*/

/*	setup		*/
mySpline = (selection as array)[1]
myKnots = numKnots mySpline
myStep = 1
myText = "Begin Object Class=/Script/Engine.SplineComponent Name=\"SplineExported_GEN_VARIABLE\"\r"
/*	position	*/
append myText (
	"   SplineCurves=(Position=(Points=((OutVal=(X=" + \
	((getKnotPoint mySpline 1 1).x as string) + ",Y=" + \
	(((getKnotPoint mySpline 1 1).y * -1) as string) + ",Z=" + \
	((getKnotPoint mySpline 1 1).z as string) + \
	"),ArriveTangent=(X=0.0,Y=0.0,Z=0.0),LeaveTangent=(X=0.0,Y=0.0,Z=0.0)),"
	)
myIndex = 0
for i = (myStep + 1) to (myKnots - myStep) by myStep do (
	myIndex += 1
	append myText (
		"(InVal=" + ((1.0 * myIndex) as string) + ",OutVal=(X=" + \
		((getKnotPoint mySpline 1 i).x as string) + ",Y=" + \
		(((getKnotPoint mySpline 1 i).y * -1) as string) + ",Z=" + \
		((getKnotPoint mySpline 1 i).z as string) + \
		"),ArriveTangent=(X=0.0,Y=0.0,Z=0.0),LeaveTangent=(X=0.0,Y=0.0,Z=0.0)),"
		)
	)
append myText (
	"(InVal=" + ((1.0 + myIndex) as string) + ",OutVal=(X=" + \
	((getKnotPoint mySpline 1 myKnots).x as string) + ",Y=" + \
	(((getKnotPoint mySpline 1 myKnots).y * -1) as string) + ",Z=" + \
	((getKnotPoint mySpline 1 myKnots).z as string) + \
	")))),Rotation=(Points=((InterpMode=CIM_CurveAuto),"
	)
/*	rotation	*/
myIndex = 0
for i = (myStep + 1) to (myKnots - myStep) by myStep do (
	myIndex += 1
	append myText (
		"(InVal=" + ((1.0 * myIndex) as string) + \
		",ArriveTangent=(X=0.0,Y=0.0,Z=0.0,W=0.5),LeaveTangent=(X=0.0,Y=0.0,Z=0.0,W=0.5)," + \
		"InterpMode=CIM_CurveAuto),"
		)
	)
append myText (
	"(InVal=" + ((1.0 + myIndex) as string) + ",InterpMode=CIM_CurveAuto)))," + \
	"Scale=(Points=((OutVal=(X=1.000000,Y=1.000000,Z=1.000000),InterpMode=CIM_CurveAuto),"
	)
/*	scale		*/
myIndex = 0
for i = (myStep + 1) to (myKnots - myStep) by myStep do (
	myIndex += 1
	append myText (
		"(InVal=" + ((1.0 * myIndex) as string) + ",OutVal=(X=1.0,Y=1.0,Z=1.0),InterpMode=CIM_CurveAuto),"
		)
	)
append myText (
	"(InVal=" + ((1.0 + myIndex) as string) + ",OutVal=(X=1.0,Y=1.0,Z=1.0),InterpMode=CIM_CurveAuto)"
	)
/*	cleanup	*/
append myText (
	")),ReparamTable=(Points=((),(InVal=14.947966,OutVal=0.250000),(InVal=29.895931,OutVal=0.500000)," + \
	"(InVal=44.843895,OutVal=0.750000),(InVal=59.791862,OutVal=1.000000)," + \
	"(InVal=61.712151,OutVal=1.250000),(InVal=63.632435,OutVal=1.500000)," + \
	"(InVal=65.552719,OutVal=1.750000),(InVal=67.473007,OutVal=2.000000)," + \
	"(InVal=81.719254,OutVal=2.250000),(InVal=95.965508,OutVal=2.500000)," + \
	"(InVal=110.211754,OutVal=2.750000),(InVal=124.458008,OutVal=3.000000))))" + \
	"\r   ReparamStepsPerSegment=4\r   RelativeLocation=(X=" + \
	(mySpline.pos.x as string) + ",Y=" + \
	((mySpline.pos.y * -1) as string)+ ",Z=" + \
	(mySpline.pos.z as string)+ ")\rEnd Object\r"
	)
setClipBoardText myText
clearListener()
myText
)
 
Back
Top