Commit d52fc549 authored by Dalai Felinto's avatar Dalai Felinto
Browse files

DEBUG: waiting for real solution for offscreen, meanwhile this will do

We need to manually specify the texture to use (it is printed out from bpy.ops.view3d.offscreen())
parent 0e0d5c6f
......@@ -47,7 +47,7 @@ class Debug(HMD_Base):
Get fresh tracking data
"""
print_debug('loop()')
debug_draw(self._offscreen_object, self._width, self._height)
#debug_draw(self._offscreen_object, self._width, self._height)
def frameReady(self):
"""
......
......@@ -59,7 +59,7 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
return {'FINISHED'}
if event.type == 'TIMER':
self.loop()
self.loop(vr.color_object)
if vr.preview_scale and context.area:
area.tag_redraw()
......@@ -152,7 +152,7 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
return True
def loop(self):
def loop(self, color_object):
"""
Get fresh tracking data and render into the FBO
"""
......@@ -166,6 +166,9 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
# drawing
# bpy.ops.view3d.offscreen(offscreen_object=offscreen_object, projection_matrix=projection_matrix, modelview_matrix=modelview_matrix)
bpy.ops.view3d.offscreen(projection_matrix=projection_matrix, modelview_matrix=modelview_matrix)
self._preview.update(color_object)
self._hmd.frameReady()
......@@ -196,6 +199,13 @@ class VirtualRealityInfo(bpy.types.PropertyGroup):
subtype='PERCENTAGE',
)
color_object = bpy.props.IntProperty(
name="Color Object",
default=0,
subtype='UNSIGNED',
)
# ############################################################
# Callbacks
......
......@@ -26,6 +26,7 @@ class VirtualRealityPanel(bpy.types.Panel):
col.separator()
col.prop(vr, "preview_scale", text="Preview")
col.prop(vr, "color_object")
# ############################################################
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment