From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

Assimp Integration

Current TODO for assimp integration

Current TESTING status

Intro

Integrating assimp into Blender is is a prerequisite for getting FBX import into Blender via assimp.

This document contains the plan how assimp can be integrated, which changes this will need etc.

FBX branch

My assimp branch which I will be using this summer (https://github.com/acgessler/assimp-gsoc2012-fbx) is a fork from trunk r1250, but I expect to pull from trunk relatively often.

Integration

Unfortunately, since I need to work on assimp to implement FBX support, no release version can be used and Blender thus needs to go with the Assimp source.

However, since my FBX branch will likely be merged with assimp's trunk and released some day, Blender could switch to an official assimp release later on.

For this reason I want to split assimp into two sub-projects within the Blender codebase:

  • bf_assimp in /source/blender/assimp with a interface similar to bf_collada, providing the assimp -> blender import route.
  • ext_assimp in /extern/assimp, which holds the relevant parts of the assimp source code taken from my FBX branch.


bf_assimp details

bf-assimp is the Assimp-to-Blender conversion module. It basically imports 3d files using assimp and converts from Assimp's output data structure (aiScene) to Blender Scenes.

Public interface:

  import_bassimp(char*, Context)
  void bassimp_query_import_file_extensions(const char* out[], int dim)
  [ export_bassimp(char*, Context, selection) ]
   

(where export_bassimp is not part of my project but .. but listed here for symmetry :-) )

'bassimp' as naming prefix / namespace for the assimp->blender code to avoid confusion with the original assimp code. The implementation follows bf_collada, except that the amount of code will be much smaller since assimp's data structure simply is not as complex as OpenCollada.

'bassimp_query_import_file_extensions' is used to deliver an array of static file extensions to blender's file selector.

ext_assimp details

ext_assimp is just the assimp source code with a minimal CMakefile/SCons build environment (similar to the other /extern/* projects).

I'll update this as frequently as I need to (i.e. every time I need to test everything with Blender). The following components are removed from assimp:

     blend (obviously)
     collada 
     ?? maybe some rarely used importers should be dropped as well
     ?? much of assimp's postprocessing is not needed by Blender (because it does it on its own,
        and much better). Could drop a lot of geometry processing code as well.

ext_assimp could thus some day be replaced by distro packages (such as opencollada does).

Other changes

  • Add an "Import -> Open Asset Import Library (multiple)" menu item below the Collada import (we'll see how it will later be named, but for now it would be wrong to limit the import to FBX since assimp integration itself is totally fbx agnostic).
  • Add ASSIMPFILE file filter (parallel to COLLADAFILE) and update all relevant functions.