forked from chsh2/texture_vfx_control
-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
48 lines (40 loc) · 1.63 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
bl_info = {
"name" : "Texture VFX Control",
"author" : "https://github.com/chsh2/texture_vfx_control",
"description" : "Shader-based video playback control and composition VFXs",
"blender" : (3, 3, 0),
"version" : (0, 1, 0),
"location" : "View3D > Object > Quick Effects, or Shader Editor > Add",
"warning" : "This addon is still in an early stage of development",
"doc_url": "",
"wiki_url": "",
"tracker_url": "",
"category" : "Node"
}
import bpy
from . import auto_load
auto_load.init()
class NODE_MT_add_tfx_submenu(bpy.types.Menu):
bl_label = "Texture VFX Control"
bl_idname = "NODE_MT_add_tfx_submenu"
def draw(self, context):
layout = self.layout
layout.operator("node.tfx_add_playback_driver", icon='PLAY')
layout.operator("node.tfx_grainy_blur", icon='SHADERFX')
layout.operator("node.tfx_chroma_key", icon='SHADERFX')
layout.operator("node.tfx_outline", icon='SHADERFX')
layout.operator("node.tfx_append_node_groups", icon='NODE')
def menu_func(self, context):
layout = self.layout
if context.area.ui_type == "ShaderNodeTree" or context.area.type == "VIEW_3D":
layout.menu("NODE_MT_add_tfx_submenu", icon='SHADERFX')
def register():
auto_load.register()
bpy.utils.register_class(NODE_MT_add_tfx_submenu)
bpy.types.NODE_MT_add.append(menu_func)
bpy.types.VIEW3D_MT_object_quick_effects.append(menu_func)
def unregister():
auto_load.unregister()
bpy.utils.unregister_class(NODE_MT_add_tfx_submenu)
bpy.types.NODE_MT_add.remove(menu_func)
bpy.types.VIEW3D_MT_object_quick_effects.remove(menu_func)