Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dalai Felinto
virtual_reality_viewport
Commits
7bdbe424
Commit
7bdbe424
authored
Sep 29, 2015
by
Dalai Felinto
Browse files
Using GPU offscreen_object_draw instead of operator
parent
b09cfa05
Changes
3
Hide whitespace changes
Inline
Side-by-side
space_view3d_virtual_reality/operator.py
View file @
7bdbe424
...
...
@@ -10,7 +10,7 @@ from .lib import (
getDisplayBackend
,
)
TODO
=
True
import
gpu
# ############################################################
...
...
@@ -59,7 +59,7 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
return
{
'FINISHED'
}
if
event
.
type
==
'TIMER'
:
self
.
loop
(
context
,
vr
.
color_object_left
,
vr
.
color_object_right
)
self
.
loop
(
context
)
if
vr
.
preview_scale
and
context
.
area
:
area
.
tag_redraw
()
...
...
@@ -156,7 +156,7 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
return
True
def
loop
(
self
,
context
,
color_object_left
,
color_object_right
):
def
loop
(
self
,
context
):
"""
Get fresh tracking data and render into the FBO
"""
...
...
@@ -170,12 +170,9 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
projection_matrix
=
self
.
_hmd
.
projection_matrix
# 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
)
#DEBUG
gpu
.
offscreen_object_draw
(
context
,
offscreen_object
,
modelview_matrix
,
projection_matrix
)
self
.
_hmd
.
frameReady
()
self
.
_preview
.
update
(
color_object_left
,
color_object_right
)
#DEBUG
def
_draw_callback_px
(
self
,
context
):
"""callback function, run every time the viewport is refreshed"""
...
...
@@ -204,19 +201,6 @@ class VirtualRealityInfo(bpy.types.PropertyGroup):
subtype
=
'PERCENTAGE'
,
)
color_object_left
=
bpy
.
props
.
IntProperty
(
name
=
"Color Object Left"
,
default
=
0
,
subtype
=
'UNSIGNED'
,
)
color_object_right
=
bpy
.
props
.
IntProperty
(
name
=
"Color Object Right"
,
default
=
0
,
subtype
=
'UNSIGNED'
,
)
# ############################################################
# Callbacks
...
...
space_view3d_virtual_reality/preview.py
View file @
7bdbe424
...
...
@@ -13,8 +13,6 @@ from .opengl_helper import (
from
bgl
import
*
TODO
=
True
class
Preview
:
__slots__
=
{
...
...
space_view3d_virtual_reality/ui.py
View file @
7bdbe424
...
...
@@ -26,9 +26,6 @@ class VirtualRealityPanel(bpy.types.Panel):
col
.
separator
()
col
.
prop
(
vr
,
"preview_scale"
,
text
=
"Preview"
)
row
=
col
.
row
(
align
=
True
)
row
.
prop
(
vr
,
"color_object_left"
)
row
.
prop
(
vr
,
"color_object_right"
)
# ############################################################
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment