|
1 | | -from .operators import SIMLOADER_OT_load,SIMLOADER_OT_edit,SIMLOADER_OT_resetpt,SIMLOADER_OT_resetmesh,SIMLOADER_OT_resetins |
| 1 | +from .operators import SIMLOADER_OT_load, SIMLOADER_OT_edit, SIMLOADER_OT_resetpt, SIMLOADER_OT_resetmesh, SIMLOADER_OT_resetins |
2 | 2 | from .properties import SIMLOADER_scene_property, SIMLOADER_obj_property |
3 | 3 | from .panels import SIMLOADER_UL_Obj_List, SIMLOADER_List_Panel, SIMLOADER_Settings, SIMLOADER_Import, SIMLOADER_Templates, SIMLOADER_UL_Att_List, draw_template |
4 | | -from .importer_manager import subscribe_to_selected, unsubscribe_to_selected |
| 4 | +from .messanger import subscribe_to_selected, unsubscribe_to_selected |
5 | 5 | import bpy |
6 | 6 | from bpy.app.handlers import persistent |
7 | 7 | from .importer import update_obj |
| 8 | +from datetime import datetime |
| 9 | + |
| 10 | + |
| 11 | +def print_information(scene): |
| 12 | + if not bpy.context.scene.SIMLOADER.print: |
| 13 | + return |
| 14 | + now = datetime.now() |
| 15 | + path = bpy.context.scene.render.filepath |
| 16 | + filepath = path + '/simloader_' + now.strftime("%Y_%m_%d %H:%M") |
| 17 | + with open(filepath, 'w') as file: |
| 18 | + file.write("Render Time: {}\n".format(now.strftime("%Y_%m_%d %H:%M"))) |
| 19 | + file.write("Simloader Objects in the scene:\n\n") |
| 20 | + for obj in bpy.data.objects: |
| 21 | + simloader_prop = obj.SIMLOADER |
| 22 | + if simloader_prop.init: |
| 23 | + file.write("Object name: {}\n".format(obj.name)) |
| 24 | + file.write("Is it being animated: {}\n".format(simloader_prop.enabled)) |
| 25 | + file.write("Filepath: {}\n".format(simloader_prop.pattern)) |
| 26 | + file.write("Is it relative path: {}\n".format(simloader_prop.use_relative)) |
| 27 | + file.write("\n\n") |
8 | 28 |
|
9 | 29 |
|
10 | 30 | @persistent |
11 | 31 | def SIMLOADER_initilize(scene): |
12 | 32 | if update_obj not in bpy.app.handlers.frame_change_post: |
13 | 33 | bpy.app.handlers.frame_change_post.append(update_obj) |
14 | 34 | subscribe_to_selected() |
| 35 | + if print_information not in bpy.app.handlers.render_init: |
| 36 | + bpy.app.handlers.render_init.append(print_information) |
15 | 37 |
|
16 | 38 |
|
17 | 39 | __all__ = [ |
|
0 commit comments