Exemple #1
0
def init():
    """
    called from logic brick
    """
    if not hasattr(logic, 'setRender'):
        print("ERROR: You require a patched Blender with bge.logic.setRender() method")
        return logic.endGame()

    scene = logic.getCurrentScene()
    camera = scene.objects.get('Camera.VR')

    if not camera:
        print("ERROR: Missing special Camera.VR object")
        return logic.endGame()

    backend = camera['backend']

    hmd = HMD(backend)

    if not hmd.start():
        return logic.endGame()

    """
    waiting for the following fix to use logic.globalDict instead of globals
    https://developer.blender.org/T46870

    (this is fixed, but it has not been merged in decklink yet)
    """
    logic.hmd = hmd