Fusion/ModelCopyForBlender.bat

41 lines
1.0 KiB
Batchfile

@echo off
setlocal enabledelayedexpansion
rem Get the path of the script
set "scriptPath=%~dp0"
rem Set the relative paths from the script location
set "sourceFolder=%scriptPath%\units"
set "outputFolder=%scriptPath%\output"
set "textureFolder=%scriptPath%\textures"
rem Check if folders exist, create them if necessary
if not exist "%sourceFolder%" (
mkdir "%sourceFolder%"
echo Created folder: %sourceFolder%
)
if not exist "%outputFolder%" (
mkdir "%outputFolder%"
echo Created folder: %outputFolder%
)
if not exist "%textureFolder%" (
mkdir "%textureFolder%"
echo Created folder: %textureFolder%
)
echo Step 1: Copy files
rem Step 1: Copy files
robocopy "%sourceFolder%" "%outputFolder%" *.gltf *.bin *.material_config *.object /S
echo Step 2: Copy .texture files
for /r "%sourceFolder%" %%i in (*.texture) do copy "%%i" "%textureFolder%"
echo Step 3: Rename .texture files to .dds
rem Step 3: Rename .texture files to .dds
for /r "%textureFolder%" %%i in (*.texture) do ren "%%i" *.dds
echo Script completed.
pause