6
Layar Blender addon v0.5.0 The Layar Blender addon enables you to export individual 3D models to the Layar 3D (.l3d) file format, as well as entire scenes to a combination of Layar JSON and resource files (.l3d files and images). While we have used the addon internally for several use cases, it should still be considered experimental. In this tutorial you can find how to : Install the addon Import and export Layar 3D (.l3d) files Create and export Layar Scenes (.json) Installation The Layar addon v0.5.0 has only been tested on Blender 2.7.0, and we have thus set this as the minimal version. Please download the latest version from blender.org if you are still running an older version. The Layar addon file can be found here To install the addon: Go to the user preferences screen (File > User Preferences…) Select the “Addons” tab. Click “Install from File…” and select the downloaded zip file. Search “layar” and Click the checkbox on the right to enable the addon Click “Save User Settings” to make sure the addon is enabled when you restart Blender

Layar Blender addon v0.5public.layar.com/downloads/Blender_Addon/Layar_Blenderaddon...Layar Blender addon v0.5.0 The Layar Blender addon enables you to export individual 3D models

Embed Size (px)

Citation preview

Page 1: Layar Blender addon v0.5public.layar.com/downloads/Blender_Addon/Layar_Blenderaddon...Layar Blender addon v0.5.0 The Layar Blender addon enables you to export individual 3D models

Layar Blender addon v0.5.0  The Layar Blender addon enables you to export individual 3D models to the Layar 3D (.l3d) file format, as well as entire scenes to a combination of Layar JSON and resource files (.l3d files and images). While we have used the addon internally for several use cases, it should still be considered experimental.  In this tutorial you can find how to :  

● Install the add­on ● Import and export Layar 3D (.l3d) files ● Create and export Layar Scenes (.json) 

 

Installation  The Layar addon v0.5.0 has only been tested on Blender 2.7.0, and we have thus set this as the minimal version. Please download the latest version from blender.org  if you are still running an older version. The Layar addon file can be found here  To install the addon:  

● Go to the user preferences screen (File ­> User Preferences…) ● Select the “Addons” tab. ● Click “Install from File…” and select the downloaded zip file. ● Search “layar” and Click the checkbox on the right to enable the addon ● Click “Save User Settings” to make sure the addon is enabled when you restart Blender 

 

Page 2: Layar Blender addon v0.5public.layar.com/downloads/Blender_Addon/Layar_Blenderaddon...Layar Blender addon v0.5.0 The Layar Blender addon enables you to export individual 3D models

 

Importing and exporting Layar 3D (.l3d) files After installing and enabling the addon, two new menu options appear: 

● File ­> Import ­> Layar3D (.l3d) ● File ­> Export ­> Layar3D (.l3d) 

 For exporting, this addon supports the following settings: 

● Selection only If enabled, only the selected objects are included in the export. Otherwise all mesh objects are exported 

● Apply modifiers If enabled, the modifiers are applied to the meshes before exporting. They are applied in the ‘PREVIEW’ configuration 

● Include Normals If enabled, the normals are included in the exported .l3d file 

● Include UVs If enabled, the UV texture coordinates are included in the exported .l3d file 

● Include Texture Images If enabled, the texture images are embedded in the .l3d file. 

 

Page 3: Layar Blender addon v0.5public.layar.com/downloads/Blender_Addon/Layar_Blenderaddon...Layar Blender addon v0.5.0 The Layar Blender addon enables you to export individual 3D models

Exporting Layar Scenes (.json) Besides exporting simple 3D models for Layar, the Layar blender addon also allows you to create more complex scenes right in Blender and export them to a package containing both a static JSON file that can act as the Layar API endpoint and all needed resources (.l3d files and images).  The Layar blender addon uses several API features introduced in Layar 8.3, so layers created with this addon should be set to target only this version or later. 

Setting up your scene The scene exporting options are placed in the “Properties panel” in the scene tab:  

● Layer Layer name as specified in the Layar publishing environment 

● Base URL The URL where the file are going to be hosted. The exported JSON document will refer to all resources with absolute URLs based on the given base URL 

● Base Anchor Specifies the anchor to use for all root objects in the scene 

○ Type User Location, Geo location, or Reference Image 

○ Scale Scale to apply to the scene 

● Helper objects Buttons to create Layar specific objects in the scene 

○ Add reference image Adds an empty object with image visualization and special data properties for reference images. This can be used as an anchor point for other objects. 

○ Add 2D object Adds an empty object with image visualization. In the export, these objects will be exported as 2D objects with the linked image as object. 

● Export scene (.json) Use this button to export the scene. 

Explicit anchors The Layar Blender addon uses object parenting to specify the anchor property of the object. Objects without a parent (root objects) are using the base anchor. 

Page 4: Layar Blender addon v0.5public.layar.com/downloads/Blender_Addon/Layar_Blenderaddon...Layar Blender addon v0.5.0 The Layar Blender addon enables you to export individual 3D models

 Parenting in blender is done by first selecting the child object and then the desired parent object while holding shift. Then use the keyboard shortcut Ctrl­P and select ‘Object’ in the ‘Set parent to dialog’.  When objects are parented to other objects, this translates to a POI anchor in the exported JSON.  

Setting up a reference image While it is possible to create a scene on a reference image using the ‘Reference Image’ type base anchor, it is recommended to add a “Reference Image” helper object and explicitly parent the objects to this.  

● Click the “Add reference image” button on the scene’s Layar properties panel 

● Specify the key and real world size you specified when uploading the reference image. 

● If you want to hide any objects behind the reference image (e.g. if you want objects to fly around it), you can check “Add viewblocker”. 

  

Page 5: Layar Blender addon v0.5public.layar.com/downloads/Blender_Addon/Layar_Blenderaddon...Layar Blender addon v0.5.0 The Layar Blender addon enables you to export individual 3D models

  After creating the reference image helper object, you will see special “empty” object in the 3D view. You still need to add the actual image for preview purposes and to make sure the aspect ratio is set up correctly.  

● In the “Properties panel” go to the tab for the “Empty” properties. 

● Click “Open” to load your image. ● You should leave the offsets as­is. 

 Now you use this object as the parent for your other objects.      

Page 6: Layar Blender addon v0.5public.layar.com/downloads/Blender_Addon/Layar_Blenderaddon...Layar Blender addon v0.5.0 The Layar Blender addon enables you to export individual 3D models

Exporting Once you are done designing your scene, go back to the scene tab on the properties panel, and click the “Export scene (.json)” button  In the export screen, there are a couple of settings: 

● Selection Only If enabled, only the selected objects are included in the export. Otherwise all objects in the scene are exported 

● Apply modifiers If enabled, the modifiers are applied to the meshes before exporting. They are applied in the ‘PREVIEW’ configuration 

● Externalize materials and textures If enabled, all materials and textures will be exported in the JSON data and as separate image resources, instead of embedded in the .l3d resource files. This is useful if you want to use a script to dynamically adjust the generated JSON. 

● Pretty print the JSON output If enabled, the JSON data is exported in a human readable format with proper indentation and line breaks.