Skip to content

Conversation

@DropTheSquid
Copy link
Contributor

@DropTheSquid DropTheSquid commented Feb 5, 2026

glTF import and export!
PSK replace mesh!
LOD import/export!
With this PR, I have implemented skeletal and static mesh export and import using the glTF file format, accessible as new experiments in my menu and within the mesh renderer and Mesh Explorer. All the non UI code is in a file in LEC so you can work with glTF files programmatically or from anywhere in LEX, and all the UI code is centralized despite it being used in several places).

It exports all LODs, sockets, and optionally basic materials (diff and norm) that Blender can easily import. the LODs and sockets can be imported back into LEX. It exports vertex normals and can import them back in as well. It can also generate vertex normals if they are absent.
Blender can import and export glTF files with a built in extension.

It can import one or more meshes as new exports or replace the selected mesh.

If you select a BioPawn or SFXStuntActor, it can export all the meshes associated with them in a single file.

In addition, I implemented PSK export and import of LODs, as well as PSKX export of static meshes (but not import; could do this later if there is demand).

Overall, this should vastly simplify the workflow for working with sockets, multiple LODs, static meshes, vertex normals, etc.

Other small things. I wrote a new bit of code to find the best diff and norm for a given material. It includes a few fixes for cases where it can't find anything or picks the wrong texture in the LEX preview. We should consider unifying these bits of code.

…, bioMorphFace export, and MorphTargetSet export. Also added default filename suggestions based on the export name.
…r LOD import. It works correctly for import as new mesh.
… base mat. Also added texture export to the Skeletal Mesh export.
… need to make sure I didn't break anything else (i probably did) and test more edge cases.
…il if the base head was an import rather than an export.
…t is working correctly. Import is still only half implemented.
…nto account and normalizes Vectors and Quaternions when appropriate.
…iant (flipped green channel compared to ME).
…lly setting them up in UDK. Need to test more to make sure it works.
system to select what kind of materials you want to export. currently none (just the name) or textured with diff and norm.
implemented most of glTF to Intermediate mesh. still need to deal with collision meshes and transforms
implemented most of restoring the vertices to their original order, which matters a lot for certain use cases.
Also, I fixed a bug that would make separate vertices per triangle on export. whoops. memoizing now which should also improve performance? I have also made import much more efficient if shared accessors are used.
… LEC, made a few shared methods usable by anyone, imrpoved the hueristic to pick diff and norm textures to export, and added better support for exporting multiple meshes at once. I used this to implement exporting all meshes for a BioPawn at once.

Also added a busy bar and moved export to the background so it doesn't just freeze the whole UI while it runs.
also implemented marking materials as two sided if they are marked such in the game files on the base material.
…mals are exported by default from Blender and I recommend using those, but the results of this algorithm are accetable.
…added special cases for some materials that fail with the default handling, picking the wrong diff.
…SFXStuntActor.

Also changed the implementation of conversion a little bit to be more resiliant against slightly corrupt data from the game, which is present in at least one place in vanilla.
…e armature that are not LODs of each other, or multiple static meshes under the same parent node/at the root.
…renderer alongside the uModel button and in the Meshplorer tools menu and right click menu.
It will fill in LODs by duplicating the lowest LOD until there are 3. This is useful for adding LODs to a head/hair etc to prevent melting while allowing the body and stuff to still go to lower LODs.
Alternately, there is a new experiment to remove all LODs. You can do this to a body to prevent face melting. This is the quicker version of the old "Export it and then reimport it as single LOD" workflow.
Also moved a bit of repeated code into a helper class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant