-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathget_text_from_storage.py
42 lines (32 loc) · 1018 Bytes
/
get_text_from_storage.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
# Nikita Akimov
#
# GitHub
# https://github.com/Korchy/BIS
import bpy
from bpy.props import IntProperty, BoolProperty
from bpy.types import Operator
from bpy.utils import register_class, unregister_class
from .TextManager import TextManager
class GetTextFromStorage(Operator):
bl_idname = 'bis.get_text_from_storage'
bl_label = 'BIS_GetFromStorage'
bl_description = 'Get text from BIS'
bl_options = {'REGISTER', 'UNDO'}
text_id: IntProperty(
name='text_id',
default=0
)
show_message: BoolProperty(
default=False
)
def execute(self, context):
rez = TextManager.from_bis(context=context, bis_text_id=self.text_id)
if rez['stat'] == 'OK':
if self.show_message:
bpy.ops.bis.messagebox('INVOKE_DEFAULT', message=rez['data']['text'])
return {'FINISHED'}
def register():
register_class(GetTextFromStorage)
def unregister():
unregister_class(GetTextFromStorage)