GP: Add const to variable
This commit is contained in:
parent
e3f3a8101a
commit
9df3467b4e
|
@ -501,7 +501,7 @@ static void gpencil_add_draw_data(void *vedata, Object *ob)
|
|||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||
Scene *scene = draw_ctx->scene;
|
||||
bGPdata *gpd = (bGPdata *)ob->data;
|
||||
bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
|
||||
int i = stl->g_data->gp_cache_used - 1;
|
||||
tGPencilObjectCache *cache_ob = &stl->g_data->gp_object_cache[i];
|
||||
|
|
|
@ -269,7 +269,7 @@ static void gpencil_add_verts_to_dgroups(
|
|||
bDeformGroup **dgrouplist;
|
||||
bPoseChannel *pchan;
|
||||
bGPdata *gpd = (bGPdata *)ob->data;
|
||||
bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
|
||||
Mat4 bbone_array[MAX_BBONE_SUBDIV], *bbone = NULL;
|
||||
float(*root)[3], (*tip)[3], (*verts)[3];
|
||||
|
|
|
@ -709,7 +709,7 @@ static int gp_frame_clean_loose_exec(bContext *C, wmOperator *op)
|
|||
bool changed = false;
|
||||
bGPdata *gpd = ED_gpencil_data_get_active(C);
|
||||
int limit = RNA_int_get(op->ptr, "limit");
|
||||
bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
|
||||
CTX_DATA_BEGIN(C, bGPDlayer *, gpl, editable_gpencil_layers)
|
||||
{
|
||||
|
@ -1380,7 +1380,7 @@ static int gp_stroke_change_color_exec(bContext *C, wmOperator *op)
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
if (ELEM(NULL, ma)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
|
|
@ -1500,7 +1500,7 @@ static int gp_delete_selected_strokes(bContext *C)
|
|||
{
|
||||
bool changed = false;
|
||||
bGPdata *gpd = ED_gpencil_data_get_active(C);
|
||||
bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
|
||||
CTX_DATA_BEGIN(C, bGPDlayer *, gpl, editable_gpencil_layers)
|
||||
{
|
||||
|
@ -1562,7 +1562,7 @@ static int gp_dissolve_selected_points(bContext *C, eGP_DissolveMode mode)
|
|||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
bGPdata *gpd = ED_gpencil_data_get_active(C);
|
||||
bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
bool changed = false;
|
||||
int first = 0;
|
||||
int last = 0;
|
||||
|
@ -1954,7 +1954,7 @@ static int gp_delete_selected_points(bContext *C)
|
|||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
bGPdata *gpd = ED_gpencil_data_get_active(C);
|
||||
bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
bool changed = false;
|
||||
|
||||
CTX_DATA_BEGIN(C, bGPDlayer *, gpl, editable_gpencil_layers)
|
||||
|
@ -3288,7 +3288,7 @@ static int gp_stroke_separate_exec(bContext *C, wmOperator *op)
|
|||
if (ELEM(NULL, gpd_src)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_src);
|
||||
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_src);
|
||||
|
||||
/* create a new object */
|
||||
base_new = ED_object_add_duplicate(bmain, scene, view_layer, base_old, 0);
|
||||
|
@ -3473,7 +3473,7 @@ static int gp_stroke_split_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
if (ELEM(NULL, gpd)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
|
||||
/* loop strokes and split parts */
|
||||
CTX_DATA_BEGIN(C, bGPDlayer *, gpl, editable_gpencil_layers)
|
||||
|
|
|
@ -489,7 +489,7 @@ typedef enum ACTCONT_TYPES {
|
|||
Depsgraph *depsgraph_ = CTX_data_depsgraph(C); \
|
||||
Object *obact_ = CTX_data_active_object(C); \
|
||||
bGPdata *gpd_ = CTX_data_gpencil_data(C); \
|
||||
bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_); \
|
||||
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_); \
|
||||
CTX_DATA_BEGIN(C, bGPDlayer*, gpl, editable_gpencil_layers) \
|
||||
{ \
|
||||
bGPDframe *init_gpf = gpl->actframe; \
|
||||
|
|
|
@ -561,7 +561,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
else if (CTX_data_equals(member, "editable_gpencil_strokes")) {
|
||||
/* XXX: see comment for gpencil_data case... */
|
||||
bGPdata *gpd = ED_gpencil_data_get_active_direct((ID *)sc, sa, scene, obact);
|
||||
bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
|
||||
if (gpd) {
|
||||
bGPDlayer *gpl;
|
||||
|
|
Loading…
Reference in New Issue