Skip to content

Commit

Permalink
rename servoanim export to binary export
Browse files Browse the repository at this point in the history
  • Loading branch information
timhendriks93 committed Feb 2, 2024
1 parent 47290d2 commit d0c4a9c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions addon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .ui.menu_panel import MenuPanel
from .ops.json_export import JsonExport
from .ops.arduino_export import ArduinoExport
from .ops.servoanim_export import ServoanimExport
from .ops.binary_export import BinaryExport
from .ops.stop_live_mode import StopLiveMode
from .ops.install_dependencies import InstallDependencies
from .ops.start_live_mode import StartLiveMode
Expand All @@ -33,7 +33,7 @@
MenuPanel,
ArduinoExport,
JsonExport,
ServoanimExport,
BinaryExport,
StopLiveMode,
StartLiveMode,
InstallDependencies,
Expand All @@ -44,7 +44,7 @@
def menu_func_export(self, _):
self.layout.operator(ArduinoExport.bl_idname)
self.layout.operator(JsonExport.bl_idname)
self.layout.operator(ServoanimExport.bl_idname)
self.layout.operator(BinaryExport.bl_idname)


def menu_func_timeline(self, _):
Expand Down
12 changes: 6 additions & 6 deletions addon/ops/servoanim_export.py → addon/ops/binary_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
from .base_export import BaseExport


class ServoanimExport(Operator, BaseExport, ExportHelper):
bl_idname = "export_anim.servo_animation_servoanim"
bl_label = "Servo Animation (.servoanim)"
bl_description = "Save an SD card optimized file with servo position values of the active armature"
class BinaryExport(Operator, BaseExport, ExportHelper):
bl_idname = "export_anim.servo_animation_binary"
bl_label = "Servo Animation (.bin)"
bl_description = "Save a binary file with servo position values of the active armature"

filename_ext = ".servoanim"
filename_ext = ".bin"

filter_glob: bpy.props.StringProperty(
default="*.servoanim",
default="*.bin",
options={'HIDDEN'},
maxlen=255
)
Expand Down
4 changes: 2 additions & 2 deletions addon/ui/menu_panel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from bpy.types import Panel
from ..ops.json_export import JsonExport
from ..ops.arduino_export import ArduinoExport
from ..ops.servoanim_export import ServoanimExport
from ..ops.binary_export import BinaryExport
from ..ops.stop_live_mode import StopLiveMode
from ..ops.install_dependencies import InstallDependencies
from ..ops.start_live_mode import StartLiveMode
Expand Down Expand Up @@ -31,7 +31,7 @@ def draw(self, context):
col.label(text="Export")
col.operator(ArduinoExport.bl_idname, text="Arduino (.h)")
col.operator(JsonExport.bl_idname, text="JSON (.json)")
col.operator(ServoanimExport.bl_idname, text="Servoanim (.servoanim)")
col.operator(BinaryExport.bl_idname, text="Binary (.bin)")

@classmethod
def draw_live_mode(cls, context, layout, col):
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ def test_arduino_export(self, _name, skip_duplicates, namespace, expected):
("without skipping", False,
"11f06c27463865d5e6a4f014c515a01c1c0212c413d0434698908a562c13237f")
])
def test_servoanim_export(self, _name, skip_duplicates, expected):
export_file = self.output_dir + "/export.h"
def test_binary_export(self, _name, skip_duplicates, expected):
export_file = self.output_dir + "/export.bin"

bpy.ops.export_anim.servo_animation_servoanim(
bpy.ops.export_anim.servo_animation_binary(
filepath=export_file,
skip_duplicates=skip_duplicates
)
Expand All @@ -91,7 +91,7 @@ def test_servoanim_export(self, _name, skip_duplicates, expected):
@parameterized.expand([
("arduino", ".h"),
("json", ".json"),
("servoanim", ".servoanim")
("binary", ".bin")
])
def test_no_servo_settings(self, export_type, extension):
export_file = self.output_dir + "/export" + extension
Expand All @@ -106,8 +106,8 @@ def test_no_servo_settings(self, export_type, extension):
filepath=export_file)
elif export_type == "json":
bpy.ops.export_anim.servo_animation_json(filepath=export_file)
elif export_type == "servoanim":
bpy.ops.export_anim.servo_animation_servoanim(
elif export_type == "binary":
bpy.ops.export_anim.servo_animation_binary(
filepath=export_file)
except RuntimeError as error:
error_msg = str(error)
Expand Down

0 comments on commit d0c4a9c

Please sign in to comment.