[Bf-blender-cvs] [cfc11c5e4ab] greasepencil-object: Code Cleanup - Remove all uses of gpd->last_palette_name

Joshua Leung noreply at git.blender.org
Tue Oct 17 03:57:28 CEST 2017


Commit: cfc11c5e4ab79e84beaf2cde33fe9247afa4db8b
Author: Joshua Leung
Date:   Mon Oct 16 21:01:39 2017 +1300
Branches: greasepencil-object
https://developer.blender.org/rBcfc11c5e4ab79e84beaf2cde33fe9247afa4db8b

Code Cleanup - Remove all uses of gpd->last_palette_name

The reason for this has been superseeded by the Palette Slots system

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

M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/space_outliner/outliner_select.c
M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/editors/util/undo.c
M	source/blender/makesdna/DNA_gpencil_types.h

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

diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 7e8bdc92682..24400358ae4 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1349,10 +1349,6 @@ static void gp_init_palette(tGPsdata *p)
 	palette  = palslot->palette;
 	palcolor = BKE_palette_color_get_active(palette);
 	
-	/* save last used palette */
-	// XXX: WHY???
-	BLI_strncpy(gpd->last_palette_name, palette->id.name, sizeof(gpd->last_palette_name));
-	
 	/* assign color to temp tGPsdata */
 	if (palcolor) {
 		p->palette = palette;
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index b3a4774edc1..97ac2b5bca3 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -218,10 +218,6 @@ static eOLDrawState tree_element_set_active_object(
 		}
 		/* set workspace mode */
 		BKE_workspace_object_mode_set(CTX_wm_workspace(C), ob->mode);
-		bGPdata *gpd = ob->gpd;
-		if (gpd) {
-			BKE_palette_set_active_byname(C, gpd->last_palette_name);
-		}
 	}
 
 	if (ob != scene->obedit)
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 8685705aae5..ccd3ea0bc41 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -1633,10 +1633,6 @@ static bool ed_object_select_pick(
 				}
 				/* set workspace mode */
 				BKE_workspace_object_mode_set(CTX_wm_workspace(C), basact->object->mode);
-				bGPdata *gpd = basact->object->gpd;
-				if (gpd) {
-					BKE_palette_set_active_byname(C, gpd->last_palette_name);
-				}
 			}
 		}
 
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index 9b042a9928a..3fd09c1cfd1 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -235,10 +235,6 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
 			}
 			/* set workspace mode */
 			BKE_workspace_object_mode_set(CTX_wm_workspace(C), obact->mode);
-			bGPdata *gpd = obact->gpd;
-			if (gpd) {
-				BKE_palette_set_active_byname(C, gpd->last_palette_name);
-			}
 		}
 	}
 
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index e0043d900e8..b5547fc2133 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -401,7 +401,7 @@ typedef struct bGPdata {
 	/* Runtime Only - Drawing Manager cache */
 	struct GHash *batch_cache_data;
 	
-	char last_palette_name[66]; /* name of the last palette used */
+	char last_palette_name[66]; /* name of the last palette used */  // XXX: remove
 	char pad[6];
 	
 	/* 3D Viewport/Appearance Settings */



More information about the Bf-blender-cvs mailing list