Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_uv.c
| Context not available. | |||||
| add_v2_v2v2(gps->uv_translation, opdata->array_loc[i], mdiff); | add_v2_v2v2(gps->uv_translation, opdata->array_loc[i], mdiff); | ||||
| } | } | ||||
| else { | else { | ||||
| copy_v2_v2(gps->uv_translation, location); | add_v2_v2(gps->uv_translation, location); | ||||
| } | } | ||||
| /* Calc geometry data. */ | /* Calc geometry data. */ | ||||
| BKE_gpencil_stroke_geometry_update(gps); | BKE_gpencil_stroke_geometry_update(gps); | ||||
| Context not available. | |||||
| if (changed) { | if (changed) { | ||||
| GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) { | GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) { | ||||
| if (gps->flag & GP_STROKE_SELECT) { | if (gps->flag & GP_STROKE_SELECT) { | ||||
| gps->uv_rotation = (opdata->is_modal) ? opdata->array_rot[i] + uv_rotation : uv_rotation; | gps->uv_rotation = (opdata->is_modal) ? opdata->array_rot[i] + uv_rotation : | ||||
| gps->uv_rotation + uv_rotation; | |||||
| /* Calc geometry data. */ | /* Calc geometry data. */ | ||||
| BKE_gpencil_stroke_geometry_update(gps); | BKE_gpencil_stroke_geometry_update(gps); | ||||
| i++; | i++; | ||||
| Context not available. | |||||
| ((len_v2(mdiff) - opdata->initial_length) * opdata->pixel_size) / | ((len_v2(mdiff) - opdata->initial_length) * opdata->pixel_size) / | ||||
| opdata->ob_scale : | opdata->ob_scale : | ||||
| RNA_float_get(op->ptr, "scale"); | RNA_float_get(op->ptr, "scale"); | ||||
| scale *= SMOOTH_FACTOR; | |||||
| if (opdata->is_modal) { | |||||
| scale *= SMOOTH_FACTOR; | |||||
| } | |||||
| if (opdata->is_modal) { | if (opdata->is_modal) { | ||||
| RNA_float_set(op->ptr, "scale", scale); | RNA_float_set(op->ptr, "scale", scale); | ||||
| Context not available. | |||||
| if (changed) { | if (changed) { | ||||
| GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) { | GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) { | ||||
| if (gps->flag & GP_STROKE_SELECT) { | if (gps->flag & GP_STROKE_SELECT) { | ||||
| gps->uv_scale = (opdata->is_modal) ? opdata->array_scale[i] + scale : scale; | gps->uv_scale = (opdata->is_modal) ? opdata->array_scale[i] + scale : | ||||
| gps->uv_scale + scale; | |||||
| /* Calc geometry data. */ | /* Calc geometry data. */ | ||||
| BKE_gpencil_stroke_geometry_update(gps); | BKE_gpencil_stroke_geometry_update(gps); | ||||
| i++; | i++; | ||||
| Context not available. | |||||
| return OPERATOR_RUNNING_MODAL; | return OPERATOR_RUNNING_MODAL; | ||||
| } | } | ||||
| static void gpencil_transform_fill_ui(bContext *C, wmOperator *op) | |||||
| { | |||||
| uiLayout *layout = op->layout; | |||||
| PointerRNA ptr; | |||||
| RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr); | |||||
| uiItemR(layout, &ptr, "location", 0, NULL, 0); | |||||
| uiItemR(layout, &ptr, "rotation", 0, NULL, 0); | |||||
| uiItemR(layout, &ptr, "scale", 0, NULL, 0); | |||||
| } | |||||
| void GPENCIL_OT_transform_fill(wmOperatorType *ot) | void GPENCIL_OT_transform_fill(wmOperatorType *ot) | ||||
| { | { | ||||
| static const EnumPropertyItem uv_mode[] = { | static const EnumPropertyItem uv_mode[] = { | ||||
| Context not available. | |||||
| ot->exec = gpencil_transform_fill_exec; | ot->exec = gpencil_transform_fill_exec; | ||||
| ot->cancel = gpencil_transform_fill_cancel; | ot->cancel = gpencil_transform_fill_cancel; | ||||
| ot->poll = gpencil_transform_fill_poll; | ot->poll = gpencil_transform_fill_poll; | ||||
| ot->ui = gpencil_transform_fill_ui; | |||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_GRAB_CURSOR_XY | OPTYPE_BLOCKING; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_GRAB_CURSOR_XY | OPTYPE_BLOCKING; | ||||
| Context not available. | |||||