This repository has been archived by the owner on Nov 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
63 lines (47 loc) · 1.66 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
# This is the main file of addon.
bl_info = {
"name": "Blend PS3Texture",
"author": "VELD-Dev",
"version": (0, 0, 21),
"blender": (3, 2, 0),
"location": "File > PS3Texture > Generate Materials",
"description": ("Tool to generate all the materials for a model, mostly for an entire map from "
"a PS3 exported .obj map file. (Work only with PS3 games) " ),
"warning": "Work in progress, be careful, the mod may crash Blender, always backup your files !",
"doc_url": "https://github.com/VELD-Dev/blend-ps3textures",
"category": "Reverse-Engineering",
}
print("hello world")
if "bpy" in locals():
import importlib
importlib.reload(ps3tex_operator)
else:
from . import ps3tex_operator
import bpy
from bpy.types import (Panel, Operator, ThemeTopBar)
class PS3TexPanel(Panel):
"""Panel of Blend PS3Texture"""
bl_label = "Blend PS3Texture"
bl_idname = "VIEW3D_PT_generate_ps3tex"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
def draw(self, context):
layout = self.layout
layout.operator("wm.open_mainfile")
layout.operator("wm.save_as_mainfile")
from bpy.utils import register_class, unregister_class
classes = [
PS3TexPanel,
ps3tex_operator.PS3TexGeneratorOperator
]
def register():
for cls in classes:
register_class(cls)
bpy.types.TOPBAR_MT_file.append(PS3TexPanel.draw()) #ps3tex_operator.menu_func)
def unregister():
for cls in classes:
unregister_class(cls)
bpy.types.VIEW3D_MT_object.remove(ps3tex_operator.menu_func)
if __name__ == "__main__":
register()
bpy.ops.object.ps3tex_generator()