GithubHelp home page GithubHelp logo

cadehaley / blenderhpl3export Goto Github PK

View Code? Open in Web Editor NEW
8.0 6.0 2.0 6.42 MB

Blender add-on for exporting objects directly to the HPL3 engine (SOMA and Amnesia Rebirth)

Python 100.00%
blender amnesia-game soma game-development

blenderhpl3export's Introduction

HPL3 Exporter Version 3.16

This addon allows you to model anything from single assets to entire maps within Blender, and synchronize them to an HPL3 engine map, automatically creating and configuring textures, material, and entity files for a fast iteration process. The script is also capable of removing objects from the HPL3 map which have been removed in the Blender scene, exporting rigged and animated objects, and baking lighting onto scene objects.

Installation (Requires Windows and Blender 2.80 or later. Tested with 4.0)

  • Copy "io_export_hpl3.py" and the "nvidia" folder to Blender's addons directory (".../Blender/2.80/scripts/addons")

  • Open Blender, go to Edit > Preferences > Add-ons > Search "hpl3"

  • Check box next to "Import-Export: HPL3 Export" and press "Save Preferences"

  • Exit window and go to the Tools bar in the left side of the 3D View. Drag the width of the Tools bar out to set fields, and press T to hide the tools bar at any time. Have fun!

Important Usage Notes

  • Give each Mesh data-block a unique name in the asset's "Object Data Properties" panel (under the poly triangle icon, not to be confused with the "Object Data" panel under the cube icon). Example:
     Object name = "evil_suzanne_by_doorway.005"
     Mesh data-block name = "Suzanne"
    

On export, the subdirectory and mesh file will take this name ("Suzanne.dae"), and having name conflicts in HPL3 (i.e. having two .dae files of the same name, but in separate directories) can cause the wrong textures to load. The "Object Name" does not matter as much, and will be used to name that instance of the asset when placed in the map.

  • If texture is black or has black parts, make sure UV faces are within the square UV boundary. Texture baking requires that each material use a single Principled BSDF node and that all UV faces lie within UV coordinate bounds

  • Rigged Meshes: Use "Single Export" when you have an animated mesh broken into separate objects (e.g. shirt, head, hair) that are deformed by the same armature (skeleton). Exporting meshes that are deformed by different armatures to one file/entity is not supported by HPL3 and will produce unexpected results.

  • Baking Modes: Textures Per Material: Think of each material as having its own UV set. Faces assigned to Material A usually should not overlap in the UV editor with other Material A faces, though it is ok (even recommended) for faces assigned to Material B to use up the full UV space, since it won't matter if a face from Material A overlaps with a face from Material B.

  • Instancing: Use Alt+D to create copies of an object in Blender to place around a map, since they will point to the same 'Mesh' data-block. Using Copy/Paste or Shift+D creates a new Mesh data-block every time, and therefore new .dae and .dds files on export, leaving you with multiple repeat numbered .dae and/or .dds files taking unnecessary space on export.

Troubleshooting

  • Hover your pointer over options for more in-depth info on how to use them
  • When using "Textures Per Material", if texture is black or has black parts, make sure faces are UV unwrapped to lie within the UV image boundaries. The plugin uses texture baking, which will only bake parts of faces within this boundary. Another workaround is to set a face to cover the whole boundary.
  • If materials are failing to export properly, try switching between "Textures Per Material" and "Textures Per Object", as one mode may work better with your material setup than the other. Also, keep in mind that texture baking requires that each material use a single Principled BSDF node
  • In the Level Editor, if objects fail to appear after pressing the button to reload static object or entity changes, try exiting out of the editor and reloading your map to make objects appear properly again.

Bugs

For any questions or to report any bugs, message me @cadely on the Frictional Games Discord

Development

If you are interested in developing this addon or forking this project, clone the "develop" branch. There you will find integration and regression tests which can be extremely helpful when modifying the code

blenderhpl3export's People

Contributors

cadehaley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.