Skip to content

Commit

Permalink
Add the sector export as a menu item. uses archivexl to delete stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
Simarilius-uk committed Jan 11, 2024
1 parent bfba781 commit 0ce00de
Show file tree
Hide file tree
Showing 2 changed files with 895 additions and 1 deletion.
17 changes: 16 additions & 1 deletion i_scene_cp77_gltf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from .importers.import_with_materials import *
from bpy_extras.io_utils import ExportHelper
from .exporters.glb_export import *
from .exporters.sectors_export import *
from .exporters.hp_export import *
from .exporters.collision_export import *
from .exporters.mlsetup_export import *
Expand Down Expand Up @@ -1103,7 +1104,19 @@ def draw(self, context):
row = self.layout.row(align = True)
row.alignment = 'EXPAND'
row.label(text=text)


class CP77StreamingSectorExport(Operator,ExportHelper):
bl_idname = "export_scene.cp77_sector"
bl_label = "Export Sector Updates for Cyberpunk"
bl_options = {'REGISTER','UNDO'}
bl_description = "Export changes to Sectors back to project"
filename_ext = ".cpmodproj"
filter_glob: StringProperty(default="*.cpmodproj", options={'HIDDEN'})

def execute(self, context):
exportSectors(self.filepath)
return {'FINISHED'}

class CP77GLBExport(Operator,ExportHelper):
### cleaned this up and moved most code to exporters.py
bl_idname = "export_scene.cp77_glb"
Expand Down Expand Up @@ -1363,13 +1376,15 @@ def menu_func_import(self, context):

def menu_func_export(self, context):
self.layout.operator(CP77GLBExport.bl_idname, text="Cyberpunk GLB", icon_value=custom_icon_col["import"]['WKIT'].icon_id)
self.layout.operator(CP77StreamingSectorExport.bl_idname, text="Cyberpunk StreamingSector", icon_value=custom_icon_col["import"]['WKIT'].icon_id)

#kwekmaster - Minor Refactoring
classes = (
CP77Import,
CP77EntityImport,
CP77_PT_ImportWithMaterial,
CP77StreamingSectorImport,
CP77StreamingSectorExport,
CP77GLBExport,
ShowMessageBox,
CP77_PT_AnimsPanel,
Expand Down
Loading

0 comments on commit 0ce00de

Please sign in to comment.