[Bf-blender-cvs] [983a928e1d4] blender2.8: GP: Reorder Move to Layer to TopDown

Antonioya noreply at git.blender.org
Fri Nov 9 19:34:49 CET 2018


Commit: 983a928e1d481dd91c36f597e2c39daba6d0f8ad
Author: Antonioya
Date:   Thu Nov 8 23:29:14 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB983a928e1d481dd91c36f597e2c39daba6d0f8ad

GP: Reorder Move to Layer to TopDown

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

M	source/blender/editors/gpencil/gpencil_utils.c

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

diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 8a2bd54b002..ccff027f65d 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -399,12 +399,12 @@ const EnumPropertyItem *ED_gpencil_layers_with_new_enum_itemf(
 		/* separator */
 		RNA_enum_item_add_separator(&item, &totitem);
 	}
-
+	const int tot = BLI_listbase_count(&gpd->layers);
 	/* Existing layers */
-	for (gpl = gpd->layers.first, i = 0; gpl; gpl = gpl->next, i++) {
+	for (gpl = gpd->layers.last, i = 0; gpl; gpl = gpl->prev, i++) {
 		item_tmp.identifier = gpl->info;
 		item_tmp.name = gpl->info;
-		item_tmp.value = i;
+		item_tmp.value = tot - i - 1;
 
 		if (gpl->flag & GP_LAYER_ACTIVE)
 			item_tmp.icon = ICON_GREASEPENCIL;



More information about the Bf-blender-cvs mailing list