From 6b8b1e349fc810471b1e8479a18454495cb8ab77 Mon Sep 17 00:00:00 2001 From: Yanis42 <35189056+Yanis42@users.noreply.github.com> Date: Wed, 10 Jan 2024 20:32:00 +0100 Subject: [PATCH 1/2] minor unused stuff cleanup --- __init__.py | 18 ------------------ fast64_internal/oot/collision/properties.py | 1 - .../oot/cutscene/motion/operators.py | 13 ------------- fast64_internal/oot/oot_collision.py | 6 ------ fast64_internal/oot/oot_level_classes.py | 3 --- fast64_internal/oot/oot_level_parser.py | 2 +- fast64_internal/oot/oot_model_classes.py | 11 ----------- fast64_internal/oot/room/properties.py | 7 ------- fast64_internal/oot/tools/quick_import.py | 2 +- 9 files changed, 2 insertions(+), 61 deletions(-) diff --git a/__init__.py b/__init__.py index a4ef80e71..dc57c59ba 100644 --- a/__init__.py +++ b/__init__.py @@ -177,23 +177,6 @@ def draw(self, context): col.box().label(text="Width/height must be < 1024. Must be png format.") -class Fast64_GlobalObjectPanel(bpy.types.Panel): - bl_label = "Global Object Inspector" - bl_idname = "OBJECT_PT_OOT_Global_Object_Inspector" - bl_space_type = "PROPERTIES" - bl_region_type = "WINDOW" - bl_context = "object" - bl_options = {"HIDE_HEADER"} - - @classmethod - def poll(cls, context): - return context.object is not None and context.object.type == "EMPTY" - - def draw(self, context): - box = self.layout - prop_split(box, context.scene, "gameEditorMode", "Game") - - class Fast64_GlobalSettingsPanel(bpy.types.Panel): bl_idname = "FAST64_PT_global_settings" bl_label = "Fast64 Global Settings" @@ -391,7 +374,6 @@ def draw(self, context): AddBoneGroups, CreateMetarig, SM64_AddWaterBox, - # Fast64_GlobalObjectPanel, F3D_GlobalSettingsPanel, Fast64_GlobalSettingsPanel, SM64_ArmatureToolsPanel, diff --git a/fast64_internal/oot/collision/properties.py b/fast64_internal/oot/collision/properties.py index 0ce5a54e2..19e1355b0 100644 --- a/fast64_internal/oot/collision/properties.py +++ b/fast64_internal/oot/collision/properties.py @@ -23,7 +23,6 @@ class OOTCollisionExportSettings(PropertyGroup): ) filename: StringProperty(name="Filename") exportPath: StringProperty(name="Directory", subtype="FILE_PATH") - exportLevel: EnumProperty(items=ootEnumSceneID, name="Level Used By Collision", default="SCENE_DEKU_TREE") includeChildren: BoolProperty(name="Include child objects", default=True) levelName: StringProperty(name="Name", default="SCENE_DEKU_TREE") customExport: BoolProperty( diff --git a/fast64_internal/oot/cutscene/motion/operators.py b/fast64_internal/oot/cutscene/motion/operators.py index ad9205a5f..d5d5668e7 100644 --- a/fast64_internal/oot/cutscene/motion/operators.py +++ b/fast64_internal/oot/cutscene/motion/operators.py @@ -20,19 +20,6 @@ ) -def getActorCueList(operator: Operator, context: Context) -> Object | None: - cueListObj = activeObj = context.view_layer.objects.active - - if activeObj.ootEmptyType == "CS Actor Cue" and activeObj.parent.ootEmptyType == "CS Actor Cue List": - cueListObj = activeObj.parent - - if not cueListObj.ootEmptyType == "CS Actor Cue List" and cueListObj.parent.ootEmptyType == "Cutscene": - operator.report({"WARNING"}, "Select an action list or action point.") - return None - - return cueListObj - - def createNewActorCueList(csObj: Object, isPlayer: bool): """Creates a new Actor or Player Cue List and adds one basic cue and the dummy one""" objFactory = CutsceneObjectFactory() diff --git a/fast64_internal/oot/oot_collision.py b/fast64_internal/oot/oot_collision.py index f8238ed46..3d1437ea3 100644 --- a/fast64_internal/oot/oot_collision.py +++ b/fast64_internal/oot/oot_collision.py @@ -21,12 +21,6 @@ ) -def drawCameraPosProperty(layout, cameraRefProp, index, headerIndex, objName): - camBox = layout.box().column() - prop_split(camBox, cameraRefProp, "camera", "Camera " + str(index)) - drawCollectionOps(camBox, index, "Camera Position", headerIndex, objName) - - # water boxes handled by level writer def exportCollisionCommon(collision, obj, transformMatrix, includeChildren, name): bpy.ops.object.select_all(action="DESELECT") diff --git a/fast64_internal/oot/oot_level_classes.py b/fast64_internal/oot/oot_level_classes.py index c6714fbab..cb3733ca1 100644 --- a/fast64_internal/oot/oot_level_classes.py +++ b/fast64_internal/oot/oot_level_classes.py @@ -383,9 +383,6 @@ def __init__(self, index, name, model, roomShape): self.showInvisibleActors = False self.linkIdleMode = None - self.customBehaviourX = None - self.customBehaviourY = None - # Wind self.setWind = False self.windVector = [0, 0, 0] diff --git a/fast64_internal/oot/oot_level_parser.py b/fast64_internal/oot/oot_level_parser.py index d43e2ffed..ea6653c5d 100644 --- a/fast64_internal/oot/oot_level_parser.py +++ b/fast64_internal/oot/oot_level_parser.py @@ -947,7 +947,7 @@ def parsePathList( pathData = getDataMatch(sceneData, pathListName, "Path", "path list") pathList = [value.replace("{", "").strip() for value in pathData.split("},") if value.strip() != ""] for pathEntry in pathList: - numPoints, pathName = [value.strip() for value in pathEntry.split(",")] + _, pathName = [value.strip() for value in pathEntry.split(",")] parsePath(sceneObj, sceneData, pathName, headerIndex, sharedSceneData) diff --git a/fast64_internal/oot/oot_model_classes.py b/fast64_internal/oot/oot_model_classes.py index 5d0b77869..716c30d61 100644 --- a/fast64_internal/oot/oot_model_classes.py +++ b/fast64_internal/oot/oot_model_classes.py @@ -300,12 +300,6 @@ def onAddMesh(self, fMesh, contextObj): fMesh.draw.commands.append(SPMatrix("0x01000000", "G_MTX_MODELVIEW | G_MTX_NOPUSH | G_MTX_MUL")) -class OOTDynamicMaterialDrawLayer: - def __init__(self, opaque, transparent): - self.opaque = opaque - self.transparent = transparent - - class OOTGfxFormatter(GfxFormatter): def __init__(self, scrollMethod): GfxFormatter.__init__(self, scrollMethod, 64, None) @@ -508,8 +502,3 @@ def clearOOTFlipbookProperty(flipbookProp): flipbookProp.name = "sFlipbookTextures" flipbookProp.exportMode = "Array" flipbookProp.textures.clear() - - -def clearOOTMaterialDrawLayerProperty(matDrawLayerProp): - for i in range(0x08, 0x0E): - setattr(matDrawLayerProp, "segment" + format(i, "X"), False) diff --git a/fast64_internal/oot/room/properties.py b/fast64_internal/oot/room/properties.py index 3ef126804..7af1e4628 100644 --- a/fast64_internal/oot/room/properties.py +++ b/fast64_internal/oot/room/properties.py @@ -104,13 +104,6 @@ class OOTRoomHeaderProperty(PropertyGroup): default=False, ) - useCustomBehaviourX: BoolProperty(name="Use Custom Behaviour X") - useCustomBehaviourY: BoolProperty(name="Use Custom Behaviour Y") - - customBehaviourX: StringProperty(name="Custom Behaviour X", default="0x00") - - customBehaviourY: StringProperty(name="Custom Behaviour Y", default="0x00") - setWind: BoolProperty(name="Set Wind") windVector: IntVectorProperty(name="Wind Vector", size=3, min=-127, max=127) windStrength: IntProperty(name="Wind Strength", min=0, max=255) diff --git a/fast64_internal/oot/tools/quick_import.py b/fast64_internal/oot/tools/quick_import.py index 4dcb772d0..f79ff48a9 100644 --- a/fast64_internal/oot/tools/quick_import.py +++ b/fast64_internal/oot/tools/quick_import.py @@ -40,7 +40,7 @@ def quick_import_exec(context: bpy.types.Context, sym_name: str): all_found_defs: dict[Path, list[tuple[str, str]]] = dict() - for dirpath, dirnames, filenames in os.walk(assets_objects_dir_p): + for dirpath, _, filenames in os.walk(assets_objects_dir_p): dirpath_p = Path(dirpath) for filename in filenames: file_p = dirpath_p / filename From e854f4f02a36aefcc928d4ca6bcb53ab0629b739 Mon Sep 17 00:00:00 2001 From: Yanis42 <35189056+Yanis42@users.noreply.github.com> Date: Mon, 22 Jan 2024 02:10:23 +0100 Subject: [PATCH 2/2] review --- fast64_internal/oot/oot_level_parser.py | 2 +- fast64_internal/oot/tools/quick_import.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fast64_internal/oot/oot_level_parser.py b/fast64_internal/oot/oot_level_parser.py index ea6653c5d..d43e2ffed 100644 --- a/fast64_internal/oot/oot_level_parser.py +++ b/fast64_internal/oot/oot_level_parser.py @@ -947,7 +947,7 @@ def parsePathList( pathData = getDataMatch(sceneData, pathListName, "Path", "path list") pathList = [value.replace("{", "").strip() for value in pathData.split("},") if value.strip() != ""] for pathEntry in pathList: - _, pathName = [value.strip() for value in pathEntry.split(",")] + numPoints, pathName = [value.strip() for value in pathEntry.split(",")] parsePath(sceneObj, sceneData, pathName, headerIndex, sharedSceneData) diff --git a/fast64_internal/oot/tools/quick_import.py b/fast64_internal/oot/tools/quick_import.py index f79ff48a9..4dcb772d0 100644 --- a/fast64_internal/oot/tools/quick_import.py +++ b/fast64_internal/oot/tools/quick_import.py @@ -40,7 +40,7 @@ def quick_import_exec(context: bpy.types.Context, sym_name: str): all_found_defs: dict[Path, list[tuple[str, str]]] = dict() - for dirpath, _, filenames in os.walk(assets_objects_dir_p): + for dirpath, dirnames, filenames in os.walk(assets_objects_dir_p): dirpath_p = Path(dirpath) for filename in filenames: file_p = dirpath_p / filename