2012-06-04 15:49:58 +00:00
|
|
|
/*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2012 Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup editors
|
2012-06-04 15:49:58 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-03-02 15:09:10 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2021-01-05 10:12:22 +01:00
|
|
|
#include "DNA_mask_types.h"
|
|
|
|
|
|
2019-05-21 17:29:58 +02:00
|
|
|
struct Depsgraph;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct KeyframeEditData;
|
2012-06-06 14:38:47 +00:00
|
|
|
struct MaskLayer;
|
2012-06-08 14:31:38 +00:00
|
|
|
struct MaskLayerShape;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct bContext;
|
|
|
|
|
struct wmKeyConfig;
|
2012-06-04 15:49:58 +00:00
|
|
|
|
2012-07-24 19:29:24 +00:00
|
|
|
/* mask_edit.c */
|
2020-03-25 19:06:17 +11:00
|
|
|
void ED_mask_deselect_all(const struct bContext *C);
|
|
|
|
|
|
|
|
|
|
void ED_operatortypes_mask(void);
|
|
|
|
|
void ED_keymap_mask(struct wmKeyConfig *keyconf);
|
|
|
|
|
void ED_operatormacros_mask(void);
|
|
|
|
|
|
|
|
|
|
/* mask_query.c */
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_mask_get_size(struct ScrArea *area, int *width, int *height);
|
|
|
|
|
void ED_mask_zoom(struct ScrArea *area, struct ARegion *region, float *zoomx, float *zoomy);
|
|
|
|
|
void ED_mask_get_aspect(struct ScrArea *area, struct ARegion *region, float *aspx, float *aspy);
|
2012-07-24 19:29:24 +00:00
|
|
|
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_mask_pixelspace_factor(struct ScrArea *area,
|
2020-03-06 16:56:42 +01:00
|
|
|
struct ARegion *region,
|
2012-07-26 22:41:40 +00:00
|
|
|
float *scalex,
|
|
|
|
|
float *scaley);
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_mask_mouse_pos(struct ScrArea *area,
|
|
|
|
|
struct ARegion *region,
|
|
|
|
|
const int mval[2],
|
|
|
|
|
float co[2]);
|
2012-07-26 21:22:42 +00:00
|
|
|
|
2012-07-26 22:41:40 +00:00
|
|
|
void ED_mask_point_pos(
|
2020-04-03 13:25:03 +02:00
|
|
|
struct ScrArea *area, struct ARegion *region, float x, float y, float *xr, float *yr);
|
2012-07-26 22:41:40 +00:00
|
|
|
void ED_mask_point_pos__reverse(
|
2020-04-03 13:25:03 +02:00
|
|
|
struct ScrArea *area, struct ARegion *region, float x, float y, float *xr, float *yr);
|
2012-07-26 21:22:42 +00:00
|
|
|
|
2020-04-03 13:25:03 +02:00
|
|
|
void ED_mask_cursor_location_get(struct ScrArea *area, float cursor[2]);
|
2015-06-11 22:46:42 +02:00
|
|
|
bool ED_mask_selected_minmax(const struct bContext *C, float min[2], float max[2]);
|
2013-08-26 20:23:26 +00:00
|
|
|
|
2012-06-04 15:49:58 +00:00
|
|
|
/* mask_draw.c */
|
2012-09-15 01:52:28 +00:00
|
|
|
void ED_mask_draw(const struct bContext *C, const char draw_flag, const char draw_type);
|
2019-05-21 17:29:58 +02:00
|
|
|
void ED_mask_draw_region(struct Depsgraph *depsgraph,
|
|
|
|
|
struct Mask *mask,
|
2020-03-06 16:56:42 +01:00
|
|
|
struct ARegion *region,
|
2013-10-12 14:09:05 +00:00
|
|
|
const char draw_flag,
|
|
|
|
|
const char draw_type,
|
2021-01-05 10:12:22 +01:00
|
|
|
const eMaskOverlayMode overlay_mode,
|
2012-09-13 02:28:48 +00:00
|
|
|
const int width_i,
|
|
|
|
|
const int height_i,
|
|
|
|
|
const float aspx,
|
|
|
|
|
const float aspy,
|
2014-02-03 18:55:59 +11:00
|
|
|
const bool do_scale_applied,
|
|
|
|
|
const bool do_draw_cb,
|
2012-07-24 19:29:24 +00:00
|
|
|
float stabmat[4][4],
|
2012-09-15 01:52:28 +00:00
|
|
|
const struct bContext *C);
|
2012-06-04 15:49:58 +00:00
|
|
|
|
2012-08-01 10:50:39 +00:00
|
|
|
void ED_mask_draw_frames(
|
2020-03-06 16:56:42 +01:00
|
|
|
struct Mask *mask, struct ARegion *region, const int cfra, const int sfra, const int efra);
|
2012-08-01 10:50:39 +00:00
|
|
|
|
2012-06-04 15:49:58 +00:00
|
|
|
/* mask_shapekey.c */
|
2019-10-31 15:36:43 +01:00
|
|
|
void ED_mask_layer_shape_auto_key(struct MaskLayer *mask_layer, const int frame);
|
2013-11-26 06:39:14 +11:00
|
|
|
bool ED_mask_layer_shape_auto_key_all(struct Mask *mask, const int frame);
|
|
|
|
|
bool ED_mask_layer_shape_auto_key_select(struct Mask *mask, const int frame);
|
2012-06-04 15:49:58 +00:00
|
|
|
|
2012-06-08 14:31:38 +00:00
|
|
|
/* ----------- Mask AnimEdit API ------------------ */
|
2019-10-31 15:36:43 +01:00
|
|
|
bool ED_masklayer_frames_looper(struct MaskLayer *mask_layer,
|
2014-03-31 15:23:27 +06:00
|
|
|
struct Scene *scene,
|
2020-09-09 11:10:38 +02:00
|
|
|
bool (*mask_layer_shape_cb)(struct MaskLayerShape *,
|
|
|
|
|
struct Scene *));
|
2019-10-31 15:36:43 +01:00
|
|
|
void ED_masklayer_make_cfra_list(struct MaskLayer *mask_layer, ListBase *elems, bool onlysel);
|
2012-06-08 14:31:38 +00:00
|
|
|
|
2019-10-31 15:36:43 +01:00
|
|
|
bool ED_masklayer_frame_select_check(struct MaskLayer *mask_layer);
|
|
|
|
|
void ED_masklayer_frame_select_set(struct MaskLayer *mask_layer, short mode);
|
|
|
|
|
void ED_masklayer_frames_select_box(struct MaskLayer *mask_layer,
|
2018-10-05 10:27:04 +10:00
|
|
|
float min,
|
|
|
|
|
float max,
|
|
|
|
|
short select_mode);
|
2016-06-24 02:57:03 +12:00
|
|
|
void ED_masklayer_frames_select_region(struct KeyframeEditData *ked,
|
2019-10-31 15:36:43 +01:00
|
|
|
struct MaskLayer *mask_layer,
|
2016-06-24 02:57:03 +12:00
|
|
|
short tool,
|
|
|
|
|
short select_mode);
|
2019-10-31 15:36:43 +01:00
|
|
|
void ED_mask_select_frames(struct MaskLayer *mask_layer, short select_mode);
|
|
|
|
|
void ED_mask_select_frame(struct MaskLayer *mask_layer, int selx, short select_mode);
|
2012-06-08 14:31:38 +00:00
|
|
|
|
2019-10-31 15:36:43 +01:00
|
|
|
bool ED_masklayer_frames_delete(struct MaskLayer *mask_layer);
|
|
|
|
|
void ED_masklayer_frames_duplicate(struct MaskLayer *mask_layer);
|
2012-06-08 14:31:38 +00:00
|
|
|
|
2019-10-31 15:36:43 +01:00
|
|
|
void ED_masklayer_snap_frames(struct MaskLayer *mask_layer, struct Scene *scene, short mode);
|
2012-12-03 13:07:43 +00:00
|
|
|
|
2012-06-08 21:48:04 +00:00
|
|
|
#if 0
|
|
|
|
|
void free_gpcopybuf(void);
|
|
|
|
|
void copy_gpdata(void);
|
|
|
|
|
void paste_gpdata(void);
|
2012-06-08 14:31:38 +00:00
|
|
|
|
2019-10-31 15:36:43 +01:00
|
|
|
void mirror_masklayer_frames(struct MaskLayer *mask_layer, short mode);
|
2012-06-08 21:48:04 +00:00
|
|
|
#endif
|
2012-06-08 14:31:38 +00:00
|
|
|
|
2020-03-02 15:09:10 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|