Mesh importer 1100
See also : Editor interface overview.
This page is for version v1.10.0 and above
For the latest version of PopcornFX, see: Mesh importer
- 1 Overview
- 2 Build process
- 3 Build settings
- 4 Building tetrahedral meshes
The mesh importer is what's used to import FBX meshes and animations into PopcornFX
It is split in 4 sections:
|2. Settings & treeview|
This panel allows you to configure import settings.
|3. Node properties|
When a settings node is selected in the treeview, its properties will be displayed here.
|4. Build buttom|
Here are a few debug visualizations you can get with the above buttons:
|Skeleton (#6,7,8)||Normals (#9)||Tangents (#10)||Bitangents/Binormals (#11)|
When you want to use a mesh inside PopcornFX, it first needs to be built in a format the PopcornFX understands. The editor or AssetBaker can build FBX files into those special formats.
The mesh vertices, skinning information, and skeleton, is stored inside a binary .pkmm file (standing for Popkorn multi-mesh)
The skeletal animation clips are stored inside .pksa files (standing for Popkorn skeletal animation)
The regular object animations and paths are stored inside a .pkan file, containings multiple animation tracks (standing for Popkorn animation)
Building an existing FBX
To build a new mesh that's already inside your PopcornFX project, just find the FBX in the Content browser (make sure the "Mesh" content filter is active), double-click on it to open the mesh importer, and if no built cache files are found, the viewport will be blank and the importer will automatically ask you if you want to import the mesh:
Click yes and a progression window will be displayed until the build is complete:
NOTE: The PopcornFX editor doesn't auto-rebuild FBX meshes. This means that if you already built your mesh, but modify the source FBX in max or maya or elsewhere, you will have to manually re-import it. Likewise, when upgrading to a new version of PopcornFX, sometimes the mesh formats change and are not require rebuilding cached files. This will require you rebuild all your meshes (see Batch-building multiple meshes)
Importing an external FBX
To import an external FBX, drag/drop it inside the content-browser (or copy/paste it inside your PopcornFX project directly), then build it as usual.
Batch-building multiple meshes
You can build a selection of multiple meshes, or even an entire folder, by right-clicking on the items you want to build in the Content browser, and select the "Build Assets" (Ctrl+I) menu item. A batch build will then launch, and a progression window will be displayed until the build is complete:
To author and import animations paths, you can follow this short tutorial
Build settings are saved in a .pkcf file (standing for Popkorn config) next to the source .fbx, with the same name. For example, if you have the following FBX in your project:
on first import, the PopcornFX editor will create this pkcf file:
The Root node contains the global properties:
The Geometry node contains the geometry-related properties
The Animation node contains the animation-related properties (both skeletal and non-skeletal)
The Kd-Tree node is an advanced configuration category allows you to tweak the Kd-Tree generation. (An acceleration structure used at runtime for mesh intersection, projection, and some other algorithms)
Building tetrahedral meshes
v1.10.0 / Experimental Tetrahedral mesh information is required if you want to use your mesh in a volume sampler
The tetrahedron-building algorithm is a complex beast, and is still in a highly experimental state, Therefore, the current implementation hasn't been optimized at all, and until we find a proper, stable, and reliable way to build tetrahedral indices, it won't be exposed into any "official" settings.
Also, the current algorithm won't (and can't) work with any mesh that does not fit the following criteria:
- closed, watertight envelope, no holes
- no mesh parts with non-manifold topology see also here and here.
- no t-junctions, only clean topology
- no intersecting triangles (watch out on character meshes, even with clean topology, such intersections might be found, around the armpits for example. It doesn't matter if the mesh is animated, and penetration occurs during animation, only the base pose from which the tetrahedrons will be built matters)
- no mesh above 10 000 triangles (this limit will be removed in future versions, and it's not a limit per-se, but the current building algorithm becomes exponentially slower. The runtime sampling is not affected and stays fast no matter the number of tetrahedrons)
The runtime is able to sample tetra-meshes efficiently, and the volume sampling runs smoothly, so, if you really want to build the volume sampling structures, here are the steps to follow:
1. click in the mesh importer viewport, and hit the 'T' key
This will startup the volume builder (it might take a while and the editor might appear to freeze. Then, you should see the following appear in the viewport:
The debug display shows:
- the original mesh on the left (as usual)
- the output volume mesh on the middle
- the source triangle mesh on the right
2. Consume the initial mesh and procude tetras
Hit the 'RIGHT ARROW' key to produce one tetrahedron at a time.
Hit the 'LEFT ARROW' to toggle auto-repeat on the left-arrow key
Hit the 'UP ARROW' key to launch continuous production, hit same key again to pause it, re-hit to resume
When you're satisfied with what's been produced, pause the tetra production.
As the original surface is consumed and tetras are produced, the debug display on the left hand side will show an increasing number of tetras, and the original volume vs tetrahedral volume.
The goal of the tetrahedral build is to reach a pretty close match of the original volume. But it's not always possible, so at some points you might see the 'New Vertices' count increase. These are additional vertices that were not in the original mesh. Usually this count becomes greater than zero at the end of the build, when the tetrahedrizer is left with an intricate remaining triangle surface it doesn't understand or know how to tetrahedrize, it will then try to insert new vertices somewhere on the existing surface, by interpolating existing vertices, and see if it helps.
You typically want to keep this count as low as possible (less than 5-10% of the original mesh verts), especially if the tetras volume is already really close to the original mesh's volume.
3. Hit the 'S' key to save the tetrahedral indices in the .pkmm mesh file
IMPORTANT: As this is a manual-only build process, if you re-import or re-build your mesh, you will loose the tetra indices, and will have to rebuild them manually again ! This can happen when baking your effect files if you check the "Full Rebake" option, which will overwrite the .pkmm in the editor's cache folder, and perform a full reimport of the FBX mesh, loosing the manually built volume information in the process.
This is pretty painful, but keep in mind it's an experimental feature we decided to give access to so you can play with it and test the early version, if you need volume mesh sampling.
All that will be improved in upcoming releases.