-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy path__init__.py
executable file
·156 lines (136 loc) · 4.34 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import bpy
import os
import shutil
from .operators import *
bl_info = {
"name": "Bizualizer",
"description": "Create a simple visualizer for audio",
"author": "doakey3",
"version": (1, 2, 4),
"blender": (2, 80, 0),
"wiki_url": "https://github.com/doakey3/Bizualizer",
"tracker_url": "https://github.com/doakey3/Bizualizer/issues",
"category": "Animation",
"location": "Properties > Scene"}
class RENDER_PT_ui(bpy.types.Panel):
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_label = "Bizualizer"
bl_context = "scene"
bl_options = {"DEFAULT_CLOSED"}
def draw(self, context):
layout = self.layout
scene = bpy.context.scene
row = layout.row()
row.prop(scene, "bz_audiofile", icon="SOUND")
row = layout.row()
row.prop(scene, "bz_audio_channel")
row = layout.row()
row.operator("sequencerextra.bz_audio_to_sequencer",
icon="SEQ_SEQUENCER")
row.operator("sequencerextra.bz_audio_remove", icon="CANCEL")
row = layout.row()
row.prop(scene, "bz_bar_count")
row.prop(scene, "bz_bar_width")
row = layout.row()
row.prop(scene, "bz_amplitude")
row.prop(scene, "bz_spacing")
row = layout.row()
row.prop(scene, "bz_color")
row = layout.row()
split = row.split()
col_a = split.column(align=True)
col_a.prop(scene, "bz_use_radial")
col_b = split.column(align=True)
col_b.prop(scene, "bz_radius")
if scene.bz_use_radial:
col_b.enabled = True
else:
col_b.enabled = False
row = layout.row()
row.operator("object.bz_generate", icon="FILE_REFRESH")
row = layout.row()
row.operator("object.bz_align_camera", icon="CAMERA_DATA")
box = layout.box()
row = box.row()
row.prop(scene, 'bbz_config')
row = box.row()
row.operator('object.batch_bizualize', icon="ALIGN_LEFT")
row.operator('object.make_bz_previews')
def initprop():
bpy.types.Scene.bz_audiofile = bpy.props.StringProperty(
name="Audio Path",
description="Define path of the audio file",
subtype="FILE_PATH",
)
bpy.types.Scene.bz_audio_channel = bpy.props.IntProperty(
name="Audio Channel",
description="Channel where audio will be added",
default=1,
min=1
)
bpy.types.Scene.bz_bar_count = bpy.props.IntProperty(
name="Bar Count",
description="The number of bars to make",
default=64,
min=1
)
bpy.types.Scene.bz_bar_width = bpy.props.FloatProperty(
name="Bar Width",
description="The width of the bars",
default=0.8,
min=0
)
bpy.types.Scene.bz_amplitude = bpy.props.FloatProperty(
name="Amplitude",
description="Amplitude of visualizer bars",
default=24.0,
min=0
)
bpy.types.Scene.bz_color = bpy.props.FloatVectorProperty(
name="Bar Color",
subtype='COLOR_GAMMA',
description="Color applied to bars after visualizer is generated",
size=3,
default=(1.0, 1.0, 1.0),
min=0.0, max=1.0,)
bpy.types.Scene.bz_use_radial = bpy.props.BoolProperty(
name="Use Radial",
description="Use a circular visualizer",
default=False
)
bpy.types.Scene.bz_radius = bpy.props.FloatProperty(
name="Radius",
description="Radius of the radial visualizer",
default=20,
min=0
)
bpy.types.Scene.bz_spacing = bpy.props.FloatProperty(
name="Spacing",
description="Spacing between bars",
default=2.25,
min=0
)
bpy.types.Scene.bbz_config = bpy.props.StringProperty(
name="Config File",
description="Path to the Config File",
subtype="FILE_PATH",
)
classes = [
RENDER_PT_ui,
RENDER_OT_align_camera,
RENDER_OT_audio_to_vse,
RENDER_OT_batch_bizualize,
RENDER_OT_generate_visualizer,
RENDER_OT_make_previews,
RENDER_OT_remove_bz_audio
]
def register():
initprop()
from bpy.utils import register_class
for cls in classes:
register_class(cls)
def unregister():
from bpy.utils import unregister_class
for cls in reversed(classes):
unregister_class(cls)