2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-11-07 02:58:25 +00:00
|
|
|
* 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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-11-07 02:58:25 +00:00
|
|
|
*/
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup RNA
|
2011-02-27 20:20:01 +00:00
|
|
|
*/
|
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2013-03-04 18:36:37 +00:00
|
|
|
#include "BLI_utildefines.h"
|
2012-09-03 22:04:14 +00:00
|
|
|
#include "BLI_path_util.h"
|
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
#include "RNA_define.h"
|
2018-10-30 19:52:06 +01:00
|
|
|
#include "RNA_access.h"
|
2008-11-07 02:58:25 +00:00
|
|
|
|
2009-06-03 23:16:51 +00:00
|
|
|
#include "rna_internal.h"
|
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
#ifdef RNA_RUNTIME
|
|
|
|
|
|
|
|
#include "BKE_main.h"
|
2009-06-18 19:48:55 +00:00
|
|
|
#include "BKE_mesh.h"
|
2010-04-02 19:38:20 +00:00
|
|
|
#include "BKE_global.h"
|
2008-11-07 02:58:25 +00:00
|
|
|
|
|
|
|
/* all the list begin functions are added manually here, Main is not in SDNA */
|
2010-04-02 19:38:20 +00:00
|
|
|
|
2018-07-05 22:25:34 +02:00
|
|
|
static bool rna_Main_use_autopack_get(PointerRNA *UNUSED(ptr))
|
2013-12-23 18:35:32 +01:00
|
|
|
{
|
2019-02-02 13:39:51 +11:00
|
|
|
if (G.fileflags & G_FILE_AUTOPACK)
|
2013-12-23 18:35:32 +01:00
|
|
|
return 1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-07-05 22:25:34 +02:00
|
|
|
static void rna_Main_use_autopack_set(PointerRNA *UNUSED(ptr), bool value)
|
2013-12-23 18:35:32 +01:00
|
|
|
{
|
|
|
|
if (value)
|
2019-02-02 13:39:51 +11:00
|
|
|
G.fileflags |= G_FILE_AUTOPACK;
|
2013-12-23 18:35:32 +01:00
|
|
|
else
|
2019-02-02 13:39:51 +11:00
|
|
|
G.fileflags &= ~G_FILE_AUTOPACK;
|
2013-12-23 18:35:32 +01:00
|
|
|
}
|
|
|
|
|
2018-07-05 22:25:34 +02:00
|
|
|
static bool rna_Main_is_saved_get(PointerRNA *UNUSED(ptr))
|
2011-04-11 15:31:05 +00:00
|
|
|
{
|
|
|
|
return G.relbase_valid;
|
|
|
|
}
|
|
|
|
|
2018-07-05 22:25:34 +02:00
|
|
|
static bool rna_Main_is_dirty_get(PointerRNA *ptr)
|
2010-05-03 03:02:27 +00:00
|
|
|
{
|
2011-04-11 15:31:05 +00:00
|
|
|
/* XXX, not totally nice to do it this way, should store in main ? */
|
2012-05-12 11:01:29 +00:00
|
|
|
Main *bmain = (Main *)ptr->data;
|
2011-04-11 15:31:05 +00:00
|
|
|
wmWindowManager *wm;
|
2012-11-01 09:54:00 +00:00
|
|
|
if ((wm = bmain->wm.first)) {
|
2011-04-11 15:31:05 +00:00
|
|
|
return !wm->file_saved;
|
|
|
|
}
|
|
|
|
|
2014-04-01 11:34:00 +11:00
|
|
|
return true;
|
2010-05-03 03:02:27 +00:00
|
|
|
}
|
2008-11-07 02:58:25 +00:00
|
|
|
|
2010-06-02 17:58:28 +00:00
|
|
|
static void rna_Main_filepath_get(PointerRNA *ptr, char *value)
|
2008-11-30 00:57:32 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Main *bmain = (Main *)ptr->data;
|
2008-11-30 00:57:32 +00:00
|
|
|
BLI_strncpy(value, bmain->name, sizeof(bmain->name));
|
|
|
|
}
|
|
|
|
|
2010-06-02 17:58:28 +00:00
|
|
|
static int rna_Main_filepath_length(PointerRNA *ptr)
|
2008-11-30 00:57:32 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Main *bmain = (Main *)ptr->data;
|
2008-11-30 00:57:32 +00:00
|
|
|
return strlen(bmain->name);
|
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
#if 0
|
2010-06-02 17:58:28 +00:00
|
|
|
static void rna_Main_filepath_set(PointerRNA *ptr, const char *value)
|
2008-11-30 00:57:32 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Main *bmain = (Main *)ptr->data;
|
2008-11-30 00:57:32 +00:00
|
|
|
BLI_strncpy(bmain->name, value, sizeof(bmain->name));
|
|
|
|
}
|
2009-02-02 19:57:57 +00:00
|
|
|
#endif
|
2008-11-30 00:57:32 +00:00
|
|
|
|
2019-03-08 11:40:37 +11:00
|
|
|
#define RNA_MAIN_LISTBASE_FUNCS_DEF(_listbase_name) \
|
|
|
|
static void rna_Main_##_listbase_name##_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) \
|
|
|
|
{ \
|
|
|
|
rna_iterator_listbase_begin(iter, &((Main *)ptr->data)->_listbase_name, NULL); \
|
|
|
|
}
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
|
2019-03-08 11:40:37 +11:00
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(actions)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(armatures)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(brushes)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(cachefiles)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(cameras)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(collections)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(curves)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(fonts)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(gpencils)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(images)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(lattices)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(libraries)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(lightprobes)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(lights)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(linestyles)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(masks)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(materials)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(meshes)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(metaballs)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(movieclips)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(nodetrees)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(objects)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(paintcurves)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(palettes)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(particles)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(scenes)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(screens)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(shapekeys)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(sounds)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(speakers)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(texts)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(textures)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(wm)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(workspaces)
|
|
|
|
RNA_MAIN_LISTBASE_FUNCS_DEF(worlds)
|
|
|
|
|
|
|
|
#undef RNA_MAIN_LISTBASE_FUNCS_DEF
|
2017-06-06 22:47:41 +02:00
|
|
|
|
2014-08-25 23:53:34 +10:00
|
|
|
static void rna_Main_version_get(PointerRNA *ptr, int *value)
|
|
|
|
{
|
|
|
|
Main *bmain = (Main *)ptr->data;
|
|
|
|
value[0] = bmain->versionfile / 100;
|
|
|
|
value[1] = bmain->versionfile % 100;
|
|
|
|
value[2] = bmain->subversionfile;
|
|
|
|
}
|
|
|
|
|
2009-09-06 15:13:57 +00:00
|
|
|
#ifdef UNIT_TEST
|
|
|
|
|
|
|
|
static PointerRNA rna_Test_test_get(PointerRNA *ptr)
|
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
PointerRNA ret = *ptr;
|
|
|
|
ret.type = &RNA_Test;
|
2009-09-06 15:13:57 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
#else
|
|
|
|
|
2010-01-10 14:40:37 +00:00
|
|
|
/* local convenience types */
|
|
|
|
typedef void (CollectionDefFunc)(struct BlenderRNA *brna, struct PropertyRNA *cprop);
|
|
|
|
|
|
|
|
typedef struct MainCollectionDef {
|
2012-05-12 11:01:29 +00:00
|
|
|
const char *identifier;
|
|
|
|
const char *type;
|
|
|
|
const char *iter_begin;
|
|
|
|
const char *name;
|
|
|
|
const char *description;
|
2010-03-22 09:30:00 +00:00
|
|
|
CollectionDefFunc *func;
|
2010-01-10 14:40:37 +00:00
|
|
|
} MainCollectionDef;
|
2010-01-09 23:44:01 +00:00
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
void RNA_def_main(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
2010-01-10 14:40:37 +00:00
|
|
|
CollectionDefFunc *func;
|
|
|
|
|
2010-05-08 07:25:26 +00:00
|
|
|
/* plural must match idtypes in readblenentry.c */
|
2012-03-05 23:30:41 +00:00
|
|
|
MainCollectionDef lists[] = {
|
2019-03-08 09:29:17 +11:00
|
|
|
{"cameras", "Camera", "rna_Main_cameras_begin", "Cameras", "Camera data-blocks", RNA_def_main_cameras},
|
|
|
|
{"scenes", "Scene", "rna_Main_scenes_begin", "Scenes", "Scene data-blocks", RNA_def_main_scenes},
|
|
|
|
{"objects", "Object", "rna_Main_objects_begin", "Objects", "Object data-blocks", RNA_def_main_objects},
|
|
|
|
{"materials", "Material", "rna_Main_materials_begin", "Materials", "Material data-blocks", RNA_def_main_materials},
|
|
|
|
{"node_groups", "NodeTree", "rna_Main_nodetrees_begin", "Node Groups", "Node group data-blocks", RNA_def_main_node_groups},
|
|
|
|
{"meshes", "Mesh", "rna_Main_meshes_begin", "Meshes", "Mesh data-blocks", RNA_def_main_meshes},
|
|
|
|
{"lights", "Light", "rna_Main_lights_begin", "Lights", "Light data-blocks", RNA_def_main_lights},
|
|
|
|
{"libraries", "Library", "rna_Main_libraries_begin", "Libraries", "Library data-blocks", RNA_def_main_libraries},
|
|
|
|
{"screens", "Screen", "rna_Main_screens_begin", "Screens", "Screen data-blocks", RNA_def_main_screens},
|
2019-02-27 16:36:29 +01:00
|
|
|
{"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager data-blocks", RNA_def_main_window_managers},
|
2019-03-08 09:29:17 +11:00
|
|
|
{"images", "Image", "rna_Main_images_begin", "Images", "Image data-blocks", RNA_def_main_images},
|
|
|
|
{"lattices", "Lattice", "rna_Main_lattices_begin", "Lattices", "Lattice data-blocks", RNA_def_main_lattices},
|
|
|
|
{"curves", "Curve", "rna_Main_curves_begin", "Curves", "Curve data-blocks", RNA_def_main_curves},
|
|
|
|
{"metaballs", "MetaBall", "rna_Main_metaballs_begin", "Metaballs", "Metaball data-blocks", RNA_def_main_metaballs},
|
|
|
|
{"fonts", "VectorFont", "rna_Main_fonts_begin", "Vector Fonts", "Vector font data-blocks", RNA_def_main_fonts},
|
|
|
|
{"textures", "Texture", "rna_Main_textures_begin", "Textures", "Texture data-blocks", RNA_def_main_textures},
|
|
|
|
{"brushes", "Brush", "rna_Main_brushes_begin", "Brushes", "Brush data-blocks", RNA_def_main_brushes},
|
|
|
|
{"worlds", "World", "rna_Main_worlds_begin", "Worlds", "World data-blocks", RNA_def_main_worlds},
|
|
|
|
{"collections", "Collection", "rna_Main_collections_begin", "Collections", "Collection data-blocks", RNA_def_main_collections},
|
|
|
|
{"shape_keys", "Key", "rna_Main_shapekeys_begin", "Shape Keys", "Shape Key data-blocks", NULL},
|
|
|
|
{"texts", "Text", "rna_Main_texts_begin", "Texts", "Text data-blocks", RNA_def_main_texts},
|
|
|
|
{"speakers", "Speaker", "rna_Main_speakers_begin", "Speakers", "Speaker data-blocks", RNA_def_main_speakers},
|
|
|
|
{"sounds", "Sound", "rna_Main_sounds_begin", "Sounds", "Sound data-blocks", RNA_def_main_sounds},
|
|
|
|
{"armatures", "Armature", "rna_Main_armatures_begin", "Armatures", "Armature data-blocks", RNA_def_main_armatures},
|
|
|
|
{"actions", "Action", "rna_Main_actions_begin", "Actions", "Action data-blocks", RNA_def_main_actions},
|
|
|
|
{"particles", "ParticleSettings", "rna_Main_particles_begin", "Particles", "Particle data-blocks", RNA_def_main_particles},
|
|
|
|
{"palettes", "Palette", "rna_Main_palettes_begin", "Palettes", "Palette data-blocks", RNA_def_main_palettes},
|
2019-03-08 09:55:40 +11:00
|
|
|
{"grease_pencils", "GreasePencil", "rna_Main_gpencils_begin", "Grease Pencil", "Grease Pencil data-blocks", RNA_def_main_gpencil},
|
2019-02-27 16:36:29 +01:00
|
|
|
{"movieclips", "MovieClip", "rna_Main_movieclips_begin", "Movie Clips", "Movie Clip data-blocks", RNA_def_main_movieclips},
|
|
|
|
{"masks", "Mask", "rna_Main_masks_begin", "Masks", "Masks data-blocks", RNA_def_main_masks},
|
2019-03-08 09:29:17 +11:00
|
|
|
{"linestyles", "FreestyleLineStyle", "rna_Main_linestyles_begin", "Line Styles", "Line Style data-blocks", RNA_def_main_linestyles},
|
|
|
|
{"cache_files", "CacheFile", "rna_Main_cachefiles_begin", "Cache Files", "Cache Files data-blocks", RNA_def_main_cachefiles},
|
|
|
|
{"paint_curves", "PaintCurve", "rna_Main_paintcurves_begin", "Paint Curves", "Paint Curves data-blocks", RNA_def_main_paintcurves},
|
|
|
|
{"workspaces", "WorkSpace", "rna_Main_workspaces_begin", "Workspaces", "Workspace data-blocks", RNA_def_main_workspaces},
|
|
|
|
{"lightprobes", "LightProbe", "rna_Main_lightprobes_begin", "LightProbes", "LightProbe data-blocks", RNA_def_main_lightprobes},
|
2019-02-03 14:01:45 +11:00
|
|
|
{NULL, NULL, NULL, NULL, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2009-06-18 19:48:55 +00:00
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
int i;
|
2018-06-09 14:40:09 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendData", NULL);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Blendfile Data",
|
2016-09-19 16:46:20 +02:00
|
|
|
"Main data structure representing a .blend file and all its data-blocks");
|
2009-06-03 23:16:51 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_BLENDER);
|
2008-11-07 02:58:25 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
|
2012-01-16 05:52:33 +00:00
|
|
|
RNA_def_property_string_maxlength(prop, FILE_MAX);
|
2010-06-02 17:58:28 +00:00
|
|
|
RNA_def_property_string_funcs(prop, "rna_Main_filepath_get", "rna_Main_filepath_length", "rna_Main_filepath_set");
|
2009-03-23 13:24:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file");
|
2018-06-09 14:40:09 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
|
2010-05-03 03:02:27 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
2010-08-18 07:14:10 +00:00
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_Main_is_dirty_get", NULL);
|
2011-11-04 08:08:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "File Has Unsaved Changes", "Have recent edits been saved to disk");
|
2011-04-11 15:31:05 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "is_saved", PROP_BOOLEAN, PROP_NONE);
|
2011-04-11 15:31:05 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_Main_is_saved_get", NULL);
|
2010-05-03 03:02:27 +00:00
|
|
|
RNA_def_property_ui_text(prop, "File is Saved", "Has the current session been saved to disk as a .blend file");
|
2008-11-30 00:57:32 +00:00
|
|
|
|
2013-12-23 18:35:32 +01:00
|
|
|
prop = RNA_def_property(srna, "use_autopack", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_Main_use_autopack_get", "rna_Main_use_autopack_set");
|
|
|
|
RNA_def_property_ui_text(prop, "Use Autopack", "Automatically pack all external data into .blend file");
|
|
|
|
|
2014-08-25 23:53:34 +10:00
|
|
|
prop = RNA_def_int_vector(srna, "version", 3, NULL, 0, INT_MAX,
|
2016-11-19 01:15:08 +01:00
|
|
|
"Version", "Version of Blender the .blend was saved with", 0, INT_MAX);
|
2014-08-25 23:53:34 +10:00
|
|
|
RNA_def_property_int_funcs(prop, "rna_Main_version_get", NULL, NULL);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_flag(prop, PROP_THICK_WRAP);
|
|
|
|
|
2012-04-28 06:31:57 +00:00
|
|
|
for (i = 0; lists[i].name; i++) {
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, lists[i].identifier, PROP_COLLECTION, PROP_NONE);
|
2010-01-10 14:40:37 +00:00
|
|
|
RNA_def_property_struct_type(prop, lists[i].type);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, lists[i].iter_begin, "rna_iterator_listbase_next",
|
|
|
|
"rna_iterator_listbase_end", "rna_iterator_listbase_get",
|
2019-02-27 16:36:29 +01:00
|
|
|
NULL, NULL, NULL, NULL);
|
2010-01-10 14:40:37 +00:00
|
|
|
RNA_def_property_ui_text(prop, lists[i].name, lists[i].description);
|
2010-01-09 23:44:01 +00:00
|
|
|
|
|
|
|
/* collection functions */
|
2012-03-05 23:30:41 +00:00
|
|
|
func = lists[i].func;
|
|
|
|
if (func)
|
2010-01-09 23:44:01 +00:00
|
|
|
func(brna, prop);
|
2008-11-07 02:58:25 +00:00
|
|
|
}
|
2009-06-18 19:48:55 +00:00
|
|
|
|
|
|
|
RNA_api_main(srna);
|
2009-09-06 15:13:57 +00:00
|
|
|
|
|
|
|
#ifdef UNIT_TEST
|
|
|
|
|
|
|
|
RNA_define_verify_sdna(0);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "test", PROP_POINTER, PROP_NONE);
|
2009-09-06 15:13:57 +00:00
|
|
|
RNA_def_property_struct_type(prop, "Test");
|
2010-08-03 05:14:59 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_Test_test_get", NULL, NULL, NULL);
|
2009-09-06 15:13:57 +00:00
|
|
|
|
|
|
|
RNA_define_verify_sdna(1);
|
|
|
|
|
|
|
|
#endif
|
2008-11-07 02:58:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|