-
Notifications
You must be signed in to change notification settings - Fork 37
Mesh improvements #464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DropTheSquid
wants to merge
36
commits into
ME3Tweaks:Beta
Choose a base branch
from
DropTheSquid:MeshImprovements
base: Beta
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Mesh improvements #464
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…, 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.
…s even if there are no expressions.
…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.
…nting static mesh export.
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.
…a few things to clean up.
…g is working correctly.
… 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.