Blender To Unreal Engine 4

broken image


  1. Blender To Unreal Engine 4 With Textures
  2. Blender Character To Unreal Engine 4
  3. How To Export Blender To Unreal Engine 4
  4. Blender Export To Unreal Engine 4
  5. Blender To Unreal Engine 4
  6. Blender To Unreal Engine 4 Tutorial


Epic Games has released Send to Unreal and UE to Rigify, its plugins for transferring rigged and animated characters between Blender and Unreal Engine.

The tools, which have been in development for several months – the video above is from a preview livestream this February – are intended to streamline game development workflow in Blender.

Transfer character animations between Blender and UE4 in one click – if your scene scale is right
The add-ons provide a one-click transfer workflow, automatically converting Blender characters for use with UE4's default Mannequin, and UE4 rigs for use with Blender's Rigify auto-rigging add-on.

However, both currently have the same limitation as Blender's standard FBX exporter: that assets must be created using a Blender Unit Scale of 0.01 in order for bone scaling to work correctly in UE4.

That can cause workflow issues within Blender, discussed in more detail in this forum post.

As an alternative, many games artists rely on third-party add-on Mr Mannequins Tools, which is available on a pay-what-you-want basis, and which automates the scale conversion.

Learn the basics of getting your assets from Blender to Unreal Engine 4 in just 5 minutes! If you run into problems or have questions, please ask in the comm. This addons allows you to export content created with Blender to Unreal Engine 4. Working on object packs for Unreal Engine 4 can be complicated with Blender. That's why I created the Addons 'Blender for UnrealEngine'. 注意:このツールを使うには Unreal Engine 4.23 以降が必要です。 このトピックについては過去の Inside Unreal ライブストリームでも紹介しています。 Blender to Unreal tools, Part 1; Blender to Unreal Tools, Part 2; Blender to Unreal Tools, Part 3.

In a Reddit thread, Mr Mannequins Tools author Jim Kroovy commented that he will still continue to develop the plugin, but that he 'want[s] Send to Unreal to be THE Blender to UE4 export add-on'.

  • With Auto Smooth. Mark Sharp edges with auto smooth enabled in the normals section of the object. Set the smooth angle to be 180°, and when exporting set to 'normals only'. Importing From Unreal. If you are importing from blender to unreal, and get the degenerate tangent base problem check this. Blender weird shading.
  • While that is true there is also a few other things to note such to import materials you will need to check off the import materials checkbox in unreal for the import settings. Also materials will not always import properly from blender to ue4 since they use different node setups and languages so you will probably need to rebuild or tweak your materials in unreal.

Availability and system requirements
Send to Unreal and Unreal to Rigify are available under the Unreal Engine EULA. Both are free to download. The plugins are compatible with Blender 2.83+ and Unreal Engine 4.25+.

(If you're seeing a 404 error, link your Epic Games and GitHub accounts and log into GitHub)

Related posts:

Blender To Unreal Engine 4 With Textures

Tags: add-on, animated character, auto rigging, Blender, Blender to Unreal Engine, download, Epic Games, EULA, export character animation, export rigged character, FBX, free, Jim Kroovy, Mannequin, Mr Mannequins Tools, plugin, rigged character, Rigify, Send to Unreal, skeletal mesh, system requirements, UE to Rigify, UE4, Unreal Engine, Unreal Engine to Blender

Creating a destructible object in Unreal Engine 4 & Blender

While Chaos physics engine is on the way. We were testing approaches to make destroyables in Unreal Engine 4. Here you can find how we did it.

Requirements

As always we start by pointing out what we would like to reach:

  • Artistic Control. We want our graphics artist to be able to create destructible as they wish,
  • Don't break gameplay. They should be only visual representation not breaking any gameplay-related stuff,
  • Optimized. We want to have full control of performance and don't break CPU performance,
  • Easy to setup. They will be configured by graphics artists so we want them to be easy to configure without too many steps,

We were searching for best references that fit our needs and we found that destructible from Dark Souls 3 and Bloodborne fit perfectly for us.

Basic Idea

The basic idea is easy:

  • Have base mesh which is visible,
  • Add mesh parts which are hidden,
  • On break: hide base -> show parts -> enable physics,

Preparing assets

We are using Blender for object preparation, we recommend using it too.

To create fracture mesh we use Blender Addon called Cell Fracture.

Enable Addon

First you would need to enable the addon as it's not enabled by default.

Search for Addon (F3)

Then enable addon on selected mesh.

Github readme list. Configure Settings

Run addon

Check out our settings from video.

Select by Material to unwrap the cut parts

Then just create UVs for parts.

Add Edge Split

Edge Split will correct shading.

Blender Character To Unreal Engine 4

Link Modifiers

This will apply Edge Split modifier to all selected parts.

Final

This is how it looks in Blender. Basically we don't need to model all parts.

Implementation

Base class

Our destroyable is an Actor who has a couple of components:

Engine
  • Root scene,
  • Static Mesh which is our base mesh,
  • Box for collision,
  • Another Box for overlaps,
  • Radial Force,

We are configuring some things in the constructor:

  • Disabling tick, (basically always remember to distable tick on actors that don't need it)
  • Set mobility to static for all components,
  • Disabling affecting navigation,
  • Setup collision profiles,

In Begin Play we are gathering some data and configure them:

  • Search for all parts using 'dest' tag,
  • Setup collision for all of them so artist doesn't need to think about this step,
  • Set mobility to static,
  • Hide all parts,

Destroying part

There are three places which will trigger break:

OnOverlap
For example: when you want to break if someone is dashing or using the specific thing like rolling ball 😉

OnTakeDamage
When destroyable is receiving damage.

OnOverlapWithNearDestroyable
This one is important. When you put one destroyable on another one. In our case, they both break as we don't want to have too many specific physics issues to handle.

Breaking Part Flow

Handle sleep

When a part is going to sleep (from sleep physics event or forced sleep by delay) we are disabling physics/collision and set mobility to static. Thanks to that performance will increase.

Sometimes your physics asset won't go to sleep and will still update even if you don't see any movement. We are forcing all parts to go to sleep after 15 seconds if they still simulate physics:

Handle destroy

After breaking we are trying to check if we can destroy the actor (eg. player is far) if not – check again in some time.

On Part hit callback

Blender To Unreal Engine 4
  • Root scene,
  • Static Mesh which is our base mesh,
  • Box for collision,
  • Another Box for overlaps,
  • Radial Force,

We are configuring some things in the constructor:

  • Disabling tick, (basically always remember to distable tick on actors that don't need it)
  • Set mobility to static for all components,
  • Disabling affecting navigation,
  • Setup collision profiles,

In Begin Play we are gathering some data and configure them:

  • Search for all parts using 'dest' tag,
  • Setup collision for all of them so artist doesn't need to think about this step,
  • Set mobility to static,
  • Hide all parts,

Destroying part

There are three places which will trigger break:

OnOverlap
For example: when you want to break if someone is dashing or using the specific thing like rolling ball 😉

OnTakeDamage
When destroyable is receiving damage.

OnOverlapWithNearDestroyable
This one is important. When you put one destroyable on another one. In our case, they both break as we don't want to have too many specific physics issues to handle.

Breaking Part Flow

Handle sleep

When a part is going to sleep (from sleep physics event or forced sleep by delay) we are disabling physics/collision and set mobility to static. Thanks to that performance will increase.

Sometimes your physics asset won't go to sleep and will still update even if you don't see any movement. We are forcing all parts to go to sleep after 15 seconds if they still simulate physics:

Handle destroy

After breaking we are trying to check if we can destroy the actor (eg. player is far) if not – check again in some time.

On Part hit callback

We decided that Blueprints are responsible for audio-visual part of the game so we are adding Blueprints events where we can.

End Play and clearing out

Our game can be played in editor and custom editors created by us. That's why we need to clear out everything we can on EndPlay.

Configuration in Blueprints

The configuration is simple. You just put parts attached to the base mesh and tag them as 'dest'. That is it.

Graphics artists don't need to do anything else in the engine.

Our base blueprint class is only doing audio-visual things from events that we provided in C++. Citrix workspace 2006 for mac.

Begin play – load necessary assets. Basically, in our case each asset is soft object pointer and you should use it as well even when creating prototypes. Hardcoded assets reference will increase editor/game load times and memory usage.

On Break Event – spawn effects and sounds. Here you can find some Niagara parameters which are described later.

On Part Hit Event – spawn hit effects and sounds.

Basically we are always trying to implement logic in C ++ and use the Blueprint to configure parameters and do audio-visual things.

Utility to Quickly Add Collisions

You can create Utility Blueprint for Asset Type Actions to generate collisions for all the parts. Much faster than creating it by yourself.

Particle effects in Niagara

Niagara is life changer now. Here you can find how we created this simple effect.

Material

Erosion, color and alpha comes from Niagara.

As you can see most of the effect is coming from the texture. We could use B channel here to add more details but currently, it's not needed in our case.

How To Export Blender To Unreal Engine 4

Niagara System Params

We use two Niagara Systems: one for break effect (which is using base mesh to spawn particles) and the other one when a part is colliding. (without static mesh location)

Niagara Spawn Burst

Niagara Particle Spawn

  • We sample static mesh which comes from the destroyable,
  • Pick random Lifetime, Mass and Size,
  • Chose color from user color parameter, (which is set by the destroyable actor)
  • Spawn particles at mesh verticles location,
  • Add random velocity and rotation rate,

Sampling Static Mesh

To be able to sample static mesh in Niagara your mesh need to have AllowCPU checked.

TIP: In current (4.24) version of the engine if you reimport your mesh this value will reset to default. And in shipping build when you try to run such Niagara System with a mesh that doesn't have CPU Access enabled you will have a crash.

That's why we have added simple code to check if mesh have this value checked.

Which is used in Blueprints before spawning Niagara.

What is cool you can create an editor widget to find Destroyables, and set their Base Mesh AllowCPUAccess variable.

Here's the python code which is searching for all destroyables and set CPU access on the base mesh.

You can run it directly using py command, or create buton to run this code in Utility Widget.

Niagara Particle Update

On update we are doing couple of things:

  • Scaling alpha over life,
  • Adding some curl noise,
  • Change rotation rate using a custom expression
    (Particles.RotRate * (0.8 – Particles.NormalizedAge)
    Sometimes it's easier to do custom expression than a curve.
  • Scaling particle size over life,
  • Update material erode parameter,
  • Add some vector noise,

Niagara Learning References

You should definitely watch some presentations about Niagara. We will be doing more Niagara focused tutorials over time.

Blender Export To Unreal Engine 4

Why we are using such an old-school approach

Blender To Unreal Engine 4

We could use the current destroyable system from UE4 but we want to have better control over performance and visuals. You should ask yourself if you need a big system for your needs. In our case, we don't. As for Chaos, we are waiting when it will be production-ready.

One Response

Blender To Unreal Engine 4 Tutorial

  1. […] Source : https://kidswithsticks.com/creating-a-destructible-object-in-unreal-engine-4-blender/ […]





broken image