Check sdk path
This commit is contained in:
parent
e363e2dcef
commit
b038f99225
|
@ -151,6 +151,14 @@ def check_camera(self):
|
|||
return False
|
||||
return True
|
||||
|
||||
def check_sdkpath(self):
|
||||
s = get_sdk_path()
|
||||
for c in r'[];,><&*:%=+@!#^()|?^':
|
||||
if c in s:
|
||||
self.report({"ERROR"}, "SDK path contains special characters")
|
||||
return False
|
||||
return True
|
||||
|
||||
def tess_enabled(target):
|
||||
return target == 'krom' or target == 'native'
|
||||
|
||||
|
|
|
@ -439,6 +439,9 @@ class ArmoryPlayButton(bpy.types.Operator):
|
|||
|
||||
if not armutils.check_camera(self):
|
||||
return {"CANCELLED"}
|
||||
|
||||
if not armutils.check_sdkpath(self):
|
||||
return {"CANCELLED"}
|
||||
|
||||
nodes_renderpath.check_default()
|
||||
|
||||
|
@ -459,6 +462,9 @@ class ArmoryPlayInViewportButton(bpy.types.Operator):
|
|||
if not armutils.check_camera(self):
|
||||
return {"CANCELLED"}
|
||||
|
||||
if not armutils.check_sdkpath(self):
|
||||
return {"CANCELLED"}
|
||||
|
||||
if context.area == None:
|
||||
return {"CANCELLED"}
|
||||
|
||||
|
@ -500,6 +506,12 @@ class ArmoryBuildButton(bpy.types.Operator):
|
|||
if not armutils.check_saved(self):
|
||||
return {"CANCELLED"}
|
||||
|
||||
if not armutils.check_camera(self):
|
||||
return {"CANCELLED"}
|
||||
|
||||
if not armutils.check_sdkpath(self):
|
||||
return {"CANCELLED"}
|
||||
|
||||
assets.invalidate_enabled = False
|
||||
make.build_project()
|
||||
make.compile_project(watch=True)
|
||||
|
@ -603,6 +615,12 @@ class ArmoryPublishButton(bpy.types.Operator):
|
|||
if not armutils.check_saved(self):
|
||||
return {"CANCELLED"}
|
||||
|
||||
if not armutils.check_camera(self):
|
||||
return {"CANCELLED"}
|
||||
|
||||
if not armutils.check_sdkpath(self):
|
||||
return {"CANCELLED"}
|
||||
|
||||
make.publish_project()
|
||||
self.report({'INFO'}, 'Publishing project, check console for details.')
|
||||
return{'FINISHED'}
|
||||
|
|
Loading…
Reference in a new issue