-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathSRR_Settings.py
More file actions
94 lines (81 loc) · 2.63 KB
/
SRR_Settings.py
File metadata and controls
94 lines (81 loc) · 2.63 KB
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
import bpy
from bpy.props import (
BoolProperty,
EnumProperty,
FloatProperty,
IntProperty,
PointerProperty,
)
from bpy.types import PropertyGroup
class SRR_RenderStatus(PropertyGroup):
# private state
is_rendering: BoolProperty(
name="Rendering",
description="Currently rendering",
default=False,
options=set(), # Not animatable!
)
should_stop: BoolProperty(
name="Stop",
description="User requested stop",
default=False,
options=set(), # Not animatable!
)
tiles_total: IntProperty(
name="Total Tiles",
description="Total number of tiles to render",
options=set(), # Not animatable!
)
tiles_done: IntProperty(
name="Tiles Done",
description="Number of tiles rendered",
options=set(), # Not animatable!
)
percent_complete: FloatProperty(
name="%",
description="Percentage of tiles rendered",
subtype='PERCENTAGE',
min=0,
max=100,
options=set(), # Not animatable!
get=(lambda self: 0 if self.tiles_total == 0 else 100 * self.tiles_done / self.tiles_total),
set=(lambda self, value: None),
)
RENDER_METHODS = (
('camshift', "Camera shift", "Break the image into tiles using camera shift"),
('border', "Render border", "Break the image into tiles using render border regions"),
('camsplit', "Split camera", "Subdivide the camera, creating a new camera for each tile"),
)
SUBDIVISION_SIZES = (
('1', "2 x 2", "Break the render into 2 x 2 tiles"),
('2', "4 x 4", "Break the render into 4 x 4 tiles"),
('3', "8 x 8", "Break the render into 8 x 8 tiles"),
('4', "16 x 16", "Break the render into 16 x 16 tiles"),
)
class SRR_Settings(PropertyGroup):
render_method: EnumProperty(
name="Method",
items=RENDER_METHODS,
default='camshift',
description="Method used to divide image into tiles while rendering",
options=set(), # Not animatable!
)
subdivisions: EnumProperty(
name="Tiles",
items=SUBDIVISION_SIZES,
default='1',
description="Subdivisions of rendered image into tiles",
options=set(), # Not animatable!
)
status: PointerProperty(
name="Status",
type=SRR_RenderStatus,
options=set(), # Not animatable!
)
start_tile: IntProperty(
name="Start Tile",
description="The Tile it starts rendering from.",
default = 1,
min = 1,
max = 256,
)