From 66da2f537ae80ce2b31d1eaf34ad8c03d858938d Mon Sep 17 00:00:00 2001 From: Antonioya Date: Tue, 31 Jul 2018 10:22:19 +0200 Subject: New Grease Pencil object for 2D animation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit merge the full development done in greasepencil-object branch and include mainly the following features. - New grease pencil object. - New drawing engine. - New grease pencil modes Draw/Sculpt/Edit and Weight Paint. - New brushes for grease pencil. - New modifiers for grease pencil. - New shaders FX. - New material system (replace old palettes and colors). - Split of annotations (old grease pencil) and new grease pencil object. - UI adapted to blender 2.8. You can get more info here: https://code.blender.org/2017/12/drawing-2d-animation-in-blender-2-8/ https://code.blender.org/2018/07/grease-pencil-status-update/ This is the result of nearly two years of development and I want thanks firstly the other members of the grease pencil team: Daniel M. Lara, Matias Mendiola and Joshua Leung for their support, ideas and to keep working in the project all the time, without them this project had been impossible. Also, I want thanks other Blender developers for their help, advices and to be there always to help me, and specially to Clément Foucault, Dalai Felinto, Pablo Vázquez and Campbell Barton. --- source/blender/editors/space_info/info_stats.c | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'source/blender/editors/space_info') diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index 8aa37bb5e16..fdf9d6df374 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -32,6 +32,7 @@ #include "DNA_armature_types.h" #include "DNA_curve_types.h" +#include "DNA_gpencil_types.h" #include "DNA_group_types.h" #include "DNA_lattice_types.h" #include "DNA_mesh_types.h" @@ -55,6 +56,7 @@ #include "BKE_particle.h" #include "BKE_editmesh.h" #include "BKE_object.h" +#include "BKE_gpencil.h" #include "ED_info.h" #include "ED_armature.h" @@ -72,6 +74,7 @@ typedef struct SceneStats { int totobj, totobjsel; int totlamp, totlampsel; int tottri; + int totgplayer, totgpframe, totgpstroke, totgppoint; char infostr[MAX_INFO_LEN]; } SceneStats; @@ -85,6 +88,8 @@ typedef struct SceneStatsFmt { char totobj[MAX_INFO_NUM_LEN], totobjsel[MAX_INFO_NUM_LEN]; char totlamp[MAX_INFO_NUM_LEN], totlampsel[MAX_INFO_NUM_LEN]; char tottri[MAX_INFO_NUM_LEN]; + char totgplayer[MAX_INFO_NUM_LEN], totgpframe[MAX_INFO_NUM_LEN]; + char totgpstroke[MAX_INFO_NUM_LEN], totgppoint[MAX_INFO_NUM_LEN]; } SceneStatsFmt; static void stats_object(Object *ob, int sel, int totob, SceneStats *stats) @@ -144,6 +149,20 @@ static void stats_object(Object *ob, int sel, int totob, SceneStats *stats) } break; } + case OB_GPENCIL: + { + bGPdata *gpd = (bGPdata *)ob->data; + /* GPXX Review if we can move to other place when object change + * maybe to depsgraph evaluation + */ + BKE_gpencil_stats_update(gpd); + + stats->totgplayer = gpd->totlayer; + stats->totgpframe = gpd->totframe; + stats->totgpstroke = gpd->totstroke; + stats->totgppoint = gpd->totpoint; + break; + } } } @@ -442,6 +461,11 @@ static void stats_string(ViewLayer *view_layer) SCENE_STATS_FMT_INT(tottri); + SCENE_STATS_FMT_INT(totgplayer); + SCENE_STATS_FMT_INT(totgpframe); + SCENE_STATS_FMT_INT(totgpstroke); + SCENE_STATS_FMT_INT(totgppoint); + #undef SCENE_STATS_FMT_INT @@ -501,6 +525,14 @@ static void stats_string(ViewLayer *view_layer) ofs += BLI_snprintf(s + ofs, MAX_INFO_LEN - ofs, IFACE_("Bones:%s/%s %s%s"), stats_fmt.totbonesel, stats_fmt.totbone, memstr, gpumemstr); } + else if ((ob) && (ob->type == OB_GPENCIL)) { + ofs += BLI_snprintf(s + ofs, MAX_INFO_LEN - ofs, + IFACE_("Layers:%s | Frames:%s | Strokes:%s | Points:%s"), + stats_fmt.totgplayer, stats_fmt.totgpframe, stats_fmt.totgpstroke, stats_fmt.totgppoint); + + ofs += BLI_strncpy_rlen(s + ofs, memstr, MAX_INFO_LEN - ofs); + ofs += BLI_strncpy_rlen(s + ofs, gpumemstr, MAX_INFO_LEN - ofs); + } else if (stats_is_object_dynamic_topology_sculpt(ob, object_mode)) { ofs += BLI_snprintf(s + ofs, MAX_INFO_LEN - ofs, IFACE_("Verts:%s | Tris:%s%s"), stats_fmt.totvert, stats_fmt.tottri, gpumemstr); -- cgit v1.2.3