diff --git a/7_Double_Click_Me_To_Create_Binarys_from_input_to_output_with_excluded_files.bat b/7_Double_Click_Me_To_Create_Binarys_from_input_to_output_with_excluded_files.bat new file mode 100644 index 0000000..6741cc5 --- /dev/null +++ b/7_Double_Click_Me_To_Create_Binarys_from_input_to_output_with_excluded_files.bat @@ -0,0 +1,136 @@ +@echo off + +@REM %~dp0: Breaks down as follows: +@REM %~d0: Extracts the drive letter from %0. +@REM %~p0: Extracts the path (directory) from %0. +@REM Combining the above two (%~d0 and %~p0) gives the drive and path of the batch file. + +REM this is getting the path where the bat file is. +cd /D "%~dp0" + +@REM REM this is getting the parent path fro where the bat file is. +@REM cd /D "%~dp0.." + +set PATH=%PATH%;%SystemRoot%\system32 + +echo "%CD%"| findstr /C:" " >nul && echo This script relies on Miniconda which can not be silently installed under a path with spaces. && goto end + +@rem fix failed install when installing to a separate drive +set TMP=%cd%\dev_env +set TEMP=%cd%\dev_env + +@rem deactivate existing conda envs as needed to avoid conflicts +(call conda deactivate && call conda deactivate && call conda deactivate) 2>nul + +@rem config +set CONDA_ROOT_PREFIX=%cd%\dev_env\conda +set INSTALL_ENV_DIR=%cd%\dev_env\env +@REM set "inputFolder=C:\Path\to\inputFolder" +@REM set "outputFolder=C:\Path\to\outputFolder" +set input=%cd%\input +set output=%cd%\output +REM copy from input to output folder +xcopy "%input%\*" "%output%\" /s /e + + + +@rem activate installer env +call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" || ( echo. && echo Miniconda hook not found. && goto end ) + +call python -m compileall -b -f %output% + + +@REM rem Generate .pyc files for existing .py files +@REM for %%f in ("%output%\*.py") do ( +@REM python -m compileall "%%f" +@REM ) + +@REM rem Delete all .py files inside the output folder +@REM del "%outputFolder%\*.py" + + + +@REM rem Delete all .py files inside the output folder and its subfolders +@REM for /R "%output%" %%f in (*.py) do ( +@REM del "%%f" +@REM ) + +REM put here the python files you dont want to delete. +set "excluded_files=__Init__.py MoResive004.py" + +for /R "%output%" %%f in (*.py) do ( + set "exclude_file=" + for %%x in (%excluded_files%) do ( + if /I "%%~nxf" == "%%~x" set "exclude_file=1" + ) + if not defined exclude_file ( + del "%%f" + ) +) + + + + +echo All operations completed successfully. +pause + + + + +@echo off +set "output=C:\Path\to\Output\Folder" +set "excluded_files=exclude1.py exclude2.py" + +for /R "%output%" %%f in (*.py) do ( + set "exclude_file=" + for %%x in (%excluded_files%) do ( + if /I "%%~nxf" == "%%~x" set "exclude_file=1" + ) + if not defined exclude_file ( + del "%%f" + ) +) + + + + + + + + + + + + + + + + + +REM Using build in compiler to compile all python files. +@REM call python -m compileall -b -f . +REM comileall -l means not recursive that means it only compiles the files +REM that are inside the . folder it ignores sub folders +@REM call python -m compileall -b -f -l . +@REM call python -m compileall -b -f -l BackendCoreClassLib\InBlenderRunningLib + + + + +@REM @echo off +@REM set "inputFolder=C:\Path\to\inputFolder" +@REM set "outputFolder=C:\Path\to\outputFolder" + +@REM rem Copy all files from input folder to output folder +@REM xcopy "%inputFolder%\*" "%outputFolder%\" /s /e + +@REM rem Generate .pyc files for existing .py files +@REM for %%f in ("%outputFolder%\*.py") do ( +@REM python -m compileall "%%f" +@REM ) + +@REM rem Delete all .py files inside the output folder +@REM del "%outputFolder%\*.py" + +@REM echo All operations completed successfully. +@REM pause diff --git a/8_Double_Click_Me_To_Create_Binarys_from_input_to_output_with_excluded_files_from_txt.bat b/8_Double_Click_Me_To_Create_Binarys_from_input_to_output_with_excluded_files_from_txt.bat new file mode 100644 index 0000000..ecac03e --- /dev/null +++ b/8_Double_Click_Me_To_Create_Binarys_from_input_to_output_with_excluded_files_from_txt.bat @@ -0,0 +1,101 @@ +@echo off + +@REM %~dp0: Breaks down as follows: +@REM %~d0: Extracts the drive letter from %0. +@REM %~p0: Extracts the path (directory) from %0. +@REM Combining the above two (%~d0 and %~p0) gives the drive and path of the batch file. + +REM this is getting the path where the bat file is. +cd /D "%~dp0" + +@REM REM this is getting the parent path fro where the bat file is. +@REM cd /D "%~dp0.." + +set PATH=%PATH%;%SystemRoot%\system32 + +echo "%CD%"| findstr /C:" " >nul && echo This script relies on Miniconda which can not be silently installed under a path with spaces. && goto end + +@rem fix failed install when installing to a separate drive +set TMP=%cd%\dev_env +set TEMP=%cd%\dev_env + +@rem deactivate existing conda envs as needed to avoid conflicts +(call conda deactivate && call conda deactivate && call conda deactivate) 2>nul + +@rem config +set CONDA_ROOT_PREFIX=%cd%\dev_env\conda +set INSTALL_ENV_DIR=%cd%\dev_env\env +@REM set "inputFolder=C:\Path\to\inputFolder" +@REM set "outputFolder=C:\Path\to\outputFolder" +set input=%cd%\input +set output=%cd%\output +REM copy from input to output folder +xcopy "%input%\*" "%output%\" /s /e + + + +@rem activate installer env +call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" || ( echo. && echo Miniconda hook not found. && goto end ) + +call python -m compileall -b -f %output% + + +@REM rem Generate .pyc files for existing .py files +@REM for %%f in ("%output%\*.py") do ( +@REM python -m compileall "%%f" +@REM ) + +@REM rem Delete all .py files inside the output folder +@REM del "%outputFolder%\*.py" + + + +@REM rem Delete all .py files inside the output folder and its subfolders +@REM for /R "%output%" %%f in (*.py) do ( +@REM del "%%f" +@REM ) + +@REM REM put here the python files you dont want to delete. +@REM set "excluded_files=__Init__.py MoResive004.py" + +@REM for /R "%output%" %%f in (*.py) do ( +@REM set "exclude_file=" +@REM for %%x in (%excluded_files%) do ( +@REM if /I "%%~nxf" == "%%~x" set "exclude_file=1" +@REM ) +@REM if not defined exclude_file ( +@REM del "%%f" +@REM ) +@REM ) + +@REM echo All operations completed successfully. +@REM pause + + +set "excluded_files_file=excluded_files.txt" + +for /R "%output%" %%f in (*.py) do ( + set "exclude_file=" + for /F "tokens=*" %%x in (%excluded_files_file%) do ( + if /I "%%~nxf" == "%%~x" set "exclude_file=1" + ) + if not defined exclude_file ( + del "%%f" + ) +) + + +echo All operations completed successfully. +pause + + + + + + + + + + + + diff --git a/README.md b/README.md index 5013dd7..112ba26 100644 --- a/README.md +++ b/README.md @@ -34,3 +34,6 @@ It does it recursive so all files in the subfolder will also be converted. ![alt text](image-2.png) +added the ability to keep py files by adding the filenames in the text file so the py files will also be in the output folder. + +![alt text](image-3.png) \ No newline at end of file diff --git a/excluded_files.txt b/excluded_files.txt new file mode 100644 index 0000000..8e44f01 --- /dev/null +++ b/excluded_files.txt @@ -0,0 +1,14 @@ +__Init__.py +OP_OT_Auto_Anim_Pro_highlight_in_outliner.py +OP_OT_run_motion_blend_pro.py +OP_OT_lock_all_bones.py +OP_OT_run_motion_blend_pro.py +OP_OT_run_mo_resive.py +OP_OT_unlock_all_bones.py +test_script_animate_operator.py +AUTO_ANIMATE_PRO_PT_Auto_Animate_PRO_TOOL.py +My_MotionBlend_Pro_Settings_Processor.py +download_demo_file.py +reqirement_installer.py +MoResive004.py +MainApp.py \ No newline at end of file diff --git a/image-3.png b/image-3.png new file mode 100644 index 0000000..fb46bd8 Binary files /dev/null and b/image-3.png differ