armory/blender/log.py

45 lines
997 B
Python
Raw Normal View History

2016-10-19 13:28:06 +02:00
import props_ui
import space_armory
2016-10-27 01:11:11 +02:00
import armutils
2016-11-12 18:30:39 +01:00
import bridge
2016-10-19 13:28:06 +02:00
progress = 100.0
tag_redraw = False
def clear():
props_ui.ArmoryProjectPanel.info_text = ''
2016-11-23 15:34:59 +01:00
if armutils.with_krom():
2016-10-19 13:28:06 +02:00
space_armory.ArmorySpaceHeader.info_text = ''
def format_text(text):
return (text[:80] + '..') if len(text) > 80 else text # Limit str size
2016-11-12 18:30:39 +01:00
def electron_trace(text):
txt = text.split(' ', 1)
if len(txt) > 1 and txt[1].startswith('__arm'):
2016-11-26 22:33:31 +01:00
bridge.parse_operator(txt[1])
2016-11-12 18:30:39 +01:00
else:
print_info(text)
2016-10-19 13:28:06 +02:00
def print_info(text):
global tag_redraw
print(text)
props_ui.ArmoryProjectPanel.info_text = format_text(text)
tag_redraw = True
def print_player(text):
space_armory.ArmorySpaceHeader.info_text = format_text(text)
def print_progress(value):
global progress
global tag_redraw
progress = value
tag_redraw = True
def get_progress(self):
global progress
return progress
2016-11-05 20:57:04 +01:00
def warn(text):
print('Armory Warning: ' + text)