Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "DNA_gpencil_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLT_translation.h"
#include "BKE_context.h"
#include "BKE_gpencil.h"
#include "BKE_gpencil_geom.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "UI_interface.h"
#include "ED_gpencil.h"
#include "ED_numinput.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_util.h"
#include "ED_view3d.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "gpencil_intern.h"
Go to the source code of this file.
Classes | |
struct | GpUvData |
Macros | |
#define | SMOOTH_FACTOR 0.3f |
Typedefs | |
typedef struct GpUvData | GpUvData |
Enumerations | |
enum | { GP_UV_ROTATE = 0 , GP_UV_TRANSLATE = 1 , GP_UV_SCALE = 2 , GP_UV_ALL = 3 } |
Functions | |
static void | gpencil_uv_transform_update_header (wmOperator *op, bContext *C) |
static void | gpencil_stroke_center (bGPDstroke *gps, float r_center[3]) |
static bool | gpencil_uv_transform_init (bContext *C, wmOperator *op) |
static void | gpencil_uv_transform_exit (bContext *C, wmOperator *op) |
static void | gpencil_transform_fill_cancel (bContext *C, wmOperator *op) |
static bool | gpencil_uv_transform_calc (bContext *C, wmOperator *op) |
static bool | gpencil_transform_fill_poll (bContext *C) |
static int | gpencil_transform_fill_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
static int | gpencil_transform_fill_modal (bContext *C, wmOperator *op, const wmEvent *event) |
void | GPENCIL_OT_transform_fill (wmOperatorType *ot) |
static int | gpencil_reset_transform_fill_exec (bContext *C, wmOperator *op) |
void | GPENCIL_OT_reset_transform_fill (wmOperatorType *ot) |
#define SMOOTH_FACTOR 0.3f |
Definition at line 73 of file gpencil_uv.c.
anonymous enum |
Enumerator | |
---|---|
GP_UV_ROTATE | |
GP_UV_TRANSLATE | |
GP_UV_SCALE | |
GP_UV_ALL |
Definition at line 66 of file gpencil_uv.c.
void GPENCIL_OT_reset_transform_fill | ( | wmOperatorType * | ot | ) |
Definition at line 516 of file gpencil_uv.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, GP_UV_ALL, GP_UV_ROTATE, GP_UV_SCALE, GP_UV_TRANSLATE, gpencil_reset_transform_fill_exec(), gpencil_transform_fill_poll(), wmOperatorType::idname, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
void GPENCIL_OT_transform_fill | ( | wmOperatorType * | ot | ) |
Definition at line 427 of file gpencil_uv.c.
References wmOperatorType::cancel, DEG2RADF, wmOperatorType::description, wmOperatorType::flag, GP_UV_ROTATE, GP_UV_SCALE, GP_UV_TRANSLATE, gpencil_transform_fill_cancel(), gpencil_transform_fill_invoke(), gpencil_transform_fill_modal(), gpencil_transform_fill_poll(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, NULL, OPTYPE_BLOCKING, OPTYPE_GRAB_CURSOR_XY, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_enum(), RNA_def_float(), RNA_def_float_rotation(), RNA_def_float_vector(), RNA_def_property_flag(), RNA_def_property_float_default(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
|
static |
Definition at line 481 of file gpencil_uv.c.
References BKE_gpencil_stroke_geometry_update(), C, CTX_data_active_object(), Object::data, DEG_id_tag_update(), ELEM, GP_EDITABLE_STROKES_BEGIN, GP_EDITABLE_STROKES_END, GP_STROKE_SELECT, GP_UV_ALL, GP_UV_ROTATE, GP_UV_SCALE, GP_UV_TRANSLATE, bGPdata::id, ID_RECALC_GEOMETRY, NA_EDITED, NC_GPENCIL, ND_DATA, NULL, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), WM_event_add_notifier(), and zero_v2().
Referenced by GPENCIL_OT_reset_transform_fill().
|
static |
Definition at line 114 of file gpencil_uv.c.
References add_v3_v3(), mul_v3_fl(), bGPDstroke::points, bGPDstroke::totpoints, bGPDspoint::x, and zero_v3().
Referenced by gpencil_uv_transform_init().
|
static |
Definition at line 215 of file gpencil_uv.c.
References C, CTX_wm_region(), wmOperator::customdata, ED_region_tag_redraw(), gpencil_uv_transform_exit(), and UNUSED_VARS.
Referenced by GPENCIL_OT_transform_fill(), and gpencil_transform_fill_modal().
|
static |
Definition at line 346 of file gpencil_uv.c.
References C, copy_v2fl_v2i(), copy_v3_v3(), CTX_wm_region_view3d(), CTX_wm_window(), wmOperator::customdata, ED_view3d_pixel_size(), GP_UV_ROTATE, gpencil_uv_transform_calc(), gpencil_uv_transform_init(), gpencil_uv_transform_update_header(), GpUvData::initial_length, GpUvData::initial_transform, len_v2(), Object::loc, GpUvData::mcenter, GpUvData::mouse, wmEvent::mval, normalize_v2(), GpUvData::ob, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, GpUvData::pixel_size, wmOperator::ptr, RNA_enum_get(), GpUvData::vinit_rotation, WM_CURSOR_EW_ARROW, WM_cursor_set(), and WM_event_add_modal_handler().
Referenced by GPENCIL_OT_transform_fill().
|
static |
Definition at line 388 of file gpencil_uv.c.
References C, wmOperator::customdata, EVT_ESCKEY, EVT_PADENTER, EVT_RETKEY, gpencil_transform_fill_cancel(), gpencil_uv_transform_calc(), gpencil_uv_transform_exit(), gpencil_uv_transform_update_header(), KM_PRESS, KM_RELEASE, LEFTMOUSE, GpUvData::mouse, MOUSEMOVE, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RIGHTMOUSE, RNA_boolean_get(), wmEvent::type, and wmEvent::val.
Referenced by GPENCIL_OT_transform_fill().
Definition at line 323 of file gpencil_uv.c.
References BKE_gpencil_layer_active_get(), C, CTX_data_active_object(), Object::data, ED_operator_view3d_active(), if(), Object::mode, NULL, OB_GPENCIL, OB_MODE_EDIT_GPENCIL, and Object::type.
Referenced by GPENCIL_OT_reset_transform_fill(), and GPENCIL_OT_transform_fill().
|
static |
Definition at line 226 of file gpencil_uv.c.
References angle_signed_v2v2(), GpUvData::array_loc, GpUvData::array_rot, GpUvData::array_scale, BKE_gpencil_stroke_geometry_update(), bool, C, wmOperator::customdata, DEG_id_tag_update(), GP_EDITABLE_STROKES_BEGIN, GP_EDITABLE_STROKES_END, GP_STROKE_SELECT, GP_UV_ROTATE, GP_UV_SCALE, GP_UV_TRANSLATE, GpUvData::gpd, bGPdata::id, ID_RECALC_GEOMETRY, GpUvData::initial_length, GpUvData::initial_transform, len_v2(), GpUvData::mcenter, GpUvData::mouse, mul_v2_fl(), NA_EDITED, NC_GEOM, NC_GPENCIL, ND_DATA, normalize_v2(), NULL, GpUvData::ob_scale, GpUvData::pixel_size, wmOperator::ptr, RNA_enum_get(), RNA_float_set(), RNA_float_set_array(), SMOOTH_FACTOR, sub_v2_v2v2(), GpUvData::vinit_rotation, WM_event_add_notifier(), and WM_main_add_notifier().
Referenced by gpencil_transform_fill_invoke(), and gpencil_transform_fill_modal().
|
static |
Definition at line 191 of file gpencil_uv.c.
References blender::compositor::area(), GpUvData::array_loc, GpUvData::array_rot, GpUvData::array_scale, C, CTX_wm_area(), CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, GpUvData::draw_handle_pixel, ED_area_status_text(), ED_region_draw_cb_exit(), MEM_SAFE_FREE, NC_GEOM, ND_DATA, NULL, ARegion::type, WM_CURSOR_DEFAULT, WM_cursor_set(), and WM_main_add_notifier().
Referenced by gpencil_transform_fill_cancel(), and gpencil_transform_fill_modal().
|
static |
Definition at line 129 of file gpencil_uv.c.
References add_v3_v3(), GpUvData::array_loc, GpUvData::array_rot, GpUvData::array_scale, C, center, copy_v2_v2(), CTX_data_active_object(), CTX_wm_region(), wmOperator::customdata, Object::data, GpUvData::draw_handle_pixel, ED_region_draw_cb_activate(), ED_region_draw_mouse_line_cb(), GP_EDITABLE_STROKES_BEGIN, GP_EDITABLE_STROKES_END, GP_EVALUATED_STROKES_BEGIN, GP_EVALUATED_STROKES_END, GP_STROKE_3DSPACE, GP_STROKE_SELECT, GpUvData::gpd, gpencil_point_3d_to_xy(), gpencil_point_conversion_init(), gpencil_stroke_center(), GpUvData::gsc, mat4_to_scale(), GpUvData::mcenter, MEM_calloc_arrayN, MEM_mallocN, mul_v3_fl(), NULL, GpUvData::ob, GpUvData::ob_scale, Object::obmat, REGION_DRAW_POST_PIXEL, ARegion::type, GpUvData::vinit_rotation, and zero_v2().
Referenced by gpencil_transform_fill_invoke().
|
static |
Definition at line 75 of file gpencil_uv.c.
References blender::compositor::area(), BLI_snprintf(), C, CTX_wm_area(), ED_area_status_text(), GP_UV_ROTATE, GP_UV_SCALE, GP_UV_TRANSLATE, NUM_STR_REP_LEN, wmOperator::ptr, RAD2DEG, RNA_enum_get(), RNA_float_get(), RNA_float_get_array(), str, TIP_, and UI_MAX_DRAW_STR.
Referenced by gpencil_transform_fill_invoke(), and gpencil_transform_fill_modal().