Skip to content
__init__.py 2.37 KiB
Newer Older
Dalai Felinto's avatar
Dalai Felinto committed
#====================== BEGIN GPL LICENSE BLOCK ======================
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
#======================= END GPL LICENSE BLOCK ========================

# <pep8 compliant>
bl_info = {
    "name": "Virtual Reality Viewport",
Dalai Felinto's avatar
Dalai Felinto committed
    "author": "Dalai Felinto, Visgraf/IMPA",
Dalai Felinto's avatar
Dalai Felinto committed
    "version": (0, 9),
Dalai Felinto's avatar
Dalai Felinto committed
    "blender": (2, 7, 7),
    "location": "View 3D Tools",
Dalai Felinto's avatar
Dalai Felinto committed
    "description": "",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "3D View"}


import bpy

Dalai Felinto's avatar
Dalai Felinto committed
from . import ui
Dalai Felinto's avatar
Dalai Felinto committed
from . import operator
Dalai Felinto's avatar
Dalai Felinto committed

Dalai Felinto's avatar
Dalai Felinto committed

Dalai Felinto's avatar
Dalai Felinto committed
# ############################################################
# User Preferences
# ############################################################
Dalai Felinto's avatar
Dalai Felinto committed
# Preferences
class VirtualRealityPreferences(bpy.types.AddonPreferences):
    bl_idname = __name__

    display_backend = bpy.props.EnumProperty(
        name="Display Backend",
        description="Library to use for the display",
        items=(("OCULUS", "Oculus", "Oculus - oculus.com"),
               ("OCULUS_LEGACY", "Oculus Legacy", "Oculus 0.5 - oculus.com"),
Dalai Felinto's avatar
Dalai Felinto committed
               ("DEBUG", "Debug", "Debug backend - no real HMD"),
               ),
        default="OCULUS",
        )
Dalai Felinto's avatar
Dalai Felinto committed

Dalai Felinto's avatar
Dalai Felinto committed
    def draw(self, context):
        layout = self.layout
Dalai Felinto's avatar
Dalai Felinto committed

Dalai Felinto's avatar
Dalai Felinto committed
        row = layout.row()
        row.prop(self, "display_backend")
Dalai Felinto's avatar
Dalai Felinto committed

Dalai Felinto's avatar
Dalai Felinto committed
# ############################################################
# Un/Registration
# ############################################################

Dalai Felinto's avatar
Dalai Felinto committed
def register():
Dalai Felinto's avatar
Dalai Felinto committed
    bpy.utils.register_class(VirtualRealityPreferences)

    operator.register()
Dalai Felinto's avatar
Dalai Felinto committed
    ui.register()
Dalai Felinto's avatar
Dalai Felinto committed


def unregister():
Dalai Felinto's avatar
Dalai Felinto committed
    bpy.utils.unregister_class(VirtualRealityPreferences)

    operator.unregister()
Dalai Felinto's avatar
Dalai Felinto committed
    ui.unregister()
Dalai Felinto's avatar
Dalai Felinto committed


if __name__ == '__main__':
    register()