Skip to content

Commit

Permalink
change black lint to make sure im actually formatting stuff right
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilaa3 committed Apr 7, 2024
1 parent dbbc73f commit cc92ce6
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/black-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
- uses: psf/black@23.12.1
13 changes: 5 additions & 8 deletions fast64_internal/sm64/animation/classes.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
from collections import OrderedDict
import dataclasses
from io import StringIO
import os
from typing import Optional
import dataclasses
import os

from ..sm64_utility import SM64_ShortArray

from .c_parser import CParser, Initialization

from ...utility import PluginError, decodeSegmentedAddr, is_bit_active
from ..sm64_constants import MAX_U16

from ..sm64_utility import SM64_ShortArray
from .utility import RomReading, eval_num_from_str
from ...utility import PluginError, decodeSegmentedAddr, is_bit_active
from .c_parser import CParser, Initialization


@dataclasses.dataclass
Expand Down
5 changes: 3 additions & 2 deletions fast64_internal/sm64/animation/exporting.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import os

import bpy
import mathutils

from ..sm64_utility import radian_to_sm64_degree
from ..sm64_constants import NULL
from ...utility import (
writeIfNotFound,
writeInsertableFile,
)
from ..sm64_utility import radian_to_sm64_degree
from ..sm64_constants import NULL

from .classes import SM64_Anim, SM64_AnimPair
from .utility import anim_name_to_enum, get_anim_pose_bones
Expand Down
4 changes: 2 additions & 2 deletions fast64_internal/sm64/animation/importing.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from collections import OrderedDict
import math
import os
from typing import Optional
from io import BufferedReader
import math
import os
import dataclasses

import bpy
Expand Down
23 changes: 13 additions & 10 deletions fast64_internal/sm64/animation/operators.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import math
import os

import bpy
from bpy.utils import register_class, unregister_class
from bpy.types import Context, Object, Scene, Operator
Expand All @@ -13,6 +14,7 @@
from ...utility import (
PluginError,
applyBasicTweaks,
copyPropertyGroup,
filepath_checks,
toAlnum,
raisePluginError,
Expand All @@ -21,7 +23,6 @@
writeInsertableFile,
)
from ...utility_anim import stashActionInArmature

from ..sm64_utility import import_rom_checks
from ..sm64_level_parser import parseLevelAtPointer
from ..sm64_constants import level_pointers
Expand Down Expand Up @@ -197,22 +198,24 @@ def execute_operator(self, context):
variants.move(self.array_index, self.array_index + 1)
elif self.type == "ADD":
variants.add()
added_variant = variants[-1]
added_variant.action = action

copyPropertyGroup(action_props.headers[self.array_index + 1], added_variant)

variants.move(len(variants) - 1, self.array_index + 1)
action_props.update_header_variant_numbers()

added_variant.expand_tab = True
added_variant.custom_name = added_variant.get_anim_name(
context.scene.fast64.sm64.anim_export.actor_name, action
)
elif self.type == "REMOVE":
variants.remove(self.array_index)
if self.type == "CLEAR":
for _ in range(len(variants)):
variants.remove(0)

if self.type == "ADD":
variants[-1].action = action
array_index = self.array_index
if len(variants) > 1:
array_index += 1
variants[-1].copyHeader(
context.scene.fast64.sm64.anim_export.actor_name, action, action_props.headers[array_index]
)

action_props.update_header_variant_numbers()

return {"FINISHED"}
Expand Down
15 changes: 9 additions & 6 deletions fast64_internal/sm64/animation/panels.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import bpy
from bpy.utils import register_class, unregister_class
from bpy.path import abspath
from bpy.types import Context

from ...panels import SM64_Panel
from ...utility import multilineLabel

from ..sm64_utility import import_rom_checks


Expand All @@ -13,7 +13,7 @@ class SM64_ExportAnimPanel(SM64_Panel):
bl_label = "SM64 Animation Exporting"
goal = "Export Object/Actor/Anim"

def draw(self, context: bpy.types.Context):
def draw(self, context: Context):
context.scene.fast64.sm64.anim_export.draw_props(self.layout.column(), context.scene.fast64.sm64.export_type)


Expand All @@ -23,7 +23,7 @@ class SM64_ImportAnimPanel(SM64_Panel):
goal = "Import"
isImport = True

def draw(self, context: bpy.types.Context):
def draw(self, context: Context):
col = self.layout.column()

sm64_props = context.scene.fast64.sm64
Expand All @@ -32,14 +32,17 @@ def draw(self, context: bpy.types.Context):
try:
if sm64_props.anim_import.import_type == "Binary":
import_rom_checks(abspath(sm64_props.import_rom))
except Exception as e:
multilineLabel(self.layout.box(), str(e), "ERROR")
except Exception as exc:
multilineLabel(self.layout.box(), str(exc), "ERROR")
binary_col_enabled = False

sm64_props.anim_import.draw_props(col, binary_col_enabled)


sm64_anim_panels = [SM64_ExportAnimPanel, SM64_ImportAnimPanel]
sm64_anim_panels = (
SM64_ExportAnimPanel,
SM64_ImportAnimPanel,
)


def sm64_anim_panel_register():
Expand Down
Loading

0 comments on commit cc92ce6

Please sign in to comment.