Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2014-12-07 16:42:10 +0300
committerJoshua Leung <aligorith@gmail.com>2014-12-07 16:42:45 +0300
commitfe4d0c234eddd984b653c6530f26426871380504 (patch)
tree52d7313e811c2947d7c54db9146394a781fca9b7 /source/blender/makesrna/intern
parente67fd7a2cbf9723a0f800d9a14834ff6838f2b7f (diff)
Bugfix T42774: BSurface addon doesn't work on new builds
It turns out that several important modelling addons depend on the assumption that Grease Pencil data gets created on the active object instead of on scene level. This commit adds a toggle for setting whether new Grease Pencil data is created on scene or object level. These work as follows: * "Scene" = The behaviour originally introduced as part of the GPencil_EditStrokes changes. New strokes are added to the scene instead of the active object, making it easier to manage things when working with Grease Pencil in general. * "Object" = The previous behaviour (from 2.50 to 2.72), where new strokes are added to the active object. This is now being reintroduced to soften the transition for addons out there which have been doing this in a lazy/lax way so far. Now, what may be slightly confusing are the "fallback" measures in place: * "Scene" - To ensure that loading old files goes ok without needing a version patch, if the active object has GPencil data, that will be used in place of the scene's own GPencil data. * "Object" - If there was no active object at the time of creating strokes (for instance, if you delete the active object immediately before drawing), GPencil data gets attached to the current scene instead. Since some tweaks may still be needed here, I've decided to bump the subversion number so that we have a reference point when doing version patches.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/rna_scene.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index e65cf34bdad..52603625a9d 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -1773,6 +1773,14 @@ static void rna_def_tool_settings(BlenderRNA *brna)
{WT_VGROUP_BONE_DEFORM_OFF, "OTHER_DEFORM", 0, "Other", "Vertex Groups assigned to non Deform Bones"},
{0, NULL, 0, NULL, NULL}
};
+
+ static EnumPropertyItem gpencil_source_3d_items[] = {
+ {GP_TOOL_SOURCE_SCENE, "SCENE", 0, "Scene",
+ "Grease Pencil data attached to the current scene is used, unless the active object already has Grease Pencil data (i.e. for old files)"},
+ {GP_TOOL_SOURCE_OBJECT, "OBJECT", 0, "Object",
+ "Grease Pencil datablocks attached to the active object are used (required using pre 2.73 add-ons, e.g. BSurfaces)"},
+ {0, NULL, 0, NULL, NULL}
+ };
srna = RNA_def_struct(brna, "ToolSettings", NULL);
@@ -1965,6 +1973,13 @@ static void rna_def_tool_settings(BlenderRNA *brna)
"Allow drawing multiple strokes at a time with Grease Pencil");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* xxx: need toolbar to be redrawn... */
+ prop = RNA_def_property(srna, "grease_pencil_source", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_src");
+ RNA_def_property_enum_items(prop, gpencil_source_3d_items);
+ RNA_def_property_ui_text(prop, "Grease Pencil Source",
+ "Datablock where active Grease Pencil data is found from");
+ RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
+
/* Auto Keying */
prop = RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);