Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyman192 committed Feb 5, 2025
1 parent 618b0d4 commit f72af04
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 28 deletions.
61 changes: 34 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,57 +8,64 @@ For full documentation such as installation instructions, API details and detail

### Installing NMSDK

#### Install as zip add-on

Installing NMSDK is very easy. Head to the [NMSDK Release page](https://github.com/monkeyman192/NMSDK/releases) on GitHub and download the most recently released version.

Open Blender and open the user settings (Ctrl + Alt + U) (or `File` > `User Preferences...`), and select `Install Add-on from File...` (it is at the bottom left of the window).
Open Blender and open the preferences popup (`Ctrl` + `,`) (or `Edit` > `User Preferences...`), and select `Add-ons` (on the left hand side).
At the top right corder of this window is a `` symbol next to the tag icon. Click this then click the option to "Install from disk...".
Select the `.zip` file you just downloaded and blender should install it without any errors.

To make exporting easier, NMSDK will automatically convert all produced `.mxml` files to `.mbin` files. For this to work, [MBINCompiler](https://github.com/monkeyman192/MBINCompiler) is required. See below for instructions on downloading and installing the latest version.

#### Install as a Script directory

This method is useful if you are comfortable with git. It has the added benefit that if you update blender you do not need to re-add the plugin.

First, create a directory somewhere (such as your documents folder) and call it "Blender Addons". Inside this directory create another folder called "addons".
Inside this directory clone the NSMDK github repo. This can be done directly via the command line (`git clone https://github.com/monkeyman192/NMSDK.git`), or by unpacking the contents of the release zip into this `addons` folder.

The final folder structure should look something like:
`(documents folder) > Blender Addons > addons > nmsdk > (multiple sub-directories and files)`

Once this is done, open blender and open the preferences popup (`ctrl` + `,`) (or `Edit` > `User Preferences...`).
One the left-hand side, select the "File Paths" option, and near the bottom is the "Script Directories" section.
Select and add the "Blender Addons" directory (not one of the child directories). When you select the folder it will open it, but DO NOT select the "addons" directory inside it. It must be this parent directory.

Once this is done you should see the NMSDK plugin having been added to blender (can confirm by looking under the "Add-ons" section).

---

### Prerequisites

#### Blender

NMSDK requires a version of Blender greater than or equal to 3.2
NMSDK requires a version of Blender greater than or equal to 4.2

#### MBINCompiler

For NMSDK to work, it requires [MBINCompiler](https://github.com/monkeyman192/MBINCompiler)
to generate the *.mbin* files that are read by the game.
The easiest way to have *MBINCompiler* set up is to download the most recent
release and register *MBINCompiler* to the path so that it can be picked up
anywhere by Blender.
For NMSDK to work, it requires [MBINCompiler](https://github.com/monkeyman192/MBINCompiler) to generate the *.mbin* files that are read by the game.
If you already have a version of *MBINCompiler* on your computer, ensure it is the latest version. This can be found on the [MBINCompiler releases](https://github.com/monkeyman192/MBINCompiler/releases) page.

For NMSDK to be able to use *MBINCompiler*, the program needs to be registered to the path so that it can be called from anywhere on your computer.
Open the folder containing the `MBINCompiler.exe` you just downloaded, open this folder as admin in command line, then enter `MBINCompiler.exe register`.
This will add the folder the `.exe` is in to the system path, allowing NMSDK to be able to access the program from anywhere.
To configure NSMDK to use the correct *MBINCompiler* version, open the Blender and then open the settings toolbox by clicking the small `<` in the main window as shown in the image below:

---
![settings](docs/images/open_settings.png)

### Usage
Select the `NMSDK` option on the right side of the panel that pops out and you should see something like this:

For a comprehensive guide on using NMSDK, please visit the [documentation](https://monkeyman192.github.io/NMSDK/) for more details.
![NMSDK_settings](docs/images/NMSDK_settings.png)

### Running Tests
To have the best experience, it's recommended that you specify the `PCBANKS location` as well as the `MBINCompiler location`.

If you are looking to develop NMSDK, there are a number of tests that can be run so ensure the added functionality doesn't cause any regressions.
If new features are added, it is highly encouraged that new tests are written to ensure good code coverage (not currently tracked, and not even sure if it is possible to...)
The `PCBANKS location` is the folder which contains the unpacked files for the game. This is used as a fallback so that NMSDK knows where to search for any files it can't find in a local directory if importing in this way.

To run the tests, you must have NMSDK cloned from git, and not simply installed. If you're using Github Desktop, you will also need Git for Windows installed to have Git Bash available. In a console, then run
```
./run_tests.sh`.
```
This will run all the tests.
The `MBINCompiler location` is the path to the *MBINCompiler* binary that was downloaded from github to match the version of the game you are importing/exporting models for.

This script can have specific test files passed to it as an argument, and these are passed to pytest, which is the underlying test runner.
---

For example, to run a single individual test you could enter
```
./run_tests.sh tests/import_tests/import_test.py::test_import_crystal
```
### Usage

This script uses the Blender that is assigned to open .blend files - do Blender.exe -R to associate Blender with .blend files. To learn how to specify an alternative Blender executable or for more info, use `./run_tests.sh -h` to see the help and options.
For a comprehensive guide on using NMSDK, please visit the [documentation](https://monkeyman192.github.io/NMSDK/) for more details.

### Credits

Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "No Man's Sky Development Kit",
"author": "gregkwaste, monkeyman192",
"version": (0, 9, 27),
"blender": (4, 0, 0),
"blender": (4, 2, 0),
"location": "File > Export/Import",
"description": "Create NMS scene structures and export to NMS File format",
"warning": "",
Expand Down
Binary file added docs/images/NMSDK_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/open_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f72af04

Please sign in to comment.