Skip to content

Commit

Permalink
Update developer.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
kimkulling committed Apr 7, 2021
1 parent 19e4cf3 commit 7f6fbde
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions source/developer/developer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ General
In this chapter you will learn how to write your own importers. You just need to implement the #Assimp::BaseImporter class,
which defines a few abstract methods, register your loader, test it carefully and provide test models for it.

* Create a header (*FormatNameImporter.h*) and a unit (*FormatNameImporter.cpp*) in the *<root>/code/AssetLib/* directory
* Create a header (*FormatNameImporter.h*) and a unit ( **FormatNameImporter.cpp** ) in the **<root>/code/AssetLib/** directory
* Add them to the following workspaces: vc8 and vc9 (the files are in the workspaces directory), CMAKE (code/CMakeLists.txt, create a new source group for your importer and put them also to ADD_LIBRARY( assimp SHARED))
* Include *AssimpPCH.h* - this is the PCH file, and it includes already most Assimp-internal stuff.
* Open ImporterRegistry.cpp.cpp and include your header just below the *(include_new_importers_here)* line, guarded by a #define
Expand All @@ -31,19 +31,19 @@ which defines a few abstract methods, register your loader, test it carefully an

Wrap the same guard around your .cpp!

* Now advance to the *(register_new_importers_here)* line in the ImporterRegistry.cpp and register your importer there - just like all the others do.
* Now advance to the **(register_new_importers_here)** line in the **ImporterRegistry.cpp** and register your importer there - just like all the others do.
* Setup a suitable test environment (i.e. use AssimpView or your own application), make sure to enable
the #aiProcess_ValidateDataStructure flag and enable verbose logging. That is, simply call before you import anything:

::

DefaultLogger::create("AssimpLog.txt",Logger::VERBOSE)

* Implement the *Assimp::BaseImporter::CanRead()* : here the format detection will be perfoormed. You can detect the format by its extension or by parsing some token of the file content
* Implement Assimp::BaseImporter::InternReadFile()* :
* Implement *Assimp::BaseImporter::GetExtensionList()* : here you have to add the provided extensions (for the Wavefront-Files add .obj for instance).
* For error handling, throw a dynamic allocated ImportErrorException (see Appendix A) for critical errors, and log errors, warnings, infos and debuginfos
with DefaultLogger::get()->[error, warn, debug, info].
* Implement the **Assimp::BaseImporter::CanRead()** : here the format detection will be perfoormed. You can detect the format by its extension or by parsing some token of the file content
* Implement **Assimp::BaseImporter::InternReadFile()** : Here you have to parse the file fomat and convert it into a aiScene-Instance.
* Implement **Assimp::BaseImporter::GetExtensionList()** : here you have to add the provided extensions (for the Wavefront-Files add .obj for instance).
* For error handling, throw a dynamic allocated **ImportErrorException** (see Appendix A) for critical errors, and log errors, warnings, infos and debuginfos
with **DefaultLogger::get()->[error, warn, debug, info]**.
* Make sure that your loader compiles against all build configurations on all supported platforms. You can use our CI-build to check several platforms
like Windows and Linux ( 32 bit and 64 bit ).
* Provide some _free_ test models in <root>/test/models/<FormatName> and credit their authors.
Expand Down

0 comments on commit 7f6fbde

Please sign in to comment.