How to Create Modules from Snapshots in Open Wonderland#

Open Wonderland 0.5#

Prerequisites:#

  1. A recent version of Netbeans (or other editor of your choice)
  2. Source versions of wonderland and wonderland-modules
    1. Information to download and build trunk source is located here: http://wiki.openwonderland.org/Wiki.jsp?page=DownloadBuildSource05
    2. Information to download modules is located here: http://wiki.openwonderland.org/Wiki.jsp?page=DownloadBuildModules05

Why use a module instead of a snapshot?#

Portability and reducing the probability of accidentally deleting a world are reasons you might want to use a module instead of a snapshot. In terms of portability, it is much easier to share a module with others than a snapshot because a module essentially acts as a container to hold all associated assets. A snapshot does not; instead, it is a series of xml files that links to content stored on your Open Wonderland server.

Another reason to use modules over snapshots might be because you want fewer options on your "Manage Worlds" page on your Open Wonderland server. By creating modules in the way outlined below, these modules show up at the top of the Manage Worlds page in the "Initial Worlds" section. These worlds cannot be removed or edited (which snapshots can), so you don't have to worry about your worlds accidentally getting deleted.

Steps to make module:#

  1. Package world using the save_region.sh script located here: https://sites.google.com/site/openwonderland/source/save_region.sh?attredirects=0&d=1
    1. Identify the directory of the snapshot you would like to save, which will be in ~/.wonderland-server/0.5-dev/wfs/snapshots/<name>, where <name> is the name as it appears in the “manage worlds” screen of Wonderland.
    2. Run save_region.sh with the full path to the snapshot directory. For example: # save_region.sh /Users/jkaplan/.wonderland-server/0.5-dev/wfs/snapshots/2011-01-02-auditorium
    3. This will create a .tgz file in the current directory, for example “2011-01-02-auditorium.tgz”.
      • NOTE: Something to be aware of, while this document states the script will generate a .tgz file with the same name as the snapshot, the file seems to be generated with the current date as the name.
    4. To capture a subset of the entire world, open the script in a text editor and follow the directions to set the XCENTER, XRADIUS, ZCENTER, ZRADIUS and DESC variables before performing step 1.2 above.
  2. In a file manager, unpack the worlds made in step 1
  3. In NetBeans, open the garden-arches-world NetBeans project
    • yourOpenWonderlandDirectory/wonderland/modules/world/garden-arches-world
  4. Copy garden-arches-world NetBeans project (right click-->copy)
  5. Provide a name for the copied module and change the path to something memorable
    • e.g., wonderland-myFirstWorld-world
  6. Remove the art directory
    1. Click on the Files tab in NetBeans
    2. Click on the arrow to the right of your module (e.g., wonderland-myFirstWorld-world)
    3. Right click on the art directory
    4. Select delete
  7. Remove the contents of the wfs directory
    1. Click on the Files tab in NetBeans
    2. Click on the arrow to the right of your module (e.g., wonderland-myFirstWorld-world)
    3. Click on the arrow next to the wfs directory
    4. Select everything in the wfs directory
    5. Right click on the selected items
    6. Select delete
  8. Open the directory where you unpacked worlds from step 2 in your file manager and find the art directory
    • e.g., <unpackDirectory>/run/content/users/<my_user_name>/art
  9. Open your module’s directory in another window in your file manager and find the art directory
    • e.g., <path to where you stored your module>/wonderland-myFirstWorld-world/art
  10. Copy the art directory from the directory in step 8 to the directory in step 9
  11. Open the directory where you unpacked worlds from step 2 in your file manager and find the world-wfs directory
    • e.g., <unpackDirectory>/wfs/snapshots/2010-12-08-myWorld/world-wfs/
  12. Open your module’s directory in another window in your file manager and find the wfs directory
    • e.g., yourOpenWonderlandDirectory/wonderland/modules/world/wonderland-myFirstWorld-world/wfs/my-first-world-wfs
  13. Copy the world-wfs directory from step 11 to the wfs directory in step 12.
  14. Return to Netbeans and open the Files tab
  15. In the art directory, change the URIs in all files ending with .kmz.dep. Under the art directory, you should see directories that correspond with the names of the art present in your snapshot. Inside each of these directories is a file that ends with .kmz.dep.
    1. Inside each file ending with .kmz.dep, change the URIs contained in the <modelURL> and <loaderDataURL> tags.
      1. Remove all references to “wlcontent://” and replace with “wla://”
      2. Remove old path information and replace with module name
      3. Example:
        • Before changing:
          <modelURL>wlcontent://users/Joe/art/myModel.kmz/models/myModel.dae.gz</modelURL>
          <loaderDataURL>wlcontent://users/Joe/art/myModel.kmz/myModel.kmz.ldr</loaderDataURL>
        • After changing:
          <modelURL>wla://wonderland-myFirstWorld-world/myModel.kmz/models/myModel.dae.gz</modelURL>
          <loaderDataURL>wla://wonderland-myFirstWorld-world/myModel.kmz/myModel.kmz.ldr</loaderDataURL>
  16. In the wfs directory, change the URIs in all files ending in -wlc.xml. There will be one or more sub-directories in the wfs directory. Inside each of these sub-directories is a file that ends with -wlc.xml.
    1. Inside each file ending with -wlc.xml, change the URIs contained in the <deployedModelURL> tag.
      1. Remove all references to “wlcontent://” and replace with “wla://”
      2. Remove old path information and replace with module name
      3. Example:
        • Before changing:
          <deployedModelURL>wlcontent://users@my_wonderland.server.org:8080/Joe/art/myModel.kmz/myModel.kmz.dep</deployedModelURL>
        • After changing:
          <deployedModelURL>wla://wonderland-myFirstWorld-world/myModel.kmz/myModel.kmz.dep</deployedModelURL>
  17. Open the my.module.properties file and change the “module.name”, “module.description” and “module.plugin.src” values
    • Example:
      • module.name=my-first-world
      • module.description=The first world that I made
      • module.plugin.src=org/jdesktop/wonderland/modules/wonderland-myFirstWorld-world
  18. Open the build.xml file and change the <project name> and <dirname property> tags
    • Example:
      • <project name="wonderland-myFirstWorld-world" default="dist" basedir=".">
      • <dirname property="current.dir" file="${ant.file.wonderland-myFirstWorld-world}"/>
  19. Build Wonderland using ant or NetBeans as per usual
  20. Your module will show up at the top of the Manage Worlds page in the Server Admin pages.

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-29) was last changed on 21-Sep-2015 11:45 by Abhishek Upadhyay