From 5a0190f9595c776ea0283479d24617d8c0ed9bc9 Mon Sep 17 00:00:00 2001 From: Simarilius-uk Date: Fri, 8 Nov 2024 16:17:24 +0000 Subject: [PATCH] Update sector_import.py Some checks for keys before using them --- i_scene_cp77_gltf/importers/sector_import.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/i_scene_cp77_gltf/importers/sector_import.py b/i_scene_cp77_gltf/importers/sector_import.py index 4975e66..2da9679 100644 --- a/i_scene_cp77_gltf/importers/sector_import.py +++ b/i_scene_cp77_gltf/importers/sector_import.py @@ -1021,12 +1021,15 @@ def importSectors( filepath, with_mats, remap_depot, want_collisions, am_modding new['pivot']=inst['Pivot'] new['meshAppearance']=meshAppearance new['appearanceName']=meshAppearance - if ntype=='worldClothMeshNode': + if ntype=='worldClothMeshNode' and "windImpulseEnabled" in inst.keys(): new['windImpulseEnabled']= inst['windImpulseEnabled'] if ntype=='worldRotatingMeshNode': - new['rot_axis']=data['rotationAxis'] - new['reverseDirection']=data['reverseDirection'] - new['fullRotationTime']=data['fullRotationTime'] + if 'rotationAxis' in data.keys(): + new['rot_axis']=data['rotationAxis'] + if 'reverseDirection' in data.keys(): + new['reverseDirection']=data['reverseDirection'] + if 'fullRotationTime' in data.keys(): + new['fullRotationTime']=data['fullRotationTime'] #print(new['nodeDataIndex']) # Should do something with the Advertisements lightData bits here @@ -1404,4 +1407,4 @@ def importSectors( filepath, with_mats, remap_depot, want_collisions, am_modding filepath = 'F:\\CPMod\\judysApt\\judysApt.cpmodproj' - importSectors( filepath, with_mats=True, want_collisions=False, am_modding=False ) \ No newline at end of file + importSectors( filepath, with_mats=True, want_collisions=False, am_modding=False )