kopia lustrzana https://github.com/vilemduha/blendercam
mtimes
rodzic
94860361bc
commit
7fae236a11
|
@ -1195,6 +1195,8 @@ def check_operations_on_load(context):
|
|||
# load last used machine preset
|
||||
bpy.ops.script.execute_preset(filepath=machine_preset,menu_idname="CAM_MACHINE_MT_presets")
|
||||
_IS_LOADING_DEFAULTS=False
|
||||
# check for updated plugin
|
||||
bpy.ops.render.cam_check_updates()
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import re
|
|||
import io
|
||||
import os
|
||||
import sys
|
||||
import calendar
|
||||
|
||||
class UpdateChecker(bpy.types.Operator):
|
||||
"""calculate all CAM paths"""
|
||||
|
@ -58,7 +59,10 @@ class UpdateChecker(bpy.types.Operator):
|
|||
# check folder exists
|
||||
out_path.parent.mkdir(parents=True,exist_ok=True)
|
||||
with zf.open(filename,"r") as in_file, open(out_path,"wb") as out_file:
|
||||
time_struct=(*fileinfo.date_time,0,0,0)
|
||||
mtime=fileinfo.timegm(time_struct)
|
||||
out_file.write(in_file.read())
|
||||
os.utime(out_file,times=(mtime,mtime))
|
||||
# TODO: what about if a file is deleted...
|
||||
# updated everything, now mark as updated and reload scripts
|
||||
bpy.context.preferences.addons['cam'].preferences.just_updated=True
|
||||
|
|
Ładowanie…
Reference in New Issue