Improve object and action socket parse

This commit is contained in:
Lubos Lenco 2017-12-06 12:36:39 +01:00
parent f5e1dbe986
commit 034a832bf9
2 changed files with 8 additions and 2 deletions

View file

@ -6,7 +6,7 @@ bl_info = {
"location": "Properties -> Render -> Armory Player",
"description": "3D game engine for Blender",
"author": "Armory3D.org",
"version": (11, 4, 1),
"version": (11, 5, 0),
"blender": (2, 79, 0),
"wiki_url": "http://armory3d.org/manual",
"tracker_url": "https://github.com/armory3d/armory/issues"
@ -183,7 +183,7 @@ class ArmAddonUpdateButton(bpy.types.Operator):
self.report({"ERROR"}, "Configure SDK path first")
return {"CANCELLED"}
self.report({'INFO'}, 'Updating, check console for details. Please restart Blender after successful SDK update.')
print('Armory: Cloning [armory, iron, haxebullet, haxerecast, zui] repositories')
print('Armory (add-on v' + str(bl_info['version']) + '): Cloning [armory, iron, haxebullet, haxerecast, zui] repositories')
os.chdir(p)
update_repo(p, 'armory')
update_repo(p, 'iron')

View file

@ -44,6 +44,8 @@ class ArmObjectSocket(bpy.types.NodeSocket):
def get_default_value(self):
if self.default_value == '':
return ''
if self.default_value not in bpy.data.objects:
return self.default_value
return arm.utils.asset_name(bpy.data.objects[self.default_value])
def __init__(self):
@ -85,6 +87,10 @@ class ArmAnimActionSocket(bpy.types.NodeSocket):
default_value = StringProperty(name='Action', default='')
def get_default_value(self):
if self.default_value == '':
return ''
if self.default_value not in bpy.data.actions:
return self.default_value
name = arm.utils.asset_name(bpy.data.actions[self.default_value])
return arm.utils.safestr(name)