This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/blenkernel/BKE_appdir.h
Brecht Van Lommel 84f21c170d Application Templates: make templates more prominent in the UI.
The goal here is to make app templates usable for default templates
that we can ship with Blender. These only have a custom startup.blend
currently and so are quite limited compared to app templates that fully
customize Blender.

But still it seems like the same kind of concept where we should be
sharing the code and UI. It is useful to be able to save a startup.blend
per template, and I can imagine some scripting being useful in the future
as well.

Changes made:

* File > New and Ctrl+N now list the templates, replacing a separate
  Application Templates menu that was not as easy to discover.
* File menu now shows name of active template above Save Startup File
  and Load Factory Settings to indicate these are saved/loaded per
  template.
* The "Default" template was renamed to "General".
* Workspaces can now be added from any of the template startup.blend
  files when clicking the (+) button in the topbar.

* User preferences are now fully shared between app templates, unless
  the template includes a custom userpref.blend. I think this will be
  useful in general, not all app templates need their own keymaps for
  example.
* Previously Save User Preferences would save the current app template
  and then Blender would start using that template by default. I've
  disabled this, to me it seems it was unintentional, or at least not
  clear at all that saving user preferences also makes the current

Differential Revision: https://developer.blender.org/D3690
2018-09-18 19:38:20 +02:00

92 lines
3.1 KiB
C++

/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __BKE_APPDIR_H__
#define __BKE_APPDIR_H__
/** \file BKE_appdir.h
* \ingroup bli
*/
struct ListBase;
/* note on naming: typical _get() suffix is omitted here,
* since its the main purpose of the API. */
const char *BKE_appdir_folder_default(void);
const char *BKE_appdir_folder_id_ex(const int folder_id, const char *subfolder, char *path, size_t path_len);
const char *BKE_appdir_folder_id(const int folder_id, const char *subfolder);
const char *BKE_appdir_folder_id_create(const int folder_id, const char *subfolder);
const char *BKE_appdir_folder_id_user_notest(const int folder_id, const char *subfolder);
const char *BKE_appdir_folder_id_version(const int folder_id, const int ver, const bool do_check);
bool BKE_appdir_app_template_any(void);
bool BKE_appdir_app_template_id_search(const char *app_template, char *path, size_t path_len);
void BKE_appdir_app_templates(struct ListBase *templates);
/* Initialize path to program executable */
void BKE_appdir_program_path_init(const char *argv0);
const char *BKE_appdir_program_path(void);
const char *BKE_appdir_program_dir(void);
/* find python executable */
bool BKE_appdir_program_python_search(
char *fullpath, const size_t fullpath_len,
const int version_major, const int version_minor);
/* Initialize path to temporary directory. */
void BKE_tempdir_init(char *userdir);
void BKE_tempdir_system_init(char *dir);
const char *BKE_tempdir_base(void);
const char *BKE_tempdir_session(void);
void BKE_tempdir_session_purge(void);
/* folder_id */
enum {
/* general, will find based on user/local/system priority */
BLENDER_DATAFILES = 2,
/* user-specific */
BLENDER_USER_CONFIG = 31,
BLENDER_USER_DATAFILES = 32,
BLENDER_USER_SCRIPTS = 33,
BLENDER_USER_AUTOSAVE = 34,
/* system */
BLENDER_SYSTEM_DATAFILES = 52,
BLENDER_SYSTEM_SCRIPTS = 53,
BLENDER_SYSTEM_PYTHON = 54,
};
/* for BKE_appdir_folder_id_version only */
enum {
BLENDER_RESOURCE_PATH_USER = 0,
BLENDER_RESOURCE_PATH_LOCAL = 1,
BLENDER_RESOURCE_PATH_SYSTEM = 2,
};
#define BLENDER_STARTUP_FILE "startup.blend"
#define BLENDER_USERPREF_FILE "userpref.blend"
#define BLENDER_QUIT_FILE "quit.blend"
#define BLENDER_BOOKMARK_FILE "bookmarks.txt"
#define BLENDER_HISTORY_FILE "recent-files.txt"
#endif /* __BKE_APPDIR_H__ */