forked from EternalTrail/eeVR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
83 lines (75 loc) · 2.61 KB
/
__init__.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
""" Initialize eeVR blender plugin """
# pylint: disable=import-error
from datetime import datetime
from math import sin, cos, pi
import os
import bpy
import gpu
import bgl
import mathutils
import numpy as np
from bpy.types import Operator, Panel
from gpu_extras.batch import batch_for_shader
from .VRRenderer import RenderImage, RenderAnimation, RenderToolsPanel, VRRendererCancel
# Register all classes
def register():
""" Register eeVR to Blender """
bpy.types.Scene.renderModeEnum = bpy.props.EnumProperty(
items=[
("EQUI", "Equirectangular", "Renders in equirectangular projection"),
("DOME", "Full Dome", "Renders in full dome projection"),
],
default="EQUI",
name="Mode",
)
bpy.types.Scene.domeModeEnum = bpy.props.EnumProperty(
items=[
("0", "Equidistant (VTA)", "Renders in equidistant dome projection"),
("1", "Hemispherical (VTH)", "Renders in hemispherical dome projection"),
("2", "Equisolid", "Renders in equisolid dome projection"),
("3", "Stereographic", "Renders in Stereographic dome projection"),
],
default="0",
name="Method",
)
bpy.types.Scene.renderFOV = bpy.props.FloatProperty(
180.0,
default=180.0,
name="FOV",
min=180,
max=360,
description="Field of view in degrees",
)
bpy.types.Scene.cancelVRRenderer = bpy.props.BoolProperty(
name="Cancel", default=True
)
bpy.utils.register_class(RenderImage)
bpy.utils.register_class(RenderAnimation)
bpy.utils.register_class(RenderToolsPanel)
bpy.utils.register_class(VRRendererCancel)
# Unregister all classes
def unregister():
""" Unregister eeVR from Blender """
del bpy.types.Scene.domeModeEnum
del bpy.types.Scene.renderModeEnum
del bpy.types.Scene.renderFOV
bpy.utils.unregister_class(RenderImage)
bpy.utils.unregister_class(RenderAnimation)
bpy.utils.unregister_class(RenderToolsPanel)
bpy.utils.unregister_class(VRRendererCancel)
bl_info = {
"name": "eeVR",
"description": "Render in different projections using Eevee engine",
"author": "EternalTrail",
"version": (0, 1),
"blender": (2, 82, 7),
"location": "View3D > UI",
"warning": "This addon is still in early alpha, may break your blend file!",
"wiki_url": "https://github.com/EternalTrail/eeVR",
"tracker_url": "https://github.com/EternalTrail/eeVR/issues",
"support": "TESTING",
"category": "Render",
}
# If the script is not an addon when it is run, register the classes
if __name__ == "__main__":
register()