Announcement

Collapse
No announcement yet.

Blender to Unreal FBX Batch Export Static Mesh with Collision

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

  • replied
    Can someone who knows how to do python please update this?

    Leave a comment:


  • replied
    Hi all, Thanks a lot for the blender script, it is indeed very useful and speeds up the blender-to-unreal process. One quick question though: did anyone finally managed to import several LODs automatically into Unreal? (either using the FBX importer, or using another option)? I'd like to import a large number of meshes, each with 4 Levels of Details, and could not find a solution during the past week.
    Thanks for the help!

    Leave a comment:


  • replied
    Hi. Love this script, saves an incredible amount of time! However I haven't been doing my own collision mesh until now and I'm having some trouble exporting it with the rendermesh.
    Has something changed recently in Blender to break the collision part of the export? I've tried naming things in every way possible, following the "manuals" to a T but the collision mesh just doesn't seem to wanna be exported, this is with either one of your scripts, Nikhil and Paradox072.
    Manually exporting to FBX worked as expected and the collision mesh was included when I imported into UE4.
    If it wasn't for the fact that I have a massive scene with multiple assets that I have to move to 0,0,0 for every single export it wouldn't be such a hassle doing it manually :\

    Leave a comment:


  • replied
    Ok, got you.
    Now i am feel that i need to do some research about modern texturing approaches.
    Thanks for your replies.

    Leave a comment:


  • replied
    Originally posted by Paradox072 View Post
    P.S. There are those here who would help me understand how the fbx lod groups works inside? I know that blender exporter can't export lod groups, but as far as i know this exporter is open source, so, may be we can together implement this feature?
    P.S. start your own thread, paste a simple code on the thread and as your script grows move it to bitbucket or git. Here is some html to get you started..

    https://forums.unrealengine.com/misc.php?do=bbcode

    ..I tried messing around with blender addons but I wasn't successful then so I created a better solution where I put my code on dropbox which people in different locations with a bit of a modification to blenders engine can source my script automatically whenever they start blender..its good for internal development but addon would be better for the community.

    Leave a comment:


  • replied
    Originally posted by Paradox072 View Post
    Thanks for thanks!
    I planed to add more features to this script:

    1. Lod generation - type number, press button, and you will got some meshes that copied close to original mesh(1 bounding box left/right or some thing like that), to this meshes will be applied decimate modifier, with degrading values (0.5 -> 0.25 -> 0.125 -> ...)
    Of course it very far from perfect solution, but it can do some routine job. At least, in this case naming will be correct, and you got some set up, to create some lods.

    2. LOD / Coolision utilities
    - Group ungroup collisions/lod or link unlink to object
    - Hide/Show toggle for collisions/lods
    - Something else...

    3. ID Mat factory - Some times you need an ID map, to done some fast texturing in substance or ddo, so, this tools should make your life easier.
    - Generate specified number of materials with random or evenly shifted by hue colors
    - In a pannel will be a matrix of buttons, that helps you to fast assign first of 25 id mats
    - Fast delete this id-mats

    4. Automatic baking of normals, AO, ID...
    - Normal map will be baked from selected to active
    - Maps will be saved in to folder called "Bakes", that lives along .blend file. Images will be called "%RenderMesh%_MAPTYPE"
    - One big cool button, that will bake everything for all/selected objects in scene

    5. Some quick actions
    - Move object in to 10's layer and move it to empty place(Good for bundle moddeling, create your model on first layer, when done put it to the stash on tenth. When you done moddeling process you will got a nice row of your models on tenth layer)
    - Unwrap for lightmapping (it will create new uv set, and then two variants - 1'st - alias to default blender lightmap unwrapper, and repack copy of your current unwrap)
    - Add checker texture
    - to all render meshes
    - to selected meshes
    - Delete unused materials and textures

    But, i dont know when exactly it happens. Now i am learning a blenders python API. I planing to done some of this untill february. Later i will post a link to the reposytory on bitbucket or github, with some of this features.

    P.S. There are those here who would help me understand how the fbx lod groups works inside? I know that blender exporter can't export lod groups, but as far as i know this exporter is open source, so, may be we can together implement this feature?
    Simplygon is a better solution for LOD but yes LOD generation in blender would be great for simple models but would require allot of polishing.
    ID Mat looks like a good feature.
    Baking of Normals, Curvature, AO etc. is better in Substance, there is no baking in quixel at the moment they are working on that but we use quixel mostly for texturing and yes I think blender is great for baking simple models.
    The rest of your features looks great cant wait to check them out.
    About the .fbx exporting LODs, I have heard that Autodesk keeps changing their fbx code and it becomes quite tricky and tedious working with open source as it would be a constant development and not a practical solution I dont know maybe things will change.

    I have not used blender for some time as im developing my game in other aspects of the project that can be quite time consuming but you look psyched! All the best.
    Last edited by Nikhil Jeewa; 01-14-2016, 04:35 AM.

    Leave a comment:


  • replied
    Thanks for thanks!
    I planed to add more features to this script:

    1. Lod generation - type number, press button, and you will got some meshes that copied close to original mesh(1 bounding box left/right or some thing like that), to this meshes will be applied decimate modifier, with degrading values (0.5 -> 0.25 -> 0.125 -> ...)
    Of course it very far from perfect solution, but it can do some routine job. At least, in this case naming will be correct, and you got some set up, to create some lods.

    2. LOD / Coolision utilities
    - Group ungroup collisions/lod or link unlink to object
    - Hide/Show toggle for collisions/lods
    - Something else...

    3. ID Mat factory - Some times you need an ID map, to done some fast texturing in substance or ddo, so, this tools should make your life easier.
    - Generate specified number of materials with random or evenly shifted by hue colors
    - In a pannel will be a matrix of buttons, that helps you to fast assign first of 25 id mats
    - Fast delete this id-mats

    4. Automatic baking of normals, AO, ID...
    - Normal map will be baked from selected to active
    - Maps will be saved in to folder called "Bakes", that lives along .blend file. Images will be called "%RenderMesh%_MAPTYPE"
    - One big cool button, that will bake everything for all/selected objects in scene

    5. Some quick actions
    - Move object in to 10's layer and move it to empty place(Good for bundle moddeling, create your model on first layer, when done put it to the stash on tenth. When you done moddeling process you will got a nice row of your models on tenth layer)
    - Unwrap for lightmapping (it will create new uv set, and then two variants - 1'st - alias to default blender lightmap unwrapper, and repack copy of your current unwrap)
    - Add checker texture
    - to all render meshes
    - to selected meshes
    - Delete unused materials and textures

    But, i dont know when exactly it happens. Now i am learning a blenders python API. I planing to done some of this untill february. Later i will post a link to the reposytory on bitbucket or github, with some of this features.

    P.S. There are those here who would help me understand how the fbx lod groups works inside? I know that blender exporter can't export lod groups, but as far as i know this exporter is open source, so, may be we can together implement this feature?
    Last edited by JakErdy; 01-13-2016, 03:29 PM.

    Leave a comment:


  • replied
    Originally posted by Paradox072 View Post
    Hi, i just rewrite this script for my self. I fix some bugs, like - olny one collision primitive per mesh can be exported, also i done some optimisation. Also add some features for naming objects, and remove some default blender features, cause it simplier for me to done by hands. Also i wrap this script in to addon, becaue i tierd to run it every time when i restart blender.
    Change file extension from ".txt" to ".py", to install it as addon.
    In blender, go to File -> Add-Ons -> Instal from file -> 'path to "UnrealFBXTools.py"'
    Thats awesome!

    Leave a comment:


  • replied
    Originally posted by Paradox072 View Post
    Hi, i just rewrite this script for my self. I fix some bugs, like - olny one collision primitive per mesh can be exported, also i done some optimisation. Also add some features for naming objects, and remove some default blender features, cause it simplier for me to done by hands. Also i wrap this script in to addon, becaue i tierd to run it every time when i restart blender.
    Hey thanks, I was just about to look for something like this! Because adding collisions in UE4 is tedious as it right now, but this will remove a ton of headache

    Leave a comment:


  • replied
    Hi, i just rewrite this script for my self. I fix some bugs, like - olny one collision primitive per mesh can be exported, also i done some optimisation. Also add some features for naming objects, and remove some default blender features, cause it simplier for me to done by hands. Also i wrap this script in to addon, becaue i tierd to run it every time when i restart blender.
    Change file extension from ".txt" to ".py", to install it as addon.
    In blender, go to File -> Add-Ons -> Instal from file -> 'path to "UnrealFBXTools.py"'

    Here a little manual:
    # This script helps you export your meshes, with collisions and LODs in to UE4
    #
    # Naming process is prettey simple you just create collision meshes.
    # After creation you should select all collision of same type(Boxes, spherec or convex hulls),
    # active selection should be a Rendermesh, because collision will be named
    # in this style "UXX_%RENDMESH_NAME%_##". So, you should do it for each collision primitive type.
    #
    # LODs naming have unpredictable behaviour, because blender doesnt care about selection order,
    # (or actualy dose, but i dont know how exactly it works...) and names that you got, are unsorted.
    # For example, you have 4 lod, and final names will be like "LOD_%RENDMESH_NAME%_#", but you cant
    # know which of meshes will be _1 or _3, so on and so forth. After naming lods, you should check
    # mesh names, and if it wrong, change it by hands, it's prettey easy by the way, because you allready
    # have correct name, and only thing that you sould change, it's a digit at the end of object name.
    #
    # Batch export, do its job. You just select everything that you whant to export, and then hit
    # buton "Batch Export", it will store all of selected meshes in to sepparate files and name them
    # as object named in your scene. Lods will be export separatly, in to its own fbx containers,
    # and will be named as "%RENDMESH_NAME%_#.fbx"
    Attached Files

    Leave a comment:


  • replied
    Originally posted by sloppyjava View Post
    Very cool! just did a couple tests with it, but i do wonder, does the script use the last used fbx export settings in the main fbx exporter?
    Its been quite some time since I worked on Blender, I have been busy working on other projects. Im sure the script uses the latest fbx, if im not mistaken this is still the line of code for exporting fbx that I used "bpy.ops.export_scene.fbx".

    Leave a comment:


  • replied
    Very cool! just did a couple tests with it, but i do wonder, does the script use the last used fbx export settings in the main fbx exporter?

    Leave a comment:


  • replied
    Just want to say I like this program(script), it makes exporting a complete scene from Blender really fast....

    Leave a comment:


  • replied
    This is how I automatically source the script every time I start Blender.

    Open/Edit the following blender file:
    C:\Program Files\Blender Foundation\Blender\2.X\scripts\startup\bl_ui\space_view3d_toolbar.py

    Add the following two lines after the line: (# ********** default tools for object-mode ****************) (Make sure your file path is */* not *\*)

    filename = "C:/Users/name/Documents/GitHub/Blender-UE4-FBX-Export"
    exec(compile(open(filename).read(), filename, 'exec'))

    Start Blender

    Leave a comment:


  • replied
    Originally posted by minimalistico View Post
    question you create a git repo ??? o i can create one for this source code
    Sorry for the late reply minimalistico, I have been busy with some other work. I have added the script to GitHub.

    https://github.com/nikhil922/Blender-UE4-FBX-Export

    Leave a comment:

Working...
X