Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

env file template

shun_iwasawa3e2518a27001
diff --git a/toonz/sources/common/tapptools/tenv.cpp b/toonz/sources/common/tapptools/tenv.cpp
index e4c008e61..9151016f5 100644
--- a/toonz/sources/common/tapptools/tenv.cpp
+++ b/toonz/sources/common/tapptools/tenv.cpp
@@ -171,6 +171,9 @@ public:
}
TFilePath getEnvFile() { return m_envFile; }
+ TFilePath getTemplateEnvFile() {
+ return m_envFile.getParentDir() + TFilePath("template.env");
+ }
void setApplicationFullName(std::string applicationFullName) {
m_applicationFullName = applicationFullName;
@@ -326,8 +329,11 @@ void VariableSet::load() {
#endif
TFilePath fp = EnvGlobals::instance()->getEnvFile();
if (fp == TFilePath()) return;
+ // if the personal env is not found, then try to find the template
+ if (!TFileStatus(fp).doesExist())
+ fp = EnvGlobals::instance()->getTemplateEnvFile();
Tifstream is(fp);
- if (!is) return;
+ if (!is.isOpen()) return;
char buffer[1024];
while (is.getline(buffer, sizeof(buffer))) {
char *s = buffer;