3D Model Import: Difference between revisions

From Resonite Wiki
m List IQM as valid import format
Added links.
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<!--T:1-->
<!--T:1-->
Importing 3D models is a great way to get existing content into Resonite, whether it's for building environments, objects, avatars or simply for visualizing them. The provided importer is based on the opensource [http://assimp.org/ Assimp] library and supports wide variety of 3D formats. Extra formats can be supported by installing 3rd party software on your computer.
Importing 3D models is a great way to get existing content into [[Resonite]], whether it's for building environments, objects, avatars or simply for visualizing them. If the file type is [[Supported Formats|supported]], you can [[Importing Assets|import]] it in easily. The provided importer is based on the opensource [http://assimp.org/ Assimp] library and supports wide variety of 3D formats. Extra formats can be supported by installing 3rd party software on your computer.


<!--T:2-->
<!--T:2-->
Line 9: Line 9:


<!--T:4-->
<!--T:4-->
Supported file formats for 3D model import will show up in the file browser as light yellow.
Supported file formats for 3D model import will show up in the [[File Browser|file browser]] as light yellow.


== Import Wizard == <!--T:5-->
== Import Wizard == <!--T:5-->
Line 142: Line 142:
<!--T:30-->
<!--T:30-->
If that doesn't work you can also install Blender to the Tools folder of your Resonite Installation. E.g. <code>C:\Program Files (x86)\Steam\steamapps\common\Resonite\Tools\Blender</code>.
If that doesn't work you can also install Blender to the Tools folder of your Resonite Installation. E.g. <code>C:\Program Files (x86)\Steam\steamapps\common\Resonite\Tools\Blender</code>.
If you have an existing blender install that you would like to use from another location, you can create a symbolic link to Blender in the Tools folder. The folder you link to should directly contain `blender.exe` and you will need to restart the game for blender to be discovered in this new location.
An example command to create a symbolic link provided below, you will need to change the paths to where you have the game and blender installed.
<code>mklink /d "C:\Program Files (x86)\Steam\steamapps\common\Resonite\Tools\Blender" "D:\CustomPathToBlender"</code>


<!--T:31-->
<!--T:31-->

Latest revision as of 03:00, 30 May 2024

Importing 3D models is a great way to get existing content into Resonite, whether it's for building environments, objects, avatars or simply for visualizing them. If the file type is supported, you can import it in easily. The provided importer is based on the opensource Assimp library and supports wide variety of 3D formats. Extra formats can be supported by installing 3rd party software on your computer.

It is also possible to write your own importer or extend the one provided with Resonite using scripting and external programs using Resonite's libraries. The job of the importer is to read the input format and translate it into Resonite's native MeshX format for representing mesh data, extract any textures, create and setup appropriate materials, setup the object hierarchy and any other components needed to represent the data from the format.

Once the import is complete, the imported object isn't dependent on the source file anymore and exists as any other Resonite object.

Supported file formats for 3D model import will show up in the file browser as light yellow.

Import Wizard

While importing 3D models, a wizard dialog will ask a few details about the model, which will help it determine the best settings for setting up the imported mesh, texture and material data. For example 3D scans usually look better with Unlit/PBR Emissive material, otherwise the lighting is applied "twice", leading to a very muddy look.

External Texture Convention for PBR

Because there's no well supported standard for PBR materials in model files, Resonite's model importer allows using a naming convention to automatically map texture files to the material based on the file naming.

To enable this option, go to the Advanced Settings in the import wizard and check the Import External Textures option.

This has currently following limitations:

  • Works only with single-material models for now
  • Each model must be in its own subfolder for now, there can't be multiple models with multiple albedo textures
  • Files have to be named in style <myfilename>_<textype>.ext, case is irrelevant
  • Valid Examples, all map to albedo:
   Potato_albedo.png
   Potato_Albedo.png
   Potato_ALBEDO.png
   Alien Spaceship_albedo.tga
   _albedo.jpg
   albedo.jpg

PBS MAPPING TABLE <textype>:

Each property has multiple <textype> strings, only one should be used (preferably the first)

  • Albedo: albedo, diffuse
  • Normal: normal, bump
  • Specular map: specular
  • Metallic map: metallic, metalness
  • Emission map: emission, emissive
  • Ambient Occlusion: ao, occlusion, ambientocclusion
  • Heightmap/displacement: height, heightmap, disp, displacement

Specular/Metallic map's alpha channel maps to smoothness (inverse roughness)

Currently Supported 3D formats

These are the 3D formats supported by the Assimp library. Level of support for individual formats might vary.

Common Interchange Formats

  • Autodesk ( .fbx ) - Must be FBX 2011, 2012 or 2013, newer ones won't work
  • Collada ( .dae )
  • glTF ( .gltf, .glb )
  • Blender 3D ( .blend )
  • 3ds Max 3DS ( .3ds )
  • 3ds Max ASE ( .ase )
  • Wavefront Object ( .obj )
  • Industry Foundation Classes (IFC/Step) ( .ifc )
  • XGL ( .xgl,.zgl )
  • Stanford Polygon Library ( .ply )
  • AutoCAD DXF ( .dxf )
  • LightWave ( .lwo )
  • LightWave Scene ( .lws )
  • Modo ( .lxo )
  • Stereolithography ( .stl )
  • DirectX X ( .x )
  • AC3D ( .ac )
  • Milkshape 3D ( .ms3d )
  • TrueSpace ( .cob,.scn )

Motion Capture Formats

  • Biovision BVH ( .bvh )
  • CharacterStudio Motion ( .csm )

Graphics Engine Formats

  • Ogre XML ( .xml )
  • Irrlicht Mesh ( .irrmesh )
  • Irrlicht Scene ( .irr )

Game File Formats

  • Quake I ( .mdl )
  • Quake II ( .md2 )
  • Quake III Mesh ( .md3 )
  • Quake III Map/BSP ( .pk3 )
  • Inter-Quake Model ( .iqm )
  • Return to Castle Wolfenstein ( .mdc )
  • Doom 3 ( .md5* )
  • Valve Model ( .smd,.vta )
  • Open Game Engine Exchange ( .ogex )
  • Unreal ( .3d )

Other File Formats

  • BlitzBasic 3D ( .b3d )
  • Quick3D ( .q3d,.q3s )
  • Neutral File Format ( .nff )
  • Sense8 WorldToolKit ( .nff )
  • Object File Format ( .off )
  • PovRAY Raw ( .raw )
  • Terragen Terrain ( .ter )
  • 3D GameStudio (3DGS) ( .mdl )
  • 3D GameStudio (3DGS) Terrain ( .hmp )
  • Izware Nendo ( .ndo )

Blender

Installing Blender will improve the support for importing .blend files, as Resonite will use Blender to export the file into GLB in the background, rather than use Assimp's limited support for the file format. For this to work Resonite needs to be able to find the Blender installation you are using.

By default Resonite will search the following directories to try and find a Blender installation:

  • C:\Program Files
  • C:\Program Files (x86)
  • C:\Program Files (x86)\Steam\steamapps\common\Blender

If that doesn't work you can also install Blender to the Tools folder of your Resonite Installation. E.g. C:\Program Files (x86)\Steam\steamapps\common\Resonite\Tools\Blender.

If you have an existing blender install that you would like to use from another location, you can create a symbolic link to Blender in the Tools folder. The folder you link to should directly contain `blender.exe` and you will need to restart the game for blender to be discovered in this new location.

An example command to create a symbolic link provided below, you will need to change the paths to where you have the game and blender installed.

mklink /d "C:\Program Files (x86)\Steam\steamapps\common\Resonite\Tools\Blender" "D:\CustomPathToBlender"

If you have another common location that you know Blender installs to please open a GitHub Issue to suggest its addition.

3rd Party Software

FreeCAD Installing the FreeCAD software on your computer into the default directory will enable support for additional formats, particularly various CAD Files.

  • STEP Files (ISO 10303-21) ( .stp, .step )
  • Open CAD format ( .oca, .gcad )
  • Abaqus (.inp )
  • CAD data NBSIR 80-1978 ( .iges, .igs )
  • BREP Files ( .brep, .brp )
  • Inventor ( .iv )