Announcement

Collapse
No announcement yet.

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

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

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

    WHAT
    Alan Noon is back in action to talk about his techniques for getting the best results from exporting and importing splines from 3DSMax into UE4. Alan has created a custom exporting pipeline with some script and is going to walk through how it works and how you can do it yourself. If you are a 3D modeler or a developer who uses splines, you will want to tune in for this enlightening stream.

    WHEN
    Tuesday, January 10th @ 2:00PM ET [Countdown]

    WHERE
    http://www.twitch.tv/unrealengine

    WHO
    Alan Noon - Developer Relations Technical Artist - @AlanNoon

    Feel free to ask any questions on the topic in the thread below, and remember, while we try to give attention to all inquiries, it's not always possible to answer everyone's questions as they come up. This is especially true for off-topic requests, as it's rather likely that we don't have the appropriate person around to answer. Thanks!

    Archive:

    Last edited by Alexander Paschall; 01-12-2017, 12:07 PM.

  • replied
    Originally posted by Antidamage View Post
    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???

    Leave a comment:


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

    Leave a comment:


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

    Leave a comment:


  • replied
    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.

    Code:
    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 = []
        cv=0
        while (cv <= (crv.numCVs()-1)):
            #get CV position
            cvLoc = crv.getCV(cv)
            cvLocs.append(cvLoc)
            #get param at position
            cvParam = crv.getParamAtPoint(cvLoc)
            #get tangent at param
            cvTan = crv.tangent(cvParam)
            cvTans.append(cvTan)
            #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)
        writer.writerow(("","Position","Tangent"))
        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.
            writer.writerow((cv,"(X="+str(cvLocations[cv][0])+",Y="+str(cvLocations[cv][2])+",Z="+str(cvLocations[cv][1])+")","(X="+str(cvTangents[cv][0])+",Y="+str(cvTangents[cv][2])+",Z="+str(cvTangents[cv][1])+")"))
    
    csvFile.close()

    Leave a comment:


  • replied
    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
    Last edited by defrost256; 01-23-2017, 09:11 AM.

    Leave a comment:


  • replied
    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?

    Leave a comment:


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

    EDIT:
    Cancel that, I'd previously moved this over to the construction script.

    Thanks mates.

    Leave a comment:


  • replied
    Originally posted by Alexander Paschall View Post
    Archive is up now
    I just got done watching and its great stuff I really like how this is something people can implement themselves, I hadnt even considered scripting in Illustrator honestly so this really shows how abit of different thinking can find a solution that works around the engines limitations. I do hope the conversation around splines and a proper specialized datatype continues at Epic, as AlanNoon said they are a very versatile tool which could open alot of doors

    Leave a comment:


  • replied
    Archive is up now

    Leave a comment:


  • replied
    Thank you very much, a great lesson.
    I started doing this in the Blender.

    Code:
    import bpy
    
    ob = bpy.context.object
    assert ob.type == 'CURVE'
    
    curve = ob.data
    spline = curve.splines.active
    assert spline.type == 'BEZIER'
    
    scale = 100.0
    
    id = 0
    print ("---,InVal,OutVal,ArriveTangent,LeaveTangent")
    for p in spline.bezier_points:
        print ('%i,"%f","(X=%f,Y=%f,Z=%f)","(X=%f,Y=%f,Z=%f)","(X=%f,Y=%f,Z=%f)"' % (id, float(id), p.co[0]*scale, p.co[1]*scale*-1, p.co[2]*scale, p.handle_left[0]*scale, p.handle_left[1]*scale*-1, p.handle_left[2]*scale, p.handle_right[0]*scale, p.handle_right[1]*scale*-1, p.handle_right[2]*scale))
        id = id + 1

    I made a different structure, removed the float vector added
    Everything works fine, except for the positions Handley
    I do not understand is how it works.
    I will be glad prompts.

    Leave a comment:


  • replied
    Hey all, I have attached the shape files, the macroscript, and the SplineWriter graph.

    If you've watched the stream and saw the part where the circle comes in incorrectly, the issue was found in that the last node of the graph should be set to local, and the World to Local conversion on the out tangent was swapped. The file contains the corrected version.
    Attached Files

    Leave a comment:


  • replied
    link to [countdown] absent

    Leave a comment:


  • replied
    This is great, very excited for the livestream

    Leave a comment:


  • replied
    Originally posted by VictorBurgos View Post
    But can it be done from Maya / Maya LT? Obviously if it's using MAXScript, nope, but it would be nice to see more streams like this utilizing Maya LT/Modo Indie every once in awhile. It can be then be applied also to their big brothers (Maya/MODO).

    While 3DS Max was (is?) the king for GameDev, especially in the AAA market, for some odd reason I would think if you were to "target" the indie market a bit more, it would have more of an impact. Especially, since once again, these techniques can then be applied to their big brothers.

    I suppose a poll would be more in order to see what DCC the majority of devs are utilizing at the moment.

    Oh, I forgot about Blender...

    Maya guys got the Animation and Rigging Toolset...which is a HUGE DEAL.

    Leave a comment:

Working...
X