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
e2c74429
Commit
e2c74429
authored
Oct 09, 2015
by
Dalai Felinto
Browse files
Remove timer and ignore the preview functionality for now
parent
4896ac0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
space_view3d_virtual_reality/operator.py
View file @
e2c74429
...
...
@@ -57,11 +57,13 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
area
.
tag_redraw
()
return
{
'FINISHED'
}
"""
if event.type == 'TIMER':
self.loop(context)
if vr.preview_scale and context.area:
area.tag_redraw()
"""
return
{
'PASS_THROUGH'
}
...
...
@@ -107,11 +109,6 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
def
_quit
(
self
,
context
):
"""actual quit"""
wm
=
context
.
window_manager
if
self
.
_timer
:
wm
.
event_timer_remove
(
self
.
_timer
)
del
self
.
_timer
if
self
.
_handle
:
bpy
.
types
.
SpaceView3D
.
draw_handler_remove
(
self
.
_handle
,
'WINDOW'
)
...
...
@@ -154,13 +151,12 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
self
.
_area_hash
=
hash
(
context
.
area
)
# setup modal
self
.
_timer
=
wm
.
event_timer_add
(
1.0
/
75.0
,
context
.
window
)
# 75 Hz
self
.
_handle
=
bpy
.
types
.
SpaceView3D
.
draw_handler_add
(
self
.
_draw_callback_px
,
(
context
,),
'WINDOW'
,
'POST_PIXEL'
)
wm
.
modal_handler_add
(
self
)
return
True
def
loop
(
self
,
context
):
def
_
loop
(
self
,
context
):
"""
Get fresh tracking data and render into the FBO
"""
...
...
@@ -181,10 +177,18 @@ class VirtualRealityDisplayOperator(bpy.types.Operator):
def
_draw_callback_px
(
self
,
context
):
"""callback function, run every time the viewport is refreshed"""
if
self
.
_area_hash
==
hash
(
context
.
area
):
wm
=
context
.
window_manager
vr
=
wm
.
virtual_reality
self
.
_preview
.
loop
(
vr
.
preview_scale
)
area
=
context
.
area
if
not
self
.
_area_hash
==
hash
(
area
):
return
self
.
_loop
(
context
)
area
.
tag_redraw
()
"""
wm = context.window_manager
vr = wm.virtual_reality
self._preview.loop(vr.preview_scale)
"""
def
_error_callback
(
self
,
message
,
is_fatal
):
"""
...
...
space_view3d_virtual_reality/ui.py
View file @
e2c74429
...
...
@@ -25,7 +25,7 @@ class VirtualRealityPanel(bpy.types.Panel):
col
.
operator
(
"view3d.virtual_reality_display"
,
text
=
"Virtual Reality"
,
icon
=
"X"
).
action
=
'DISABLE'
col
.
separator
()
col
.
prop
(
vr
,
"preview_scale"
,
text
=
"Preview"
)
#
col.prop(vr, "preview_scale", text="Preview")
col
.
label
(
text
=
vr
.
error_message
)
...
...
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