I tried to provide a workaround. The directory for saving/opening/import/export file will be the path where the blend file is.
So I make a bat script, this will copy startup.blend
to target path and open the file. So the directory for saving/opening will be there. Then delete it.
Usage:
Change source
to your startup.blend
file path.
Change default_directory
to your desired default directory.
Change default_filename
to your desired default filename.
The default filename is untitled.blend.
It will auto add a suffix number if filename is already exist.
You might want to create a .lnk
file point to this .bat
file. Set the icon of the link to blender.exe. And set run as "minimized".
::copy file
@echo off
setlocal enabledelayedexpansion
set "source=%APPDATA%\Blender Foundation\Blender\3.6\config\startup.blend"
set "default_filename=untitled"
set "default_directory=%UserProfile%\Desktop"
set "target=%default_directory%\%default_filename%.blend"
set "max=0"
if not exist "%source%" (
echo Blender startup file not found:
echo %source%
pause
exit /b 1
)
for /f "tokens=1 delims=." %%a in ('dir /b "%default_directory%\%default_filename%*.blend"') do (
set "num=%%a"
set "num=!num:%default_filename%=!"
if !num! gtr !max! (
set max=!num!
)
)
if exist "%target%" (
set /a max+=1
set "target=%default_directory%\%default_filename%!max!.blend"
)
echo n|copy /-y "%source%" "%target%"
::open file
%target%
::delete file
del %target%
It's not perfect, just a workaround. It's dangerous when you opened two processes and save the files. Because one will overwrite another without confirmation. To solve this, you can use date and time as the default filename. So the filename will not be the same, then everything is fine.
For example:
set "mydate=%date%"
set "mytime=%time%"
set "default_filename=%mydate% %mytime%"
Another way is to edit source code of Blender and compile it.
Not sure making an addon can do it or not.
C:\
or/
. The memory of previous .blend directories is not reset. $\endgroup$