[Bf-blender-cvs] [604302a] master: Cleanup some new gpencil rna functions names.

Bastien Montagne noreply at git.blender.org
Sat Aug 6 11:27:44 CEST 2016


Commit: 604302a271c49e704406c7597ef42855aa5c7582
Author: Bastien Montagne
Date:   Sat Aug 6 11:22:34 2016 +0200
Branches: master
https://developer.blender.org/rB604302a271c49e704406c7597ef42855aa5c7582

Cleanup some new gpencil rna functions names.

Convention for properties callback names is to prefix them with a version of the RNA struct name.

===================================================================

M	source/blender/makesrna/intern/rna_scene.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index b6abe98..47998e0 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -475,7 +475,7 @@ static void rna_GPencil_brush_remove(ToolSettings *ts, ReportList *reports, Poin
 	WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
 }
 
-static PointerRNA rna_GPencil_active_brush_get(PointerRNA *ptr)
+static PointerRNA rna_GPencilBrushes_active_get(PointerRNA *ptr)
 {
 	ToolSettings *ts = (ToolSettings *) ptr->data;
 
@@ -494,7 +494,7 @@ static PointerRNA rna_GPencil_active_brush_get(PointerRNA *ptr)
 	return rna_pointer_inherit_refine(ptr, NULL, NULL);
 }
 
-static void rna_GPencil_active_brush_set(PointerRNA *ptr, PointerRNA value)
+static void rna_GPencilBrushes_active_set(PointerRNA *ptr, PointerRNA value)
 {
 	ToolSettings *ts = (ToolSettings *) ptr->data;
 
@@ -511,7 +511,7 @@ static void rna_GPencil_active_brush_set(PointerRNA *ptr, PointerRNA value)
 	WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
 }
 
-static int rna_GPencilBrush_index_get(PointerRNA *ptr)
+static int rna_GPencilBrushes_index_get(PointerRNA *ptr)
 {
 	ToolSettings *ts = (ToolSettings *) ptr->data;
 	bGPDbrush *brush = BKE_gpencil_brush_getactive(ts);
@@ -519,7 +519,7 @@ static int rna_GPencilBrush_index_get(PointerRNA *ptr)
 	return BLI_findindex(&ts->gp_brushes, brush);
 }
 
-static void rna_GPencilBrush_index_set(PointerRNA *ptr, int value)
+static void rna_GPencilBrushes_index_set(PointerRNA *ptr, int value)
 {
 	ToolSettings *ts = (ToolSettings *) ptr->data;
 
@@ -529,7 +529,7 @@ static void rna_GPencilBrush_index_set(PointerRNA *ptr, int value)
 	WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
 }
 
-static void rna_GPencilBrush_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
+static void rna_GPencilBrushes_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
 {
 	ToolSettings *ts = (ToolSettings *) ptr->data;
 
@@ -2249,7 +2249,7 @@ static void rna_def_gpencil_brush(BlenderRNA *brna)
 }
 
 /* Grease Pencil Drawing Brushes API */
-static void rna_def_gpencil_brushes_api(BlenderRNA *brna, PropertyRNA *cprop)
+static void rna_def_gpencil_brushes(BlenderRNA *brna, PropertyRNA *cprop)
 {
 	StructRNA *srna;
 	PropertyRNA *prop;
@@ -2279,15 +2279,15 @@ static void rna_def_gpencil_brushes_api(BlenderRNA *brna, PropertyRNA *cprop)
 
 	prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
 	RNA_def_property_struct_type(prop, "GPencilBrush");
-	RNA_def_property_pointer_funcs(prop, "rna_GPencil_active_brush_get", "rna_GPencil_active_brush_set", NULL, NULL);
+	RNA_def_property_pointer_funcs(prop, "rna_GPencilBrushes_active_get", "rna_GPencilBrushes_active_set", NULL, NULL);
 	RNA_def_property_flag(prop, PROP_EDITABLE);
 	RNA_def_property_ui_text(prop, "Active Brush", "Current active brush");
 
 	prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
 	RNA_def_property_int_funcs(prop,
-		"rna_GPencilBrush_index_get",
-		"rna_GPencilBrush_index_set",
-		"rna_GPencilBrush_index_range");
+		"rna_GPencilBrushes_index_get",
+		"rna_GPencilBrushes_index_set",
+		"rna_GPencilBrushes_index_range");
 	RNA_def_property_ui_text(prop, "Active brush Index", "Index of active brush");
 }
 
@@ -2628,7 +2628,7 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
 	RNA_def_property_collection_sdna(prop, NULL, "gp_brushes", NULL);
 	RNA_def_property_struct_type(prop, "GPencilBrush");
 	RNA_def_property_ui_text(prop, "Grease Pencil Brushes", "Grease Pencil drawing brushes");
-	rna_def_gpencil_brushes_api(brna, prop);
+	rna_def_gpencil_brushes(brna, prop);
 
 	/* Grease Pencil - 3D View Stroke Placement */
 	prop = RNA_def_property(srna, "gpencil_stroke_placement_view3d", PROP_ENUM, PROP_NONE);




More information about the Bf-blender-cvs mailing list