Etherael Posted 1 hour ago Posted 1 hour ago (edited) https://pixeldrain.com/u/58qa8CZG https://www.virustotal.com/gui/file/db3448fde5bbe279d34c6f60f52f61cc4a75e86824d6bc90977e1789d4e3f6b2?nocache=1 Keys Click-Select G-Move R-Rotate F-Focus selection CtrlD-Duplicate Del-Delete CtrlZ-Undo WASD-Fly ↑↓←→-Fly with arrows V-Walk in first person QE-Down / up T-Top view O-Select objects L-Select rooms AltClick-Pick a room once Esc-Deselect Placement Drag the arrows to move it inside the room. Meshes below it move too. Collision lives in the room walkmesh and does not follow. Turn Model Replace hides this mesh and puts a model in its place, with the same position and facing. ------ 0.1 Holowan Module Editor, a 3D level editor for KotOR and KotOR II that runs in your browser. Point it at your game install folder and pick an area. It shows the rooms with their textures and baked lighting, plus the walkmesh. You can move, rotate, add and delete objects, then export a .mod file. I haven't run it on real game files, because none were available here. The file-reading code was checked against two existing KotOR tools, PyKotor and xoreos. I also round-tripped files PyKotor wrote, including KotOR and KotOR II models, walkmeshes, .git files and archives. The included demo area worked end to end in a headless browser: selecting, editing, adding objects, undo, and building the .mod. What you can do: Objects you can edit: creatures, placeables, doors, waypoints, triggers, encounters, sounds, stores, cameras, and the player start point. Moving and rotating: use the on-screen handles or type exact numbers. Floor snap keeps objects on walkable ground. Trigger and encounter shapes: you can drag their individual corner points. Real models: placeables and doors use their actual models, looked up from placeables.2da and genericdoors.2da. Creatures show as coloured markers. Other properties: every other field on an object can be edited in the right-hand panel. Undo and redo work for everything. Exporting: How to install it: the .mod contains the whole module with your changes. Drop it into the game's modules folder and the game uses it instead of the original .rim files. Back up first: the .mod changes the area for any save that enters it. Saving from the published page: the page can only save .zip files, so you get the .mod inside a zip. If saving is blocked there, use holowan-editor-standalone.html, which saves the plain .mod directly. Open it in Chrome or Edge. Limits: Area layout: rooms can't be moved, and walkmeshes and scripts can't be edited. Brand-new objects: these need an existing template name, such as a .utp or .utc file from the game or your override folder. Folder prompt: your browser will ask to "upload" the folder when you open it. Nothing leaves your computer. Mac versions: the Aspyr Mac versions use a different folder layout and may not be detected. ------ 0.5 The editor can now select and change the static level geometry (the rooms) and the individual meshes inside them. Both the published page and holowan-editor-standalone.html are updated. I've only tested this on the demo area plus a multi-mesh room model built with PyKotor, not on real game modules. In that test, moving, rotating, retexturing, hiding, duplicating, deleting, undo and export all worked. The edited models and walkmeshes also read back correctly in PyKotor. It's still unconfirmed whether the game accepts a rotated or renamed room in practice, so try one module first and keep backups. How to use it: switch the viewport's Select control to Rooms (or press L, or Alt+click). Click a room to select it, then click it again to drill into the mesh under your cursor. Rooms also appear at the top of the Scene list. Whole rooms: Move and rotate: drag them, or type exact values. The walkmesh moves with the room, and objects standing on it come along unless you untick that option. Replace: swap in another room from the game by typing its name (it suggests names as you type), or load your own .mdl, .mdx and .wok files. Textures can be added alongside. Duplicate, delete, or add: new rooms come from the game or from files via Add. Replaced, duplicated and added rooms get a new name, so the original game model stays untouched. Meshes inside a room: Retexture: change its texture or lightmap, or use your own .tga or .tpc file. Hide or move: hidden meshes show as a faint wireframe while their room is selected. Child meshes move with their parent. Collision doesn't change: collision lives in the walkmesh, so hiding or moving a wall leaves the blocked area where it was. On export: Files written: the .mod includes an updated layout, room visibility list, and any changed models and walkmeshes. Room links: where rooms meet edge to edge, the export recalculates the walkmesh links that let creatures path from one room to another. Doors: door positions recorded in the layout move with their room. Limits: Rotation: rooms rotate around the vertical axis only, and meshes inside a room can be moved but not rotated. Lighting: baked lighting doesn't update, so a moved prop keeps the shadows from its old spot. Game version: a model built for the other game gets a warning and may not show up in game. Bad joins: if two rooms meet with mismatched edges, no link is created between them. ------------ 1.0 Meshes inside a room can now be duplicated, replaced with another model, or have new models added alongside them. The editor and holowan-editor-standalone.html are both updated. I tested this on the demo hangar with a multi-mesh model I made in PyKotor, not on real game files. Duplicate, replace, add, turn, remove, undo/redo and export all worked. The exported models read back correctly in PyKotor, including models moved between KotOR and KotOR II in both directions. The game itself hasn't loaded one yet, so try a single room first and keep backups. How to use it: with Select: Rooms on, click a room, then click one of its meshes. Duplicate: copies the mesh, and anything attached below it, 1.5 m along X. Then drag it into place. Replace: type a game model name (it suggests names as you type), or pick your own .mdl and .mdx files with any textures. The original mesh is hidden rather than deleted, so Show mesh brings it back. The new model takes the original's position and facing. Add a model: in the room's panel, under Add a model to this room, pick a model and click where it should go. It becomes part of that room's model, and the panel lists everything you've added. Turn: ±15° and ±90° buttons rotate a mesh or added model around the vertical. Reset placement undoes both moving and turning. Remove: takes out models you added. Original meshes can only be hidden, which is the safer option for stock geometry. Whole added model: clicking a part of an added model lets you Select all of it, so you move it as one piece. Keyboard: Ctrl+D duplicates and Delete removes or hides the selected mesh. Things to know: Collision: collision comes from the room's walkmesh, so added or moved props have none, and hidden walls still block. Lighting: added models have no baked lighting, so they look flatter than the room around them. Mesh types: only plain meshes copy fully. Animated or skinned meshes are copied without their skinning or sway, and lights, emitters and walkmesh pieces from a source model are dropped. Some meshes can't turn: a few store their rotation in a compressed form the editor can't change, so those can only be moved. -------- 1.1 The editor now has a first-person walk mode, and the arrow keys move you in both walk and fly modes. The published page and holowan-editor-standalone.html are both updated. I tested it in the demo area. Walking forward, turning and dragging to look all worked. Running into a corridor wall stopped me at the edge and slid me along it. The arrow keys also moved the normal editing camera. Turn it on or off: press V or click the new Walk button next to Top and Frame. Esc or V stops walking. Where you start: at the selected object, or where the camera was looking. If neither is on the floor, you start at the Player start. Moving: ↑ / ↓ walk forward and back, ← / → turn, and A / D step sideways (W / S also walk). Hold Shift to run. Looking: drag in the viewport to look around. Double-click to lock the mouse so it looks without dragging. What stops you: like the game, you can only walk on walkable floor. Non-walk areas, walls and the edges of rooms stop you, and you slide along them. You follow stairs and slopes up and down. Leaving walk mode: the editing camera picks up from where you stopped, looking the same way. Phones and touch screens: an on-screen arrow pad appears while walking. Normal editing: ↑ / ↓ fly forward and back and ← / → slide sideways, alongside WASD and Q/E. Doors, placeables and creatures don't block you, because walking only checks the floor's walkmesh. Clicks don't select anything while you're walking. ------ 1.2 The editor now works with a PS4 (DualShock 4) controller for flying, walking, selecting and moving things. The published page and holowan-editor-standalone.html are both updated. I tested it with a simulated DualShock 4, not a physical one. Flying, stepping through objects, grabbing and dropping, cancelling, undo, walking with sprint and looking around all worked. The embedded page may not see the controller, because some browsers block gamepads inside embedded pages. If that happens the right-hand panel says so; open holowan-editor-standalone.html in Chrome or Edge instead. Connecting: plug in by USB or pair over Bluetooth, then press any button. The browser only reveals a controller after a button press. A "connected" message appears, and the full button map shows in the right-hand panel under PS4 controller. Editing view Control Does Left stick Fly around (L3 for a speed boost) Right stick Orbit the camera L2 / R2 Lower / raise D-pad ↑ ↓ Zoom in / out D-pad ← → Previous / next object, with the camera following × Select whatever is at the centre crosshair △ Grab the selection; × drops it as one undo step, ○ puts it back ○ Deselect, or cancel placing □ Focus the selection L1 / R1 Undo / redo R3 Switch between selecting objects and rooms Share / Touchpad Top view / frame the area Options Start walking While grabbed, the left stick moves the object relative to the camera, the right stick turns it, and L2 / R2 lower and raise it. Rooms and meshes inside rooms can be grabbed the same way. Walking Control Does Left stick Walk and sidestep (analog, so a light push walks slowly) Right stick Look around R2 (analog) or L3 Run D-pad Step forward or back, turn left or right × Select what you're looking at ○ or Options Stop walking The controller gives a short rumble when you walk into a wall or the edge of the walkable floor. OPEN to Suggestion on features ------- Kotor Model Viewer 1.4 - Etherael https://pixeldrain.com/u/t1nwyPVU https://www.virustotal.com/gui/file/a3faf4989f6611148bf3b181e516b55ebd1711a2ba6d9b37f8298e0c85c39ec7?nocache=1 -------- 1.0 You can now select individual model parts and swap their textures. The published link is updated, and the attached file is the offline copy. I tested the click-to-select logic against your bantha in Node (a click in the middle of the model selected the body, and a click in a corner selected nothing), but I haven't tried the texture swap in a browser. Selecting a part: click it in the 3D view, or click its name in the mesh list. The selected part gets an orange tint and a "Selected part" panel appears. Dragging still rotates the view, and a click only selects if you didn't drag. Clicking empty space deselects. Replacing its texture: press "Replace texture…" and choose a .tga, .png or .tpc file. The part switches to it immediately, and the list marks it with ✎ and the file name. Apply to all parts using this texture: tick this box before replacing (or restoring) to change every part that shares that texture, such as all the body pieces. Restore: puts the selected part, or all parts sharing the texture if that box is ticked, back to their original texture. Limits: The part's normal map still comes from the original texture's name, so your replacement keeps the original surface detail. Replacements exist only for this session and are lost on reload, and you can't save or export the edited model. Hidden parts can't be clicked in the view unless "Show hidden meshes" is on. The orientation caveat from before still applies to .tpc replacements: if one looks upside-down, tick "Flip V". ------- 1.1 The viewer can now save and reload projects, load whole folders, and export OBJ and FBX. The published link is updated in place, and the attached file is the offline copy. I checked the file writers against your bantha in Node, but I haven't run the export buttons in a browser or opened an exported file in 3D software. Save and load Save project bundles the model files, all the textures you loaded, your per-part texture replacements, part visibility and the Flip V setting into one file. To reopen it, drop it on the page or use the file picker. Load folder… picks a whole folder and loads the model, textures and .txi files inside it. A plain .zip containing a model and textures also works. Export Export OBJ produces a zip with .obj, .mtl and a textures/ folder of PNGs. The "OBJ up" setting chooses Y-up (what most tools expect) or the game's Z-up. Export FBX writes a binary FBX with the textures embedded in the file. Only the parts currently visible are exported. Your texture replacements are included. KotOR's .tga, .tpc and .png textures are converted to PNG. If you had "Flip V" on to make textures look right, the export uses the same setting. File names differ between the two copies: Published page: the platform only allows certain file types to be saved, so everything arrives as a zip, such as c_bantha_fbx.zip and c_bantha_project.zip, and you unzip it. Offline copy: it saves .fbx and .kmv files directly. Limits: Checks so far: the OBJ face and vertex counts, the zip files and the FBX file structure all check out on your model. FBX untested: I couldn't try it in Blender, Maya or a game engine, so the model might import facing the wrong way or at the wrong scale. If it does, the OBJ export is the safer choice. Transparency: exported textures are fully opaque, so transparency information in the source textures is dropped. Not exported: the model's bone and animation data isn't included, and neither are the normal maps. -------- 1.2 First-person movement is now in the viewer. The published link is updated in place, and the attached file is the offline copy. I tested the movement math in Node, but I haven't tried the controls in a browser. Tick First-person walk (arrow keys) in the side panel to switch. You start exactly where the orbit camera was, and untick it to go back to the orbit view as you left it. Controls in first-person mode: ↑ / ↓ (or W / S): walk forward and back along the ground. ← / →: turn left and right. A / 😧 strafe sideways. R / F (or Page Up / Page Down): move up and down. Shift: move three times faster. Mouse drag: look around. Mouse wheel: step forward and back. Clicking a part to select it still works from first-person view. "Reset view" puts the first-person camera back at the default starting view. Some things to know: Movement speed scales with the size of the model, so it feels the same on a small prop and on a large creature. No collision: you can walk through the model, because there's no collision. Arrow keys and sliders: if a slider in the panel still has focus, the arrow keys adjust that slider instead. Click the 3D view once and they'll control the camera. Floor: the reflective floor disappears if you move below it. -------- 1.3 The viewer now has HDR environment maps, adjustable light rigs and real-time shadows. This time I opened it in headless Chromium and checked each feature there. What's new HDR environments: drop a Radiance .hdr file on the page, or use "Load HDR…". It lights the model and shows in the reflections. You can turn it on as the background, and there are intensity and rotation sliders. "Studio env" restores the built-in environment. Light rigs: Classic (the old headlight), 3-point, Directional (sun) and Point lights. Sliders set intensity, rig rotation and light height. Real-time shadows: the main light casts soft shadows onto the model and the floor. Shadow softness and strength are adjustable, and there's an on/off checkbox. Bugs found while testing Floating parts (fixed): the horns, head crest and hair floated above the bantha because body meshes weren't getting their node position applied. They now sit on the head and the model reads as a bantha. Export failure (fixed): OBJ and FBX export crashed on any model you hadn't beveled. Exports now work and the zip files check out. I also lowered the default light levels, since the directional rig was washing the model out to white. What I tested: all the shaders compile, and loading, selection, bevel, first-person movement, texture replacement, OBJ/FBX/project export and reloading a saved project all ran with no console errors. Limits: The HDR test used a file I generated, not a photographed one. The .hdr reader handles both the plain and compressed Radiance formats, but I haven't tried it on a real-world HDRI. Shadows come from the single main light, so fill and rim lights in the 3-point rig don't cast their own. ------- 1.4 The viewer now supports a PS4 controller, and I've updated the published page and the offline file. I tested it only with a simulated DualShock 4, not real hardware. The simulation covered every control below, the settings, and connect/disconnect. Controls Right stick: orbit the model, or look around in walk mode. Left stick: pan the view, or walk and strafe in walk mode. R2 / L2: zoom in and out, or fly up and down in walk mode. L1 / R1: select the previous or next part. ✕: select the part under the centre reticle. ○: clear the selection. □: toggle wireframe. △: toggle walk mode. D-pad ◀ ▶: switch lighting rig. D-pad ▲ ▼: raise or lower the light. Share: fit the model to the view. Options: go to the next tab. L3: toggle reflections. R3: toggle shadows. Gamepad tab: it has a connection status, an on/off switch, invert look, vibration, look speed, move speed and stick dead zone. Your settings are remembered. The button list lights up as you press buttons. A small controller indicator and a centre reticle appear in the viewport while a pad is connected. I also tightened the tab bar so all five tabs fit on a phone-width screen. Caveats Hosted page: it may block controller input. If your controller isn't detected there, use the offline file. Chrome and Edge: the browser only reveals a controller after you press a button once. Firefox: the viewer also handles Firefox's raw DualShock layout. I checked that with a mock reading only. Keyboard and mouse: they work as before. Edited 31 minutes ago by Etherael Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.