Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_buttons.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_buttons.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c
index e719d9ab392..87a9c3cd52f 100644
--- a/source/blender/editors/gpencil/gpencil_buttons.c
+++ b/source/blender/editors/gpencil/gpencil_buttons.c
@@ -30,7 +30,6 @@
#include <stdlib.h>
#include <stddef.h>
-#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
@@ -41,15 +40,12 @@
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_gpencil.h"
-#include "BKE_utildefines.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
#include "ED_gpencil.h"
@@ -126,7 +122,7 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl)
/* locked */
icon= (gpl->flag & GP_LAYER_LOCKED) ? ICON_LOCKED : ICON_UNLOCKED;
- uiItemR(subrow, &ptr, "locked", 0, "", icon);
+ uiItemR(subrow, &ptr, "lock", 0, "", icon);
/* when layer is locked or hidden, only draw header */
if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) {
@@ -164,7 +160,7 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl)
/* frame locking */
// TODO: this needs its own icons...
icon= (gpl->flag & GP_LAYER_FRAMELOCK) ? ICON_RENDER_STILL : ICON_RENDER_ANIMATION;
- uiItemR(subrow, &ptr, "frame_lock", 0, "", icon);
+ uiItemR(subrow, &ptr, "lock_frame", 0, "", icon);
uiBlockSetEmboss(block, UI_EMBOSS);
@@ -194,11 +190,11 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl)
/* color */
subcol= uiLayoutColumn(col, 1);
uiItemR(subcol, &ptr, "color", 0, "", 0);
- uiItemR(subcol, &ptr, "opacity", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(subcol, &ptr, "alpha", UI_ITEM_R_SLIDER, NULL, 0);
/* stroke thickness */
subcol= uiLayoutColumn(col, 1);
- uiItemR(subcol, &ptr, "line_thickness", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(subcol, &ptr, "line_width", UI_ITEM_R_SLIDER, NULL, 0);
/* debugging options */
if (G.f & G_DEBUG) {
@@ -212,7 +208,7 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl)
/* onion-skinning */
subcol= uiLayoutColumn(col, 1);
uiItemR(subcol, &ptr, "use_onion_skinning", 0, "Onion Skinning", 0);
- uiItemR(subcol, &ptr, "max_ghost_range", 0, "Frames", 0); // XXX shorter name here? i.e. GStep
+ uiItemR(subcol, &ptr, "ghost_range_max", 0, "Frames", 0); // XXX shorter name here? i.e. GStep
/* additional options... */
subcol= uiLayoutColumn(col, 1);
@@ -221,13 +217,20 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl)
}
}
+/* stroke drawing options available */
+typedef enum eGP_Stroke_Ops {
+ STROKE_OPTS_NORMAL = 0,
+ STROKE_OPTS_V3D_OFF,
+ STROKE_OPTS_V3D_ON,
+} eGP_Stroke_Ops;
+
/* Draw the contents for a grease-pencil panel*/
static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, PointerRNA *ctx_ptr)
{
PointerRNA gpd_ptr;
bGPDlayer *gpl;
uiLayout *col, *row;
- short v3d_stroke_opts_on = 0;
+ short v3d_stroke_opts = STROKE_OPTS_NORMAL;
/* make new PointerRNA for Grease Pencil block */
RNA_id_pointer_create((ID *)gpd, &gpd_ptr);
@@ -259,7 +262,9 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi
/* check whether advanced 3D-View drawing space options can be used */
if (CTX_wm_view3d(C)) {
if (gpd->flag & (GP_DATA_DEPTH_STROKE|GP_DATA_DEPTH_VIEW))
- v3d_stroke_opts_on = 1;
+ v3d_stroke_opts = STROKE_OPTS_V3D_ON;
+ else
+ v3d_stroke_opts = STROKE_OPTS_V3D_OFF;
}
/* drawing space options */
@@ -267,12 +272,12 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi
uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "VIEW", NULL, 0);
uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "CURSOR", NULL, 0);
row= uiLayoutRow(col, 1);
- uiLayoutSetActive(row, v3d_stroke_opts_on);
+ uiLayoutSetActive(row, v3d_stroke_opts);
uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "SURFACE", NULL, 0);
uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "STROKE", NULL, 0);
row= uiLayoutRow(col, 0);
- uiLayoutSetActive(row, v3d_stroke_opts_on);
+ uiLayoutSetActive(row, v3d_stroke_opts==STROKE_OPTS_V3D_ON);
uiItemR(row, &gpd_ptr, "use_stroke_endpoints", 0, NULL, 0);
}