Skip to content

Commit

Permalink
Merge pull request #172 from Simarilius-uk/OS_support
Browse files Browse the repository at this point in the history
Object Spawner support
  • Loading branch information
Simarilius-uk authored Sep 2, 2024
2 parents 503e1d7 + c7577c6 commit 382ba05
Show file tree
Hide file tree
Showing 6 changed files with 804 additions and 13 deletions.
1 change: 0 additions & 1 deletion i_scene_cp77_gltf/importers/entity_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ def importEnt(with_materials, filepath='', appearances=[], exclude_meshes=[], in
app_name=a['appearanceName']['$value']

if ent_app_idx<0 and app_name =='default':
#ent_default=j['Data']['RootChunk']['defaultAppearance']['$value']
for i,a in enumerate(ent_apps):
if a['name']['$value']==ent_default:
print('appearance matched, id = ',i)
Expand Down
8 changes: 6 additions & 2 deletions i_scene_cp77_gltf/importers/import_with_materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def CP77GLBimport(self, with_materials, remap_depot, exclude_unused_mats=True, i
# obj = None
start_time = time.time()
loadfiles=self.files
DepotPath=cp77_addon_prefs
appearances=self.appearances.split(",")
if not cp77_addon_prefs.non_verbose:
if ".anims.glb" in self.filepath:
Expand Down Expand Up @@ -138,15 +139,17 @@ def CP77GLBimport(self, with_materials, remap_depot, exclude_unused_mats=True, i
#Kwek: Gate this--do the block iff corresponding Material.json exist
#Kwek: was tempted to do a try-catch, but that is just La-Z
#Kwek: Added another gate for materials
DepotPath=None
blender_4_scale_armature_bones()
if ".anims.glb" in filepath:
break
else:
if with_materials==True and has_material_json:
matjsonpath = current_file_base_path + ".Material.json"
DepotPath, json_apps, mats = jsonload(matjsonpath)
if DepotPath == None:
break
if DepotPath == None:
break

#DepotPath = str(obj["MaterialRepo"]) + "\\"
context=bpy.context
if remap_depot and os.path.exists(context.preferences.addons[__name__.split('.')[0]].preferences.depotfolder_path):
Expand Down Expand Up @@ -182,6 +185,7 @@ def CP77GLBimport(self, with_materials, remap_depot, exclude_unused_mats=True, i

if import_garmentsupport:
manage_garment_support(existingMeshes, gltf_importer)


if not cp77_addon_prefs.non_verbose:
print(f"GLB Import Time: {(time.time() - start_time)} Seconds")
Expand Down
Loading

0 comments on commit 382ba05

Please sign in to comment.