Skip to content

Commit

Permalink
Update sector_import.py
Browse files Browse the repository at this point in the history
Some checks for keys before using them
  • Loading branch information
Simarilius-uk authored Nov 8, 2024
1 parent a4749d1 commit 5a0190f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions i_scene_cp77_gltf/importers/sector_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 )
importSectors( filepath, with_mats=True, want_collisions=False, am_modding=False )

0 comments on commit 5a0190f

Please sign in to comment.