Training Stream - Spline Importing w/ Alan Noon - Jan 10th - Live from Epic HQ

Hey there, is there any possibility of making the spline save at all ? mine seems to reset to default after moving.

Cancel that, I’d previously moved this over to the construction script.

Thanks mates.

Can such spline be used with SplineMesh components?
I’ve got the spline I need but I can’t translate its shape to the SplineMeshes correspondingly. Do they use different tangent formats?

Hey all,
I thought this was a rather difficult way of doing this, so I made another tool which copies the T3D of the spline from Max
Only works with open splines and only one spline per shape for one shape, but I’ll continue to iterate on it.

You can find it HERE.

Any suggestions/requests are welcome either on github or in PM.
Issues are less welcome but please tell me if you find any

Credit goes to Alan Noon for most of the math

It is possible to have this code work on multiple actors with spline components. Remove the spline component from your blutility. Create a new actor with a spline component. Add an editable actor reference variable to your blutility. Now you can get a reference to different actors with spline components. In the blutility take the actor reference and check if it has a spline component, if so execute the blutility on that spline component.

This is my current pymel script. i will refine it with ui and such but this will get you going.
My script only works on bezier curves atm. You can convert a bezier curve to a nurbs one through menu modify->convert.
This also means you get one vector tangent instead of an in and out tangent. You have to account for this in the blueprint by using the set tangent node instead of set tangents. You can uncheck the ‘allow discontinuous spline’
Just change the file path and make sure you run it in the python script tab instead of the mel one.

import pymel.core as pm
import maya.cmds as mc
import csv
#select the curve and call 
sel = pm.selected()
crv = sel[0].getShape()

def getBezierCVPosAndTan():
    cvLocs = ]
    cvTans = ]
    while (cv <= (crv.numCVs()-1)):
        #get CV position
        cvLoc = crv.getCV(cv)
        #get param at position
        cvParam = crv.getParamAtPoint(cvLoc)
        #get tangent at param
        cvTan = crv.tangent(cvParam)
        #maya sees the tangent handles as CV's, we skip those
        cv = cv+3
    return cvLocs,cvTans
cvLocations,cvTangents = getBezierCVPosAndTan() 

path = "D:/Esther/Assets/"
filename = "curveCSV.csv"
filePath = path+"/"+filename
print filePath
with open(filePath,"wb") as csvFile:
    writer = csv.writer(csvFile,quoting=csv.QUOTE_MINIMAL)
    for cv in range(0,len(cvLocations),1):
        #extract the position and tangent data and save in correct format
        #we swap some axis around to make the maya coordinates fit with the unreal ones.


So why is it not possible to use the data table as variable? is this gonna be supported?

Given that FBX supports splines, is there any chance we can just get a simple FBX spline path importer?

My thoughts exactly. Splines are extremely beneficial and since Unreal Engine doesn’t really have native modeling tools, it should support a larger array of importing objects from 3rd party programs. Especially splines.

This video is a nice workaround, but quit an extensive hack when multiple custom splines are necessary. In my case, I have a real-world parking lot but Im using Unreal’s landscape. Works great, but the parking lines are custom and already placed in 3d Max as splines. But they’re not conformed to the elevations set in Unreal’s landscape. If I could easily import these splines into Unreal and give it shape, that would be awesome. Definitely not easy with this hack.

I hope a solution is released soon! 4.21???

So… About those spline imports…

Yes, I’d love to hear something new too

Hey Alan!
First of all, I’m new to Unreal and your Livestream was incredibly useful for a neuroanatomy education app that I am working on. So thank you very much!

I am wondering if this method can be used to create a spline and spline mesh. I have a JSON file formatted thusly:

{"x": 2.4918339252471924,"y": 0},
{"x": 1.2459168434143066,"y": 2.1579916477203369},
{"x": -1.2459170818328857,"y": 2.1579914093017578},
{"x": -2.4918339252471924,"y": -2.178430378307894e-07},
{"x": -1.2459167242050171,"y": -2.1579916477203369},
{"x": 1.245917797088623,"y": -2.1579909324645996}],
"point": {"x": 287.01492309570312,"y": 100.07234954833984,"z": 405.66363525390625},
"up": {"x": 0.49748080968856812,"y": 0.8660818338394165,"z": 0.049125999212265015},
"vAxis": {"x": 0.23029391467571259,"y": 0.958656907081604,"z": -0.16715794801712036}}],

#lots of controlPoints in sequence.


"point" is in world space, and everything else is local to "point"

"point" is a control point of the spline, and the XY values above it are the boundary points that make up an irregular shape in a 2D plane relative to the "point" to ultimately create a spline mesh.
"up" is the tangent used to create the u axis of the boundary shape.
"vAxis" is the tangent used to create the v axis of the boundary shape.

Can I use this data to generate a spline and an associated spline mesh using a derivative of your blutility?

Following part of Alan Noon’s process I was able to create a Blender to Unreal Engine Importer Plugin… No Live link yet, but its in the works… You can get the plugin here… Blender Curves To Unreal Engine Splines Importer

Hey, Have been following the tutorial, but it has some trouble with curves…Alan said in the video that there was some math error, and swipped to another project to show how it propertly works, but did not explain what was wrong and now I am experiencing that issue…
Can Anyoone please explain what was wrong in the maths? thought was the final part of the tangents but not sure the exact point