Bugfix T42774: BSurface addon doesn't work on new builds
[blender.git] / source / blender / makesrna / intern / rna_scene.c
index e65cf34bdadc1e73e9ca47c4e9a6139cdfc044c1..52603625a9d0d57dec2a7537a1da44ef9bd8e682 100644 (file)
@@ -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);