How to edit models - Lyingcake77/Nexus-Buddy-Hades-2 GitHub Wiki
Welcome to the Nexus-Buddy-Hades-2 wiki! This will be the initial documentation on how to find, decompress, extract, modify, patch, and re compress 3d models in hades 2. Reference links are at the bottom.
step 1 pull down the lz4 python files and use the python lz.py -d {.\filename} to decompress, and lz.py -c {.\filename} to re compress
step 2
install nexus buddy, you can review the files using the gr2_viewer bundled with the app and the nexus buddy 2 tool.
step 3:
open the Gr2 and extract the 3d model to nb2 using nexus
step 4 install and setup blender 2.79, import scripts
step 5 import to blender, make edits* (see blender section below), export to br2
step 6, replace meshes with new br2
step 7, apply modifiers to original meshes. modifiers use .dds files if no modifiers exist. If no modifiers are applied, the game crashes on startup.
step 7b, create a new modifier and apply your own .dds material. its still a little unclear what takes priority when it comes to textures and materials. There is a UV map path to a texture, and a texture or texture reference in the Gr2,
step 8 compress. lz.py -c {.\new gr2 file path}
step 9 If you are replacing a model, (keep a backup of the original). otherwise, replace the old Model.Gr2.LZ4. In theory, you should be able to reference a new model using the SJson files and simply point the path to the new model.
blender:
Modeling notes:
as someone who does not do 3d modelling and have only played around with it, this is my best attempt and making edits without breaking things accidentally. below are my techniques and findings for what can be done with the tools provided to me.
step 1. after importing the nb2 file, review the items in the model. a skeleton (armature) probably shouldnt be messed with assuming you are altering the existing model. meshes need to be linked under the root and linked to the armature.
step 2: In this example, i will edit the weapon with a custom model.
import obj
step 3
press s to scale the new model to size.
step 4
select both models individually, enter edit model, press z to enter wire frame view. ctrl+mouse to highlight axe to and press x to delete highlighted vertices
step 5
move new weapon to where the original axe existed, shift+d to duplicate object.
step 6
shift select the new object and the existing model in that order. press j to join objects together.
Do this for both sets. note that not all models are set up this way. in this case, one object is an outline whereas the other is a true mesh that has a texture applied. nexus at the moment also doesnt import one of the meshes not attached to a root skeleton.
step 7
apply weights on the new object mesh in both models. the br2 export doesnt work otherwise. press z to go into wire frame mode to apply the weight everywhere. do this for both objects. (MAKE SURE YOU WEIGHT EVERY VERTEX.)
step 8
if you are adding a competently new model, make sure the new model is a child of the root armature and that the following modifiers are applied.
step 8b
vertex groups may be important as well when linking a bone to a specific part of the mesh. additionally, the UV map should be the metadata that links a model to a texture
step 9
export to br2
continue from where you left off.
Animation Notes:
animation: WIP
step 1
when in nexus, open the animation gr2, then export animation to NA2
step 2
in blender, open the original 3d model br2, then import nb2. in this case, i am leaving off from the mesh edit. (some tweaks are needed to match bones with meshes) this is out of my wheel house.
step 3
in addition, making the animation edits are also out of my wheelhouse. you tube will have to be your friend. generally speaking, you'll need to open the animation section, open pose mode, and begin moving the skeletons around and applying the frame at each point.
step 4
once animations are ready, export model to fbx.
step 5
the idea should be to import the fbx see the animation, then select save animation.
that being said i struggled with this part and couldnt get it to work.
step 6 then you would follow the same pattern as earlier and export convert to an lz4 and import the file.
additional thoughts:
boundary issue:
when editing and overwriting some models, the boundary breaks (weapons for example)
Nexus overwrites only the mesh and models, that being said, it overwrites all meshes even if they arent linked to a model (which all gr2 files seem to do). its either this or some other value that determines the boundary of a model when it renders in game.
Plans to update future if the project doesn't immediately get forgotten about: currently working on a rework of nexus to be a bit more hades specific. I m trying to put together all the pieces required to get everything to work with more up to date versions. (i.e how the export works, and bundling the lz4 packaging) hopefully i can mix in both lslib and nexus buddy together. since both have their strengths but both miss out on specific hades 2 structures.
reference links: nexus buddy 2 source: https://forums.civfanatics.com/threads/nexus-buddy-2-granny-editor-for-civ-5.496855/
extract models: https://forums.civfanatics.com/threads/extract-gr2-to-blender-with-mesh-and-skeleton-and-re-export-to-gr2.495207/
editing animations: https://forums.civfanatics.com/threads/extract-gr2-animations-into-blender-and-re-import-to-civ-v-civ-be.564873/
blender scripts: https://forums.civfanatics.com/resources/blender-scripts-for-civilization-v-and-civilization-vi.25925/
compress and decompress lz4: https://github.com/Huss-9/LZ4-Compression-algorithm
blender 2.79: https://download.blender.org/release/Blender2.79/
blender 2.49: https://download.blender.org/release/Blender2.49b/