diff options
author | Simon Repp <simon@openideas.at> | 2013-12-23 21:35:32 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-12-23 21:55:48 +0400 |
commit | 632c29fef3a566d6aac9ea35e7875f08f3d1cf74 (patch) | |
tree | 5f32deb9b89406e0f1108ff389228997a5c9db2c /source/blender/makesrna/intern/rna_main.c | |
parent | 3cc7978f19f55a4f3ff7209d67bbb1b0ccb7c4ff (diff) |
UI: communicate external data autopack better in the UI.
Previously there was no way to see if autopack was enabled. Now the external
data menu has 3 entries instead of 2:
* Automatically Pack Into .blend (with checkbox to indicate autopack on/off)
* Pack All Into .blend
* Unpack All Into Files
Fixes T37608, includes modifications by Brecht from the original patch.
Reviewed By: brecht
Differential Revision: http://developer.blender.org/D118
Diffstat (limited to 'source/blender/makesrna/intern/rna_main.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_main.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 6a43fed3ac6..b7b793ebeaf 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -42,6 +42,22 @@ /* all the list begin functions are added manually here, Main is not in SDNA */ +static int rna_Main_use_autopack_get(PointerRNA *UNUSED(ptr)) +{ + if (G.fileflags & G_AUTOPACK) + return 1; + + return 0; +} + +static void rna_Main_use_autopack_set(PointerRNA *UNUSED(ptr), int value) +{ + if (value) + G.fileflags |= G_AUTOPACK; + else + G.fileflags &= ~G_AUTOPACK; +} + static int rna_Main_is_saved_get(PointerRNA *UNUSED(ptr)) { return G.relbase_valid; @@ -356,6 +372,10 @@ void RNA_def_main(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_Main_is_saved_get", NULL); RNA_def_property_ui_text(prop, "File is Saved", "Has the current session been saved to disk as a .blend file"); + 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"); + for (i = 0; lists[i].name; i++) { prop = RNA_def_property(srna, lists[i].identifier, PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, lists[i].type); |