Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix vert colour presets, more jsontool loading, ui updates #167

Merged
merged 26 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5d5da3a
check os before trying dep install
DoctorPresto Jul 22, 2024
d893d52
add bool for attempting pyyaml install
DoctorPresto Jul 22, 2024
a144bc8
update logging style for sector import
DoctorPresto Jul 22, 2024
1aa6f76
update animtools poll functions
DoctorPresto Jul 22, 2024
9330ed4
add matrix conversions to bartmoss
DoctorPresto Jul 22, 2024
e0d0789
add timing and print statements to phys import
DoctorPresto Jul 22, 2024
d034e20
Revert "update animtools poll functions"
DoctorPresto Jul 22, 2024
0a9a150
armature retarget changes parent and collection
DoctorPresto Jul 22, 2024
c2422b4
refactor glb export to separate anims and mesh export functions
DoctorPresto Jul 22, 2024
95ad06e
rotate now works properly
DoctorPresto Jul 22, 2024
78dfa22
remove whitespace
DoctorPresto Jul 22, 2024
1364cec
fix vert colour functions
DoctorPresto Jul 22, 2024
ad8276d
remove whitespace
DoctorPresto Jul 22, 2024
be1dcab
add missing json types
DoctorPresto Jul 22, 2024
443ba2b
sector import jsontool usage
DoctorPresto Jul 22, 2024
c8405c9
improve preferences ui
DoctorPresto Jul 22, 2024
c9fb49f
phys import using jsontool
DoctorPresto Jul 22, 2024
889e5bb
update wkit version in template jsons
DoctorPresto Jul 22, 2024
4747678
handle cases where nothing is selected in meshtools functions
DoctorPresto Jul 22, 2024
4d70782
process gradient.json files
DoctorPresto Jul 22, 2024
4833ce5
use jsontool for sector export
DoctorPresto Jul 22, 2024
d8a553a
use jsontool for materials
DoctorPresto Jul 22, 2024
de46913
minor meshtools updates
DoctorPresto Jul 22, 2024
6f06454
add shapekey functions
DoctorPresto Jul 22, 2024
e798c52
more shapekey funcs
DoctorPresto Jul 22, 2024
1937170
automatically apply refitter, preserving garment support
DoctorPresto Jul 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading