Skip to content

Dataprep Operations

Voulz edited this page Feb 26, 2021 · 6 revisions

Be aware:

The Dataprep Operations included in this plugin were made for my workflow bringing SketchUp files into Unreal. They should run properly on other files imported from other applications but I did not get an opportunity to test this. If you encounter any issue, please let me know via the Issues page.

Sample File Setup

To demonstrate the given Dataprep Operations, I made a simple Sketchup Model available here:

ArchVis_Dataprep_SketchupScene

Here is its hierarchy:

ArchVis_Dataprep_SketchupScene2 ArchVis_Dataprep_SketchupOutliner

To recap, we have a group called Rectangle + Cubes + Cylinder, containing a group called Cubes, another group called Cylinders, and the direct geometry of a rectangle (not in a group so not displayed in the hierarchy). The group Cubes contains the direct geometry of 2 cubes (not in groups), and the group Cylinders contains 2 instances of the same component Cylinder only containing geometry.

Here is how this file gets imported via Dataprep:

ArchVis_Dataprep_DPOutliner

Important to note:

  • the group Rectangle + Cubes + Cylinder gets separated into an empty Actor and a separate StaticMeshActor, with the Actor being the parent of the StaticMeshActor.
  • the group Cubes, even though it only had direct geometry, also gets separated into an empty Actor and a StaticMeshActor for each separate "pack" of connected geometry.
  • the component Cylinder (it doesn't matter if it a group or a component) does not get separated into an empty Actor and a separate StaticMeshActor, probably because it is the last element of the hierarchy.

Build Adjacency

The operation Build Adjacency is located in the Operations > On Mesh section. It allows the creation of adjacency mesh in the imported meshes.

When we try to apply a material with Tesselation and Crack Free Displacement (which is the case with Megascans Surfaces with Displacement turned on for example)

we need the mesh to have a adjacency information built-in else it will not work:

Re-importing the same file with the Build Adjacency node fixes the issue:

Explode

The operation Explode is located in the Operations > On Actor Hierarchy section. It move the children of the selected Actor to its own parent, optionally removing the actor itself.

In this example, we selected the Actor Cylinders and we exploded it, bringing its 2 children Cylinder directly in its parent Rectangle + Cubes + Cylinder. The actor Cylinders was deleted as the option Delete Exploded Actor was checked.

If we use the Explode node without any selection, it flattens the Hierarchy:

and if we uncheck Delete Exploded Actor, the hierarchy is also flattened but the empty group Actors are kept:

Material Name

The filer Material Name is located in the Select By > String Array section. It select StaticMeshes (not actors) that are using a Material which name matches the filter. It is useful if you import a file and you want to find which StaticMeshes use a certain material.

Simplify Hierarchy

The operation Simplify Hierarchy is located in the Operations > On Actor Hierarchy section. It deals with the fact that groups were imported into an empty Actor and a separate StaticMeshActor holding its geometry, and this operation replaces the empty Actor with the StaticMeshActor in the Hierarchy.

Note that in the Hierarchy:

  • the StaticMeshActor Rectangle + Cubes + Cylinder ends up replacing the empty Actor of the same name.
  • the group Cubes stays the same as it has multiple StaticMeshActors representing the geometry of the group. I will look into ways of merging them in the future.

For the operation to know which StaticMeshActor belongs to which empty Actor, it looks at the value of the Tag given into the option Tag Name. We can see that SketchUp groups get exported with a Tag called SU.GUID. which matches between the empty group Actor and the StaticMeshActor. If you end up using a file not brought from Sketchup, you will have to find the matching tag and input it into the option Tag Name.

Follow Camera

The operation Follow Camera is located in the Operations > Behavior section. It makes the selected actor follow the camera. It is intended to be used for SketchUp Components with the option 'Always face camera' turned on, so might not work as expected in other cases.

The node requires the name of the tag that defines which component needs to have this feature turned on.

It should also be noted that even though you might want to have the behavior visible in the Dataprep window after Executing the Recipe, it only works in the Editor Viewport (after commiting or reimporting) and in Game. Here are 2 screenshots from the editor window:

If the actor stopped following the camera and you do not know why, make sure that the Realtime viewport is turned on else it will not work.