forked from lightfield-analysis/blender-addon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.py
100 lines (87 loc) · 4.6 KB
/
gui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
############################################################################
# This file is part of the 4D Light Field Benchmark. #
# #
# This work is licensed under the Creative Commons #
# Attribution-NonCommercial-ShareAlike 4.0 International License. #
# To view a copy of this license, #
# visit http://creativecommons.org/licenses/by-nc-sa/4.0/. #
# #
# Authors: Katrin Honauer & Ole Johannsen #
# Contact: [email protected] #
# Website: www.lightfield-analysis.net #
# #
# This add-on is based upon work of Maximilian Diebold #
# #
# The 4D Light Field Benchmark was jointly created by the University of #
# Konstanz and the HCI at Heidelberg University. If you use any part of #
# the benchmark, please cite our paper "A dataset and evaluation #
# methodology for depth estimation on 4D light fields". Thanks! #
# #
# @inproceedings{honauer2016benchmark, #
# title={A dataset and evaluation methodology for depth estimation on #
# 4D light fields}, #
# author={Honauer, Katrin and Johannsen, Ole and Kondermann, Daniel #
# and Goldluecke, Bastian}, #
# booktitle={Asian Conference on Computer Vision}, #
# year={2016}, #
# organization={Springer} #
# } #
# #
############################################################################
import bpy
from bpy.props import *
class VIEW3D_OT_lightfield_setup(bpy.types.Panel):
bl_space_type = "VIEW_3D"
bl_region_type = "TOOLS"
bl_context = "objectmode"
bl_label = "Light Field Renderer"
def draw(self, context):
LF = bpy.context.scene.LF
layout = self.layout
col = layout.column(align=True)
col.label(text="Camera parameters:")
col.prop(LF, "focal_length")
col.prop(LF, "x_res")
col.prop(LF, "y_res")
col.prop(LF, "sensor_size")
col.prop(LF, "fstop")
col = layout.column(align=True)
col.label(text="Light field parameters:")
col.prop(LF, "num_cams_x")
col.prop(LF, "num_cams_y")
col.prop(LF, "baseline_mm")
col.prop(LF, "focus_dist")
col = layout.column(align=True)
col.operator("scene.create_lightfield", "Add Camera Grid", icon="HAND")
col.operator("scene.delete_lightfield", "Delete Camera Grid", icon="HAND")
col = layout.column(align=True)
col.label(text="Disparity Preview:")
col.prop(LF, "frustum_min_disp")
col.prop(LF, "frustum_max_disp")
if LF.frustum_is_hidden():
col.operator("scene.show_frustum", "Show Frustum", icon="HAND")
else:
col.operator("scene.hide_frustum", "Hide Frustum", icon="HAND")
col = layout.column(align=True)
col.label(text="Rendering:")
col.prop(LF, "tgt_dir")
col.prop(LF, "depth_map_scale")
col.prop(LF, "sequence_start")
col.prop(LF, "sequence_end")
col.prop(LF, "sequence_steps")
col.prop(LF, "save_depth_for_all_views")
col.prop(LF, "save_object_id_maps_for_all_views")
col.operator("scene.render_lightfield", "Render Light Field", icon="HAND")
col = layout.column(align=True)
col.label("Meta information:")
col.prop(LF, "scene")
col.prop(LF, "category")
col.prop(LF, "date")
col.prop(LF, "version")
col.prop(LF, "authors")
col.prop(LF, "contact")
col = layout.column(align=True)
col.label(text="Save/load light field settings:")
col.prop(LF, "path_config_file")
col.operator("scene.load_lightfield", "Load config file", icon="SCENE_DATA")
col.operator("scene.save_lightfield", "Save config file", icon="SCENE_DATA")