Tutorial: Import an Environment into MemoryX

Importing a WRL Scene into MemoryX

Note
This tutorial requires a very recent version of blender (please download a fresh copy from blender.org).

Create new Blender File

Single WRL file

  • Create/open new blend file
  • File->Import->X3D extensible (wrl)
  • Select *.wrl file and click Import X3d/VRML2
  • Save as Environment.blend

Cut Scene into Convex Objects

  • Select the complete Mesh (you will only be able to edit the currently active object)
  • Switch to Edit Mode by pressing tab
  • Use Face Select Mode
  • Use c to mark faces by selecting the middle points of them (3 selection modes a b c; use last one) (right click to switch out of mode) (maybe set clipping to limit_selection_to_visible)
  • Mark groundfloor and press x to delete all vertices
  • Mark all faces of one object
  • Check if everything is selected by pressing g and trying to move the object (you will see it if there is some selection missing, or not all faces and their centers are marked orange)
  • Press p -> Selection which cuts the marked subset from the initial shape and creates a new ShapeIndexedFaceSet
  • Repeat until all objects are separate FaceSets

Multiple WRL files

  • move files to import into a directory named Split
  • copy the file MemoryX/data/MemoryX/SceneImportExport-Template.blend as Environment.blend next to the Split directory
  • remove all objects from the scene (select all -> remove)
  • select python script in text area and run it (alt+p or ‘right_click+'run script’) \li selectimportas action \li change theEnvironment name \li clickOK`

This will export all objects into separate WRL files and create a matching Environment.simox.xml file which can afterwards be used to import the scene into MemoryX.

Export WRL Files

  • Enable VRML2 Export plugin in Blender
  • Open Environment.blend file
  • Unselect all objects (press a one or two times until nothing is highlighted in orange anymore)
  • Switch editor to Object Mode
  • Right click on one object in the scene
  • Run the script (alt+p or ‘right_click+'run script’) \li selectexportas action \li check theEnvironment name \li clickOK \li All objects in the scene are exported into theSplit_WRL` subdirectory containing the blender file

Import Simox Scene Description

Use the SimoxSceneImporter scenario for importing scenes. It contains a correctly parameterized MemoryX setup.

Prior to executing the scenario make sure that no other MemoryX instance is running and that the following parameters are correctly set in config/SimoxSceneImporter.cfg:

  • MemoryX.SimoxSceneImporter.SnapshotName=Environment
  • MemoryX.SimoxSceneImporter.SceneFile=.../Split_WRL/Environment.simox.xml

The SimoxSceneImporter will import all models from the Split_WRL directory into PriorKnowledge and create a Snapshot containing all of the imported objects.