Safe project name
This commit is contained in:
parent
1bbf4555ce
commit
b46d0ca15f
|
@ -1461,6 +1461,7 @@ class ArmoryExporter:
|
||||||
boneIndexArray = []
|
boneIndexArray = []
|
||||||
boneWeightArray = []
|
boneWeightArray = []
|
||||||
|
|
||||||
|
warn_bones = False
|
||||||
mesh_vertex_array = bobject.data.vertices
|
mesh_vertex_array = bobject.data.vertices
|
||||||
for ev in export_vertex_array:
|
for ev in export_vertex_array:
|
||||||
boneCount = 0
|
boneCount = 0
|
||||||
|
@ -1474,6 +1475,7 @@ class ArmoryExporter:
|
||||||
boneIndexArray.append(boneIndex)
|
boneIndexArray.append(boneIndex)
|
||||||
boneWeightArray.append(boneWeight)
|
boneWeightArray.append(boneWeight)
|
||||||
if boneCount == 4: # Four bones max - TODO: take biggest weights
|
if boneCount == 4: # Four bones max - TODO: take biggest weights
|
||||||
|
warn_bones = True
|
||||||
break
|
break
|
||||||
boneCountArray.append(boneCount)
|
boneCountArray.append(boneCount)
|
||||||
|
|
||||||
|
@ -1482,6 +1484,9 @@ class ArmoryExporter:
|
||||||
for i in range(-boneCount, 0):
|
for i in range(-boneCount, 0):
|
||||||
boneWeightArray[i] *= normalizer
|
boneWeightArray[i] *= normalizer
|
||||||
|
|
||||||
|
if warn_bones:
|
||||||
|
log.warn(bobject.name + ' - more than 4 bones influence single vertex')
|
||||||
|
|
||||||
# Write the bone count array. There is one entry per vertex.
|
# Write the bone count array. There is one entry per vertex.
|
||||||
oskin['bone_count_array'] = boneCountArray
|
oskin['bone_count_array'] = boneCountArray
|
||||||
|
|
||||||
|
|
|
@ -406,7 +406,7 @@ def on_compiled(mode): # build, play, play_viewport, publish
|
||||||
elif target_name == 'windows':
|
elif target_name == 'windows':
|
||||||
print('VisualStudio 2015 project files are located in ' + files_path + '-build')
|
print('VisualStudio 2015 project files are located in ' + files_path + '-build')
|
||||||
elif target_name == 'android-native':
|
elif target_name == 'android-native':
|
||||||
print('Android Studio project files are located in ' + files_path + '-build/' + wrd.arm_project_name)
|
print('Android Studio project files are located in ' + files_path + '-build/' + arm.utils.safefilename(wrd.arm_project_name))
|
||||||
else:
|
else:
|
||||||
print('Makefiles are located in ' + files_path + '-build')
|
print('Makefiles are located in ' + files_path + '-build')
|
||||||
return
|
return
|
||||||
|
|
|
@ -559,7 +559,7 @@ def init_properties_on_load():
|
||||||
wrd = bpy.data.worlds['Arm']
|
wrd = bpy.data.worlds['Arm']
|
||||||
|
|
||||||
# Outdated project
|
# Outdated project
|
||||||
if wrd.arm_version != arm_version:
|
if bpy.data.filepath != '' and wrd.arm_version != arm_version: # Call on project load only
|
||||||
print('Project updated to sdk v' + arm_version)
|
print('Project updated to sdk v' + arm_version)
|
||||||
wrd.arm_version = arm_version
|
wrd.arm_version = arm_version
|
||||||
arm.make.clean_project()
|
arm.make.clean_project()
|
||||||
|
|
|
@ -22,7 +22,7 @@ def write_khafilejs(is_play, export_physics, export_navigation, dce_full=False):
|
||||||
with open('khafile.js', 'w') as f:
|
with open('khafile.js', 'w') as f:
|
||||||
f.write(
|
f.write(
|
||||||
"""// Auto-generated
|
"""// Auto-generated
|
||||||
let project = new Project('""" + wrd.arm_project_name + """');
|
let project = new Project('""" + arm.utils.safefilename(wrd.arm_project_name) + """');
|
||||||
|
|
||||||
project.addSources('Sources');
|
project.addSources('Sources');
|
||||||
""")
|
""")
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
---
|
*(optional - drag & drop zipped .blend file here)*
|
||||||
optional - drag & drop .blend file here
|
|
||||||
|
|
Loading…
Reference in a new issue