backup befor new branch to test Blockbenh instead of regex renderer
This commit is contained in:
@@ -275,10 +275,29 @@ def read_models_manifest(path):
|
||||
for bone in geom.get('bones') or []:
|
||||
bone_count += 1
|
||||
cube_count += len(bone.get('cubes') or [])
|
||||
|
||||
entity = name.rsplit('/', 1)[-1]
|
||||
if entity.endswith('.geo.json'):
|
||||
entity = entity[:-len('.geo.json')]
|
||||
for suffix in ('.mf', '.fm', '.m', '.f', '.g'):
|
||||
if entity.endswith(suffix):
|
||||
entity = entity[:-len(suffix)]
|
||||
break
|
||||
|
||||
# A pack-provided full skin is the model's default texture when the
|
||||
# model has no per-bone textures of its own.
|
||||
default_texture = ''
|
||||
if not bone_textures and entity:
|
||||
for n in names:
|
||||
if n.endswith(f'/textures/entity/{entity}/{entity}.png') or n.endswith(f'/textures/entity/{entity}.png'):
|
||||
default_texture = n
|
||||
break
|
||||
models.append({
|
||||
'name': name.rsplit('/', 1)[-1],
|
||||
'member': name,
|
||||
'identifier': identifier,
|
||||
'entity': entity,
|
||||
'default_texture': default_texture,
|
||||
'bones': bone_count,
|
||||
'cubes': cube_count,
|
||||
'bone_textures': bone_textures,
|
||||
|
||||
Reference in New Issue
Block a user