Leaderboard


Popular Content

Showing content with the highest reputation on 05/02/2024 in Posts

  1. 1 point
    View File KotorBlender (for Blender 3.3+) This add-on is a fork of KotorBlender, upgraded to support newer versions of Blender. KotorBlender is in turn based on NeverBlender, forked from version 1.23a. ## Features - Import & export MDL models, including walkmeshes - Import & export LYT files - Import & export PTH files ## Installation 1. Clone this repository or download the latest release of KotorBlender from Deadly Stream 2. If you have cloned the repository, create a ZIP archive containing the **io_scene_kotor** directory 3. From Edit → Preferences → Add-ons in Blender, install the add-on from the ZIP archive and enable it by ticking a box next to "Import-Export: KotorBlender" 4. Alternatively, if you want to contribute to KotorBlender, you may want to create a symbolic link to the local repository in the Blender add-ons directory, typically located at `C:/Users/{user}/AppData/Roaming/Blender Foundation/Blender/{version}/scripts/addons`. 1. `mklink /D io_scene_kotor {repo}/io_scene_kotor` ## Usage ### Data Preparation Extract models, textures, walkmeshes, LYT and PTH files into a working directory, using a tool of your choice, e.g. reone toolkit. Recommended directory structure: - *data* — extract all BIF archives here without subdirectories - *texturepacks* - *swpc_tex_tpa* — extract swpc_tex_tpa ERF archive here If you plan to edit textures, batch-convert TPC to TGA / TXI files using **reone toolkit**, although TPC textures are also supported by KotorBlender. ### Model Import and Export 1. Import via File → Import → KotOR Model (.mdl) 2. Select top-level MDL root object to be exported 3. Export via File → Export → KotOR Model (.mdl) ### Editing Animations To edit list of model animations and corresponding events, select MDL root object and navigate to Object → KotOR Animations. KotorBlender supports both object and armature-based edits. To create an armature from objects, navigate to KotOR Animations → Armature and press Rebuild Armature and Apply Object Keyframes. Before exporting a model, make sure to copy armature keyframes back to objects by pressing Unapply Object Keyframes. ### Lightmapping 1. Select objects for which you want lightmaps to be recreated, or unselect all objects to recreate all lightmaps 2. Press KotOR → Lightmaps → Bake (auto) UV mapping: 1. Select objects having the same lightmap texture and enter Edit mode 2. For every object, ensure that `UVMap_lm` UV layer is active 3. Select all faces and unwrap UVs via UV → Lightmap Pack, increase Margin to avoid face overlapping Fine-tuning: 1. Increase lightmap image size via UV Editing → Image → Resize 2. Tweak ambient color via Scene → World → Surface → Color 3. Manually toggle rendering of objects in Outliner and press KotOR → Lightmaps → Bake (manual) 4. In Scene → Render, set Device to GPU Compute to improve performance, set Render Engine to Cycles if not already 5. In Scene → Render → Sampling → Render increase Max Samples to improve quality ### Minimap Rendering 1. Press KotOR → Minimap → Render (auto) 2. Open "Render Result" image in Image Editor and save it as "lbl_map{modulename}.tga" 3. Open "MinimapCoords" text in Text Editor and copy-paste generated properties into module .ARE file using any GFF editor Fine-tuning: 1. Tweak background color via Scene → World → Surface → Color 2. Manually toggle rendering of objects in Outliner and press KotOR → Minimap → Render (manual) ### Connecting Rooms 1. Select a room walkmesh 2. Enter Edit mode and select two vertices adjacent to another room 3. Determine 0-based index of the other room into the LYT file 4. Enter Vertex Paint mode and set brush color to (0.0, G, 0.0), where G = (200 + room index) / 255 5. Ensure that brush blending mode is set to Mix, and brush strength is set to 1.0 6. Paint over the selected vertices ### Editing Paths 1. Extract PTH file from the module's RIM file, e.g. "modules/danm13_s.rim" (Kotor Tool, reone toolkit, etc.) 2. Import PTH into Blender via File → Import → KotOR Path (.pth) 3. Create/move path points, or modify path connections via Object Properties 4. Export PTH via File → Export → KotOR Path (.pth) ## Compatibility Known to work with Blender versions ranging from 3.3 to 4.0. ## License GPL 3.0 or later Submitter seedhartha Submitted 03/18/2021 Category Modding Tools  
  2. 1 point
    It enables a procedural dirt effect over the selected mesh when rendered in-game. You should be careful when enabling it. It's not compatible with envmaps if I recall correctly. To enable it, simply tick the checkbox.
  3. 1 point
    Released 3.4.0 with this and a couple of other fixes, but most importantly I have reworked the UI. It now fits Blender 2.8 style alot better. Here are some screenshots:
  4. 1 point
    Was a bug, fixed it in the repo. Doesn't feel good spamming DS with all the minor versions, so I guess I'll wait until more bugfixes are accumulated.
  5. 1 point
    In 3.3.0 now you can. You can even add supermodel animations on top of head models and they will look ok. I have also finally fixed precision issues with export of custom normals. Exported models now look exactly as they were imported, and MDLedit no longer raises a warning. Overall, I did some testing and this version seems to be pretty robust. I'm tempted to say it's final for now.
  6. 1 point
    Reworked armature support in version 3.2.1. Tried exporting armature keyframes directly, but this solution ended up being too complex and slow. So this is how editing animations currently works (and is very likely to stay that way, since I'm satisfied with the result): Import model with "Import Animations" ticked Select animation under Object Properties -> Odyssey Animations and press Play button to focus on it Position bone objects, insert/remove keyframes, etc. Set current frame to frame 0 or exactly 5 frames left from any animation. That is the Rest Pose Press Rebuild Armature. This step is entirely optional, but useful if you want to test your animation with the skinmesh Export model with "Export Animations" ticked
  7. 1 point
    Published version 3.2.0. Thank you guys for asking and making me look at things more thoroughly. I've fixed some custom meshes related issues, particularly modifiers not being applied on export. More importantly, I've added an option to merge duplicate vertices and mark sharp edges, which is a similar feature to smoothing groups in Max. This is important because KotOR models have a LOT of duplicate vertices, which is exactly how smoothing groups work - they create additional geometry where surface needs not to be smooth. Same result can be achieved with sharp edges and Edge Split modifier in Blender. Some example screenshots: New Import Options Normals Algorithm = None (normals are ignored) Notice sharp edges on the head, despite normals not being imported. That is because of duplicate vertices. Normals Algorithm = Custom (MDL normals are used as is) Notice how smooth edges on the left arm are. There are duplicate vertices there, but custom normals make them look smooth. Normals Algorithm = Sharp Edges, Sharp Edge Angle = 10 degrees (duplicate vertices are merged and sharp edges are marked) Notice how edges on the head are still sharp, despite duplicate vertices being merged. That is the result of these edges being marked as sharp. Unfortunately, edges on the left arm were not marked as sharp, because we could not merge duplicate vertices there - they have different UV coordinates. This happens on more than one model - maybe I'd need to improve the algorithm in the future.
  8. 1 point
    Don't see the diff in the first two pictures. This is what I think is going on: Sharp Edges and Auto Smooth are a display-only thing in Blender. These affect how split normals (vertex normal per polygon) are calculated, but do not result in new geometry. Because split normals are not supported by MDL, what current approach does is it calculates vertex normal as an average of its split normals, effectively cancelling them out, unless all split normals are pointing in a single (imported) direction. What you need to do instead, with custom meshes, is to add Edge Split modifier to your mesh and apply that prior to export (KB doesn't automatically apply modifiers on export, regression on my part). Edge Split generates new geometry based on sharp edges and angles between edges, which is exactly what we need. With Edge Split you no longer need Auto Smooth, Custom Split Normals or Export Custom Normals. P.S. Since you're also using quads, make sure to download KB 3.1.1 (or later) - it fixes export of quads UV.
  9. 1 point
    My problem may arise from the fact that I am using a completely custom model. To illustrate the problem: No Custom Split Normals and Export Custom Normals is unchecked: Custom Split Normals and Export Custom Normals is checked: same model in blender with Custom Split Normals: Same model with sharp edges shown:
  10. 1 point
    I've just realized that I don't fully understand how normals work in Blender under the hood, and that results on export are most likely incorrect. Will have to investigate this some more. UPDATE: False alarm. Current approach works, although exported normals a tiny bit different from original values, most likely due to precision error. To answer your question, in order to export an "auto smoothed" model, you tick Export Custom Normals checkbox on export and ensure that Custom Split Normals Data is set under Object Data Properties -> Geometry. When "Import Normals" checkbox is ticked on import, Custom Split Normals Data and Auto Smooth are set automatically.
  11. 1 point
    Published version 3.1 of the add-on with import & export of original normals, support for saber meshes and optimized export.
  12. 1 point
    There's a rollout for the OdysseyBase where you can edit the supermodel, the same as in KMax. Blender's way of doing things is just a lot more clunky and obtuse.
  13. 1 point
    The only significant workflow change is that you'll be able to drop MDLEdit and the ASCII to/from conversion. Everything else will remain the same. Once the importing of vanilla normals is implemented, that will solve some shading problems that can happen currently due to the smoothing group approach. But it won't fundamentally change anything about how handling models works.
  14. 1 point
    Number of things, including swapping some function pointers and appending additional data to mesh headers. This has everything to do with model format and almost nothing to do with its contents. i.e. you cannot target K1 supermodels from K2 models without some modification of the bone structure. This is by design, and I have no intention to automate these modifications at the moment. Smoothing groups is a 3ds Max concept to influence vertex normal calculation. MDL knows nothing of smoothing groups and so does Odyssey engine. What I meant by lack of smoothing groups is that in version 3.0 of KotorBlender, original normals are not preserved, and shading might get screwed. However, I have since implemented import & export of original normals and will soon release an update.
  15. 1 point
    Note that taking MDLEdit out of the loop doesn't change anything else. You'll still need to rerig most models when switching from one game to the other.
  16. 1 point
    Nope, you just check or uncheck "Export for TSL". No need for MDLedit at all.
  17. 1 point
    Just tested this and yeah - we can import and export original normals, no problem.
  18. 1 point
    So does this mean that KBlender will be able to import/export the model's original normals directly rather than dealing with MDLEdit/KMax's hacky conversion to/from Max smoothing groups (which is a legacy of MDLOps/NWMax's ASCII format)? Because that is the single biggest problem with the current Max/GMax workflow, causing all sorts of broken shading issues, especially on head models.
  19. 1 point
    For those interested, version 3.0 of KotorBlender is out. ASCII MDL / PTH workflow has been dropped in favor of binary importer & exporter. Binary MDL support is mostly on par with MDLops/MDLedit, except it lacks smoothing groups and cannot export saber meshes. I will fix these as I go. Other plans include streamlining the editing process, e.g. one-click lightmap baking and working with multi-material objects, armature animation export, advanced shader node setups, etc. Also, an interesting discovery I made about the MDL format - both MDLops and MDLedit expect per-vertex "tangent space" data to have the following layout: Bx By Bz Tx Ty Tz Nx Ny Nz, where B is a bitangent, T is a tangent and N is a normal. However, my experiments show that "tangent space" is actually a transposed TBN matrix, which makes a lot more sense from the engine standpoint: Tx Bx Nx Ty By Ny Tz Bz Nz.
  20. 1 point
    Hey, guys. Just wanted to give you a heads up that I'm in the middle of updating the add-on, enabling import and export of binary models based on MDLedit. I noticed that @Arson Hole is using the master version from GitHub. This one is not being properly tested and could be unstable. Please use version 2.1.0 from this site instead, and make sure to put all addon files under a folder named kotorblender, as @Hunters Run just said.
  21. 1 point
    That is a known issue - same goes for pre-2.8 version of the add-on. Apparently, it has something to do with keyframe interpolation. Exported animations and imported armatures work OK though, so it's not exactly high on my todo list. I'm not aware of any hard limitations of KotorBlender, with regards to creating new characters. It may not have as many utilities as NWmax, it lacks tutorials, but you can certainly model, texture and rig new characters using KB.
  22. 1 point
    Status update: I'm releasing version 2.0.0, which is the first non-beta version of the updated add-on. I've tested it on quite a few models, doing modelling, texturing, rigging, animation, etc. I think KotorBlender is now on par with KotorMax in terms of functionality: it works equally well for editing (and creating) character and area models, and I'm quite happy with the result. Here's the excerpt from the release changelog: Rewritten handling of materials and lights (Eevee) Made materials configurable from Object Properties Implemented import & export of LYT files Implemented import & export of ASCII PTH files (reone-tools) Implemented armature creation (no animations yet) Fixed MDLedit compatibility issues Removed NWN-specific functionality Disabled minimap rendering (until later) Code cleanup and refactoring in accordance with Blender and Python code styles
  23. 1 point
    Status update: I've done a couple of beta releases (now at beta 4), where I've improved compatibility with MDLedit and added support for editing PTH files. For those interested in baking lightmaps or editing PTH files in KotorBlender, I've listed the necessary steps in the description.
  24. 1 point
    Fix is in the repository (mesh removal made redundant after upgrade).
  25. 0 points
    Hello everyone! Can someone please help me with my Companion Cat mod? I just need someone to export my model and its respective texture as .MDL and .MDX files for both KOTOR I and II, as I have tried alot already but I either can't wrap my head around it (i have zero knowledge of Blender or any other 3D modeling tools) or there is a problem with my blender version or kotorblender plugin. I know the model is not rigged, and that it would take a tremendous amount of work to properly rig it, so I am not asking anyone to do anything like this! This is why I kindly ask You to just leave it unanimated, as is, just floating around over ground level! I would be very happy just with this result! I have attached the model .blend file and the accompanying texture below. I am kindly asking You to just export the model and texture as KOTOR I and II .MDL and .MDX files! Many thanks in advance and have a great weekend! @seedhartha cat.blend