Class for loading OBJ files into Unity scene at run-time and in editor mode.
More...
|
| override string[] | ParseTexturePaths (string absolutePath) |
| | Parse dependencies of the given OBJ file. More...
|
| |
| IEnumerator | Load (string objName, string absolutePath, Transform parentObj) |
| | Load a model. More...
|
| |
|
| override IEnumerator | LoadModelFile (string absolutePath) |
| | Load the main model file More...
|
| |
| override IEnumerator | LoadMaterialLibrary (string absolutePath) |
| | Load the material library from the given path. More...
|
| |
| IEnumerator | ParseGeometryData (string objDataText) |
| | Parse the OBJ file to extract geometry data. More...
|
| |
| IEnumerator | Build (string absolutePath, string objName, Transform parentTransform) |
| | Build the game objects from data set, materials and textures. More...
|
| |
| string | GetDirName (string absolutePath) |
| | Get the directory name of the given path, appending the final slash if eeded. More...
|
| |
| virtual void | OnLoaded (GameObject obj, string absolutePath) |
| |
| virtual void | OnCreated (GameObject obj, string absolutePath) |
| |
| virtual void | OnLoadFailed (string absolutePath) |
| |
Class for loading OBJ files into Unity scene at run-time and in editor mode.
Partially derived from "Runtime OBJ Loader" (http://forum.unity3d.com/threads/free-runtime-obj-loader.365884/) and from "runtime .OBJ file loader for Unity3D" (https://github.com/hammmm/unity-obj-loader) and (https://github.com/cmdr2/unity-remote-obj-loader)
New features:
-
meshes with more than 65K vertices/indices are splitted and loaded
-
groups are loaded into game (sub) objects
-
extended material support
-
computation of normal maps and tangents
-
computation of albedo texture from diffuse and opacity textures
-
progressive loading
-
reusing data for multiple objects
-
create a loader for each model for parallel loading
-
support for asset import
- See also
- DataSet, MaterialData, ObjectBuilder
◆ LoadMaterialLibrary()
| override IEnumerator AsImpL.LoaderObj.LoadMaterialLibrary |
( |
string |
absolutePath | ) |
|
|
protectedvirtual |
Load the material library from the given path.
- Parameters
-
| absolutePath | absolute file path |
This is called by Load() method
Implements AsImpL.Loader.
◆ LoadModelFile()
| override IEnumerator AsImpL.LoaderObj.LoadModelFile |
( |
string |
absolutePath | ) |
|
|
protectedvirtual |
Load the main model file
- Parameters
-
| absolutePath | absolute file path |
This is called by Load() method
Implements AsImpL.Loader.
◆ ParseGeometryData()
| IEnumerator AsImpL.LoaderObj.ParseGeometryData |
( |
string |
objDataText | ) |
|
|
protected |
Parse the OBJ file to extract geometry data.
- Parameters
-
- Returns
- Execution is splitted into steps to not freeze the caller method.
◆ ParseTexturePaths()
| override string[] AsImpL.LoaderObj.ParseTexturePaths |
( |
string |
absolutePath | ) |
|
|
virtual |
Parse dependencies of the given OBJ file.
- Parameters
-
| absolutePath | absolute file path |
- Returns
- The list of dependencies (textures files, if any).
Implements AsImpL.Loader.
◆ HasMaterialLibrary
| override bool AsImpL.LoaderObj.HasMaterialLibrary |
|
getprotected |
Check if a material library file is defined.
The documentation for this class was generated from the following file:
- F:/Unity3D/Projects/DATASET/AsImpL/Assets/AsImpL/Scripts/Loaders/LoaderObj.cs