Skip to content

Commit

Permalink
Merge pull request #167 from DoctorPresto/main
Browse files Browse the repository at this point in the history
fix vert colour presets, more jsontool loading, ui updates
  • Loading branch information
DoctorPresto authored Jul 24, 2024
2 parents 16dc4c8 + 1937170 commit 9b2a63f
Show file tree
Hide file tree
Showing 24 changed files with 569 additions and 400 deletions.
7 changes: 4 additions & 3 deletions i_scene_cp77_gltf/cyber_prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,20 @@ class CP77IOSuitePreferences(AddonPreferences):
def draw(self, context):
layout = self.layout
box = layout.box()

row = box.row()
row.prop(self, "show_modtools",toggle=1)
row.prop(self, "experimental_features",toggle=1)
row.prop(self, "non_verbose",toggle=1)
if self.experimental_features:
box = layout.box()
box.label(text="Material Depot Path:")
row = box.row()
row.prop(self, "depotfolder_path")
row.prop(self, "depotfolder_path", text="")
row = box.row()
if self.show_modtools:
row.alignment = 'LEFT'
box = layout.box()
box.label(text="Mod Tools Properties")
box.label(text="Mod Tools Preferences")
split = row.split(factor=0.5,align=True)
col = split.column(align=True)
row.alignment = 'LEFT'
Expand Down
21 changes: 18 additions & 3 deletions i_scene_cp77_gltf/cyber_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from bpy.props import (StringProperty, EnumProperty, BoolProperty, CollectionProperty, FloatProperty, IntProperty, PointerProperty)
from .main.physmat_lib import physmat_list
#from . meshtools import (CP77CollectionList)
from .main.common import get_classes, get_rig_dir, get_refit_dir, get_resources_dir
from .main.common import get_classes, get_rig_dir, get_refit_dir, get_resources_dir, update_presets_items
import sys

resources_dir = get_resources_dir()
Expand All @@ -15,6 +15,7 @@


def CP77RefitList(context):

target_addon_paths = [None]
target_addon_names = ['None']

Expand All @@ -41,6 +42,8 @@ def CP77RefitList(context):
# Return the list of tuples
return target_body_paths, target_body_names

#def VertColourPresetList


def SetCyclesRenderer(use_cycles=True, set_gi_params=False):
# set the render engine for all scenes to Cycles
Expand Down Expand Up @@ -101,6 +104,7 @@ def CP77ArmatureList(self, context):
print(f"Error accessing bpy.data.objects: {e}")
arms = []
return arms


class CP77_PT_PanelProps(PropertyGroup):
# collision panel props:
Expand All @@ -113,7 +117,12 @@ class CP77_PT_PanelProps(PropertyGroup):
],
default='VEHICLE'
)


vertex_color_presets: EnumProperty(
name="Vertex Color Preset",
items=lambda self, context: update_presets_items() or [(name, name, "") for name in get_colour_presets().keys()]
)

physics_material: EnumProperty(
items= enum_items,
name="Physics Material",
Expand Down Expand Up @@ -248,6 +257,12 @@ class CP77_PT_PanelProps(PropertyGroup):
name="With Materials",
default=True,
description="Import Wolvenkit-exported materials"
)

axl_yaml: BoolProperty(
name="Use YAML instead of JSON",
default=False,
description="Use the ArchiveXL YAML format instead of JSON format for generated .xl files"
)

def add_anim_props(animation, action):
Expand Down Expand Up @@ -295,7 +310,7 @@ def register_props():
for cls in other_classes:
bpy.utils.register_class(cls)
Scene.cp77_panel_props = PointerProperty(type=CP77_PT_PanelProps)

update_presets_items()

def unregister_props():
for cls in reversed(other_classes):
Expand Down
8 changes: 7 additions & 1 deletion i_scene_cp77_gltf/exporters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ class CP77StreamingSectorExport(Operator,ExportHelper):
bl_description = "Export changes to Sectors back to project"
filename_ext = ".cpmodproj"
filter_glob: StringProperty(default="*.cpmodproj", options={'HIDDEN'})

def draw(self, context):
props = context.scene.cp77_panel_props
layout = self.layout
layout.prop(props, "axl_yaml")

def execute(self, context):
exportSectors(self.filepath)
use_yaml = context.scene.cp77_panel_props.axl_yaml
exportSectors(self.filepath, use_yaml)
return {'FINISHED'}


Expand Down
Loading

0 comments on commit 9b2a63f

Please sign in to comment.