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): ...@@ -47,7 +47,7 @@ class Debug(HMD_Base):
Get fresh tracking data Get fresh tracking data
""" """
print_debug('loop()') print_debug('loop()')
debug_draw(self._offscreen_object, self._width, self._height) #debug_draw(self._offscreen_object, self._width, self._height)
def frameReady(self): def frameReady(self):
""" """
......
...@@ -59,7 +59,7 @@ class VirtualRealityDisplayOperator(bpy.types.Operator): ...@@ -59,7 +59,7 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
return {'FINISHED'} return {'FINISHED'}
if event.type == 'TIMER': if event.type == 'TIMER':
self.loop() self.loop(vr.color_object)
if vr.preview_scale and context.area: if vr.preview_scale and context.area:
area.tag_redraw() area.tag_redraw()
...@@ -152,7 +152,7 @@ class VirtualRealityDisplayOperator(bpy.types.Operator): ...@@ -152,7 +152,7 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
return True return True
def loop(self): def loop(self, color_object):
""" """
Get fresh tracking data and render into the FBO Get fresh tracking data and render into the FBO
""" """
...@@ -166,6 +166,9 @@ class VirtualRealityDisplayOperator(bpy.types.Operator): ...@@ -166,6 +166,9 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
# drawing # drawing
# bpy.ops.view3d.offscreen(offscreen_object=offscreen_object, projection_matrix=projection_matrix, modelview_matrix=modelview_matrix) # 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() self._hmd.frameReady()
...@@ -196,6 +199,13 @@ class VirtualRealityInfo(bpy.types.PropertyGroup): ...@@ -196,6 +199,13 @@ class VirtualRealityInfo(bpy.types.PropertyGroup):
subtype='PERCENTAGE', subtype='PERCENTAGE',
) )
color_object = bpy.props.IntProperty(
name="Color Object",
default=0,
subtype='UNSIGNED',
)
# ############################################################ # ############################################################
# Callbacks # Callbacks
......
...@@ -26,6 +26,7 @@ class VirtualRealityPanel(bpy.types.Panel): ...@@ -26,6 +26,7 @@ class VirtualRealityPanel(bpy.types.Panel):
col.separator() col.separator()
col.prop(vr, "preview_scale", text="Preview") 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