Skip to content
SARDONYX edited this page Feb 17, 2024 · 50 revisions

DAR to OAR Converter(GUI & CLI) v0.6.0

Features

  • DAR to OAR conversion(CLI & GUI applications)
  • Implemented sub commands (Remove OAR dir, Unhide DAR files)
  • Mapping table complements OAR's readability on GUI
  • Localization system(Could be customized)
  • Could edit JavaScript & CSS

Getting Started for User

Explanation of the type of distribution

  • Windows: g_dar2oar_{VERSON}_x64_en-US.msi or g_dar2oar_{VERSON}_x64-setup.exe

  • IntelMacOS: g_dar2oar_{VERSION}_x64.dmg (Arm version requires manual build)

  • LInux: g-dar2oar_{VERSION}_amd64.AppImage or g-dar2oar_{VERSION}_amd64.deb

  • What is the one marked DAR_to_OAR_Converter-{OS_NAME}-Portable.zip?

    It is a compressed file that contains the GUI and CLI, it is not an installer, so it does not automatically install the dependent libraries needed to start the GUI.

GUI

Getting started

  1. Download the latest binary from Nexus or GitHub

  2. Click g_dar2oar.exe(on Windows)

convert-page-with-javascript

How to customize our translations

There are 2 methods.

  1. Write and import Json(See the following sample.)
  1. Write and execute JavaScript within the editor.(See the following sample.)

CLI

It is suitable for those who automate by executing commands without using the mouse and do not want to create extra configuration files.

  1. Download the latest binary from GitHub
  2. Use Command

Conversion sample of one mod

./dar2oar convert "./test/data/UNDERDOG Animations" --mapping-file "./test/mapping_tables/UnderDog Animations_v1.9.6_mapping_table.txt" --run-parallel --stdout

Conversion sample of multiple mods

<# Example dir status
D:/Programming/rust/dar-to-oar
  ├─── test
  │     └─── data
  │           ├─── Modern Female Sitting Animations Overhaul
  │           └─── UNDERDOG Animations
  └─── logs

D:/Programming/rust/dar-to-oar/target/release
  └─── dar2oar.exe
#>

$base_dir = "D:/Programming/rust/dar-to-oar" # Convert target base directory
$bin_dir = "D:/Programming/rust/dar-to-oar/target/release" # Directory with dar2oar.exe
$mod_directory = "base_dir/test/data/" # Root mod directory. 

if (!$(Get-Command dar2oar -ErrorAction SilentlyContinue)) {
  # Temporarily pass through to access without specifying an absolute path.
  $env:Path += ";$bin_dir"
}

# Create log dir if it doesn't exist.
if (!$(Test-Path "$base_dir/logs")) {
  New-Item -ItemType Directory "$base_dir/logs"
}


function Convert-Mods($base, $mods_dir, $log_level) {
  Get-ChildItem $mods_dir -Directory |
  ForEach-Object {
    # The following values are expected for `$_.FullName`.
    # - D:/Programming/rust/dar-to-oar/test/data/Modern Female Sitting Animations Overhaul
    # - D:/Programming/rust/dar-to-oar/test/data/UNDERDOG Animations

    # The following values are expected for `$_.Name`.
    # - Modern Female Sitting Animations Overhaul
    # - UNDERDOG Animations
    dar2oar convert $_.FullName `
      --run-parallel `
      --stdout `
      --log-level $log_level `
      --log-path "$base_dir/logs/convert-$($_.Name).log"
    Write-Host ""
  }
}

function Show-Dar($base, $mods_dir, $log_level) {
  Get-ChildItem $mods_dir -Directory |
  ForEach-Object {
    dar2oar unhide-dar $_.FullName `
      --stdout `
      --log-level $log_level `
      --log-path "$base_dir/logs/convert-$($_.Name).log"
    Write-Host ""
  }
}

function Remove-Oar($base, $mods_dir, $log_level) {
  Get-ChildItem $mods_dir -Directory |
  ForEach-Object {
    dar2oar remove-oar $_.FullName `
      --stdout `
      --log-level $log_level `
      --log-path "$base_dir/logs/convert-$($_.Name).log"
    Write-Host ""
  }
}

function Get-Help() {
  dar2oar --help
  dar2oar --help
  dar2oar convert --help
  dar2oar remove-oar --help
  dar2oar unhide-dar --help
}

# Convert-Mods $base_dir $mod_directory "debug"
# Remove-Oar  $base_dir $mod_directory "debug"
# Show-Dar $base_dir $mod_directory "debug"
Get-Help

CLI Help

  • All
dar2oar 0.6.0
DAR to OAR Converter CLI

USAGE:
    dar2oar.exe <SUBCOMMAND>

OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information

SUBCOMMANDS:
    convert       Convert DAR to OAR
    help          Print this message or the help of the given subcommand(s)
    remove-oar    Find and delete `OpenAnimationReplacer` directory
    unhide-dar    Unhide all files in the `DynamicAnimationReplacer` directory by removing the
                      `mohidden` extension
  • Convert
dar2oar.exe-convert
Convert DAR to OAR

USAGE:
    dar2oar.exe convert [OPTIONS] <SOURCE>

ARGS:
    <SOURCE>
            Path containing the "DynamicAnimationReplacer" directory

OPTIONS:
        --author <AUTHOR>
            Mod author in config.json

        --destination <DESTINATION>
            "OpenAnimationReplacer" directory output destination (if none, inferred from DAR path)

    -h, --help
            Print help information

        --hide-dar
            After conversion, add ".mohidden" to all DAR files to hide them(For MO2 user)

        --log-level <LOG_LEVEL>
            Log level

            trace | debug | info | warn | error

            [default: error]

        --log-path <LOG_PATH>
            Output path of log file

            [default: ./convert.log]

        --mapping-1person-file <MAPPING_1PERSON_FILE>
            Path to section name table(For _1st_person)

        --mapping-file <MAPPING_FILE>
            Path to section name table

            - See more details
            https://github.com/SARDONYX-sard/dar-to-oar/wiki#what-is-the-mapping-file

        --name <NAME>
            Mod name in config.json & directory name (if none, inferred from DAR path)

        --run-parallel
            Use multi thread

            [Note] More than twice the processing speed can be expected, but the concurrent
            processing results in thread termination timings being out of order, so log writes will
            be out of order as well, greatly reducing readability of the logs.

        --stdout
            Log output to standard output as well
  • Remove OAR
dar2oar.exe-remove-oar
Find and delete `OpenAnimationReplacer` directory

USAGE:
    dar2oar.exe remove-oar [OPTIONS] <TARGET_PATH>

ARGS:
    <TARGET_PATH>
            Path containing the "OpenAnimationReplacer" directory

OPTIONS:
    -h, --help
            Print help information

        --log-level <LOG_LEVEL>
            Log level

            trace | debug | info | warn | error

            [default: error]

        --log-path <LOG_PATH>
            Output path of log file

            [default: ./convert.log]

        --stdout
            Log output to stdout as well
  • Unhide DAR
dar2oar.exe-unhide-dar
Unhide all files in the `DynamicAnimationReplacer` directory by removing the `mohidden` extension

USAGE:
    dar2oar.exe unhide-dar [OPTIONS] <DAR_DIR>

ARGS:
    <DAR_DIR>
            DAR directory containing files with ".mohidden" extension

OPTIONS:
    -h, --help
            Print help information

        --log-level <LOG_LEVEL>
            Log level

            trace | debug | info | warn | error

            [default: error]

        --log-path <LOG_PATH>
            Output path of log file

            [default: ./convert.log]

        --stdout
            Log output to stdout as well

What is the mapping file?

DAR priority direcotry name -> A specific name

Sample is here

1 It is interpreted as follows

Sample

  • mapping_table.txt
8000000  Combat
8000001
8000002
// This is a line comment. It is ignored until a line break comes, so you can freely write notes.
8000005  Female
8001000  Unarmed
8001010  Sword
// To be continued below...

2 Parse to...

(As you can see, if there is no corresponding priority folder name, a sequential number will be added at the end.)

8000000  Combat
8000001  Combat_1
8000002  Combat_2
8000005  Female
8001000  Unarmed
8001010  Sword
// To be continued below...

3.1. Convert Result(Mapping table specified)

Smooth Moveset
    ├─1hm
    ├─2hm
    ├─Axe
    │  └─XPMSE
    ├─Axe+Shield
    │  └─XPMSE
    ├─Axe,
    ├─Base
    ├─Claw
    │  └─XPMSE
    ├─Claw+shield
    │  └─XPMSE
    ├─Dagger
    │  └─XPMSE
    ├─Dagger+Shield
    │  └─XPMSE
    ├─Dual
    │  └─XPMSE
    ├─Dual_1
    │  └─XPMSE
    ├─Dual_2
    ├─Female
    ├─Giant
    ├─Giant_1
    ├─Halberd
    ├─Hammer,
    ├─Javelin
    ├─Javelin+Shield
    ├─Katana
    │  └─XPMSE
    ├─LargeShield
    ├─Mace
    │  └─XPMSE
    ├─Mace+Shield
    │  └─XPMSE
    ├─Non_1
    ├─Non_2
    ├─Pike
    ├─Pike,
    ├─Pike,_1
    ├─Pike_1
    ├─QuarterStaff
    ├─QuarterStaff_1
    ├─Rapier
    │  └─XPMSE
    ├─Rapier+shield
    │  └─XPMSE
    ├─Scythe
    ├─Spear
    ├─Spear+Shield
    │  └─XPMSE
    ├─Spear+Shield_1
    ├─Sword
    │  └─XPMSE
    ├─Sword+Shield
    │  └─XPMSE
    ├─Sword+Shield_1
    │  └─XPMSE
    ├─Sword+Shield_2
    ├─Sword_1
    │  └─XPMSE
    ├─Sword_2
    ├─Unarmed
    ├─Unarmed_1
    │  └─XPMSE
    └─Unarmed_2

3.2 Convert Result(Mapping table isn't specified) => The name of the priority folder is used.

└─Smooth Moveset
    ├─8000001
    ├─8000005
    ├─8001000
    ├─8001010
    │  └─XPMSE
    ├─8001020
    │  └─XPMSE
    ├─8001040
    │  └─XPMSE
    ├─8001041
    ├─8001050
    │  └─XPMSE
    ├─8001055
    │  └─XPMSE
    ├─8001060
    ..........
    ├─8003010
    │  └─XPMSE
    └─8213000

For Developer

If you fork and use GitHub CI

  1. Only a GitHub account is required.
  2. Manually running a workflow. See this

Build on your own PC

  1. Requirements

Development: Binary generation is fast, but not very optimized

Release: Binary generation is slow, but execution is fast and binary size is small.

  1. Execute build commands

GUI

  • Development mode

SSR rendered and can be built by reloading with reloading.
Note that this is not a single application, as it depends on an external directory called out directory in this state.

npm run dev
  • Release mode
npm run build

CLI

  • Development mode and show help

    The first -- is a statement that it is an option for dar2.oar.exe, not for cargo run.

cargo run -- --help
  • Release mode
cargo build --release

Used as a static link library

If you can use Rust, you can easily incorporate my code into your software as a library. More information can be found in the following documents.

Acknowledgements and Credits

Thanks to everyone for their help!

Without the source code of the original application (DAR to OAR Converter) made in C# and the bug report submitted by Nexus, this Rust converter could not have been created.

Licenses

DAR to OAR(This application): MIT OR Apache-2.0 Copyright (c) 2023 SARDONYX

DAR to OAR Converter v1.0.8(C# Original Application): MIT License Copyright (c) 2023 Allison Payne

Clone this wiki locally