Updated systems handling
This commit is contained in:
@@ -225,7 +225,7 @@ for mapping in [ExportMappingFemale(), ExportMappingMale(), ExportMappingMaleBab
|
||||
obj.name = obj.name + "-noimp"
|
||||
bpy.ops.wm.save_as_mainfile(filepath=(basepath + "/assets/blender/scripts/" + mapping.outfile))
|
||||
|
||||
bpy.ops.export_scene.gltf(filepath=mapping.gltf_path.replace(".npc", ".gltf"),
|
||||
bpy.ops.export_scene.gltf(filepath=mapping.gltf_path.replace(".npcshape", ".gltf").replace(".npc", ".gltf"),
|
||||
use_selection=False,
|
||||
check_existing=False,
|
||||
export_format='GLTF_SEPARATE',
|
||||
@@ -252,8 +252,8 @@ for mapping in [ExportMappingFemale(), ExportMappingMale(), ExportMappingMaleBab
|
||||
export_morph_normal=True,
|
||||
export_morph_tangent=True,
|
||||
export_lights=False,
|
||||
export_skins=False)
|
||||
shutil.move(mapping.gltf_path.replace(".npc", ".gltf"), mapping.gltf_path)
|
||||
export_skins=True)
|
||||
shutil.move(mapping.gltf_path.replace(".npcshape", ".gltf").replace(".npc", ".gltf"), mapping.gltf_path)
|
||||
|
||||
|
||||
bpy.ops.wm.read_homefile(use_empty=True)
|
||||
|
||||
@@ -17,6 +17,7 @@ if bpy.app.version[0] == 3:
|
||||
from mixamo import mixamo_rig
|
||||
from mixamo.lib.armature import *
|
||||
from settings import VRMDataFemale, VRMDataMale, VRMDataMaleBabyShape, basepath
|
||||
from geometry import tris2quads
|
||||
|
||||
imports = [VRMDataFemale(), VRMDataMale(), VRMDataMaleBabyShape()]
|
||||
|
||||
@@ -81,6 +82,9 @@ for imp in imports:
|
||||
result = bpy.ops.import_scene.vrm(filepath=(basepath + "/assets/vroid/" + imp.path))
|
||||
if result != {"FINISHED"}:
|
||||
raise Exception(f"Failed to import vrm: {result}")
|
||||
for o in bpy.data.objects:
|
||||
if o.type == 'MESH':
|
||||
tris2quads.tris2quads(o)
|
||||
armature_count = 0
|
||||
for obj in bpy.data.objects:
|
||||
if (obj.type == "ARMATURE"):
|
||||
|
||||
@@ -53,7 +53,7 @@ class ExportMappingMale:
|
||||
|
||||
class ExportMappingMaleBabyShape:
|
||||
blend_path = "assets/blender/shapes/male/" + "vrm-vroid-normal-male-chibi.blend"
|
||||
gltf_path = "godot/character-data/vroid-normal-male-chibi.npc"
|
||||
gltf_path = "godot/character-data/vroid-normal-male-chibi.npcshape"
|
||||
inner_path = "Object"
|
||||
objs = ["male", "Body", "Hair", "Face"]
|
||||
armature_name = "male"
|
||||
|
||||
Reference in New Issue
Block a user