forked from bartvdbraak/blender
Fix: "show_points" setting for Grease Pencil drawing didn't work
As reported by zeffi, the "show_points" option was not working in master. It probably broke recently, after some changes meant that the point sizes weren't geting set prior to drawing these points anymore. Since this was originally added as a debugging tool (though it is now somewhat redundant due to the stroke editing functionality, which uses/exposes the same points), this option wasn't really that important. I have decided to add back a toggle for this to the UI though, since it can be used for some interesting effects...
This commit is contained in:
parent
79319b3fba
commit
5f6b958e96
@ -414,9 +414,7 @@ class GreasePencilDataPanel:
|
||||
|
||||
col = split.column(align=True)
|
||||
col.prop(gpl, "show_x_ray")
|
||||
|
||||
# if debug:
|
||||
# layout.prop(gpl, "show_points")
|
||||
col.prop(gpl, "show_points", text="Points")
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
@ -443,6 +443,8 @@ static void gp_draw_stroke_3d(bGPDspoint *points, int totpoints, short thickness
|
||||
/* draw debug points of curve on top? */
|
||||
/* XXX: for now, we represent "selected" strokes in the same way as debug, which isn't used anymore */
|
||||
if (debug) {
|
||||
glPointSize((float)(thickness + 2));
|
||||
|
||||
glBegin(GL_POINTS);
|
||||
for (i = 0, pt = points; i < totpoints && pt; i++, pt++)
|
||||
glVertex3fv(&pt->x);
|
||||
@ -617,6 +619,8 @@ static void gp_draw_stroke_2d(bGPDspoint *points, int totpoints, short thickness
|
||||
bGPDspoint *pt;
|
||||
int i;
|
||||
|
||||
glPointSize((float)(thickness_s + 2));
|
||||
|
||||
glBegin(GL_POINTS);
|
||||
for (i = 0, pt = points; i < totpoints && pt; i++, pt++) {
|
||||
float co[2];
|
||||
@ -876,7 +880,7 @@ static void gp_draw_strokes_edit(bGPDframe *gpf, int offsx, int offsy, int winx,
|
||||
|
||||
/* draw onion-skinning for a layer */
|
||||
static void gp_draw_onionskins(bGPDlayer *gpl, bGPDframe *gpf, int offsx, int offsy, int winx, int winy,
|
||||
int UNUSED(cfra), int dflag, short debug, short lthick)
|
||||
int UNUSED(cfra), int dflag, bool debug, short lthick)
|
||||
{
|
||||
const float alpha = gpl->color[3];
|
||||
float color[4];
|
||||
|
@ -775,8 +775,8 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_DRAWDEBUG);
|
||||
RNA_def_property_ui_text(prop, "Show Points", "Draw the points which make up the strokes (for debugging purposes)");
|
||||
RNA_def_property_update_runtime(prop, "rna_GPencil_update");
|
||||
|
||||
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
|
||||
|
||||
/* X-Ray */
|
||||
prop = RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_LAYER_NO_XRAY);
|
||||
|
Loading…
Reference in New Issue
Block a user