WIP: Blender Kitsu: Convention Checker #124
@ -28,6 +28,7 @@ from blender_kitsu import (
|
||||
bkglobals,
|
||||
types,
|
||||
cache,
|
||||
checker,
|
||||
models,
|
||||
playblast,
|
||||
propsdata,
|
||||
@ -78,6 +79,7 @@ if _need_reload:
|
||||
ui = importlib.reload(ui)
|
||||
sqe.reload()
|
||||
util = importlib.reload(util)
|
||||
checker = importlib.reload(checker)
|
||||
generic.reload()
|
||||
auth.reload()
|
||||
context.reload()
|
||||
@ -89,6 +91,7 @@ def register():
|
||||
lookdev.register()
|
||||
prefs.register()
|
||||
cache.register()
|
||||
checker.register()
|
||||
props.register()
|
||||
sqe.register()
|
||||
generic.register()
|
||||
@ -111,6 +114,7 @@ def unregister():
|
||||
generic.unregister()
|
||||
sqe.unregister()
|
||||
props.unregister()
|
||||
checker.unregister()
|
||||
cache.unregister()
|
||||
prefs.unregister()
|
||||
lookdev.unregister()
|
||||
|
19
scripts-blender/addons/blender_kitsu/checker/__init__.py
Normal file
19
scripts-blender/addons/blender_kitsu/checker/__init__.py
Normal file
@ -0,0 +1,19 @@
|
||||
import importlib
|
||||
from blender_kitsu.checker import ops
|
||||
|
||||
|
||||
# ---------REGISTER ----------.
|
||||
|
||||
|
||||
def reload():
|
||||
global ops
|
||||
|
||||
ops = importlib.reload(ops)
|
||||
|
||||
|
||||
def register():
|
||||
ops.register()
|
||||
|
||||
|
||||
def unregister():
|
||||
ops.unregister()
|
49
scripts-blender/addons/blender_kitsu/checker/ops.py
Normal file
49
scripts-blender/addons/blender_kitsu/checker/ops.py
Normal file
@ -0,0 +1,49 @@
|
||||
import bpy
|
||||
|
||||
|
||||
class KITSU_OT_test_op(bpy.types.Operator):
|
||||
bl_idname = "kitsu.test_op"
|
||||
bl_label = 'test'
|
||||
|
||||
text: bpy.props.StringProperty(name='test', default='')
|
||||
|
||||
def execute(self, context):
|
||||
if self.text != "test":
|
||||
self.report({'ERROR'}, "Failure")
|
||||
return {'CANCELLED'}
|
||||
self.report({'INFO'}, "Success")
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class KITSU_OT_convention_checker(bpy.types.Operator):
|
||||
bl_idname = "kitsu.convention_checker"
|
||||
bl_label = 'Convention Checker'
|
||||
|
||||
def execute(self, context):
|
||||
# TODO read types out of json File
|
||||
# TODO check operator exists before execution
|
||||
# INFO python3 -m json.tool file.json to 'pretty print' json
|
||||
try:
|
||||
bpy.ops.kitsu.test_op()
|
||||
except RuntimeError as ex:
|
||||
ex
|
||||
self.report({'INFO'}, "CONFIRMED FAILURE")
|
||||
else:
|
||||
self.report({'INFO'}, "CONFIRMED SUCCESS")
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
classes = [
|
||||
KITSU_OT_test_op,
|
||||
KITSU_OT_convention_checker,
|
||||
]
|
||||
|
||||
|
||||
def register():
|
||||
for cls in classes:
|
||||
bpy.utils.register_class(cls)
|
||||
|
||||
|
||||
def unregister():
|
||||
for cls in reversed(classes):
|
||||
bpy.utils.unregister_class(cls)
|
Loading…
Reference in New Issue
Block a user