# HG changeset patch # User Sam # Date 1701617218 -25200 # Node ID 405bb1fb52b89427ed16f04ed340d531edc7f798 # Parent cbd59b758ef63cca2bb71dd47032b772a7235eb9 add: import-helpers for nimscripts diff -r cbd59b758ef6 -r 405bb1fb52b8 semicongine/build.nim --- a/semicongine/build.nim Sun Dec 03 01:48:55 2023 +0700 +++ b/semicongine/build.nim Sun Dec 03 22:26:58 2023 +0700 @@ -1,6 +1,8 @@ import std/strformat import std/os +import ./core/audiotypes + proc semicongine_build*(buildname: string, bundleType: string, resourceRoot: string, builddir="./build"): string = switch("experimental", "strictEffects") switch("experimental", "strictFuncs") @@ -40,3 +42,11 @@ exec &"powershell Compress-Archive * {outputfile}" cd(oldcwd) return outdir + +proc semicongine_import_mesh*(blender_file: string, output_file: string) = + assert blender_file.fileExists + let converter_script = currentSourcePath.parentDir().parentDir().joinPath("scripts/blender_gltf_converter.py") + exec &"blender --background --python {converter_script} -- {blender_file} {output_file}" + +proc semicongine_import_audio*(in_file: string, output_file: string) = + exec &"ffmpeg -i {in_file} -ar {AUDIO_SAMPLE_RATE} {output_file}"