2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2009-01-14 16:13:50 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* 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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-01-14 16:13:50 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2009 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
2011-02-27 20:29:51 +00:00
|
|
|
|
|
|
|
/** \file blender/editors/gpencil/gpencil_intern.h
|
|
|
|
* \ingroup edgpencil
|
|
|
|
*/
|
|
|
|
|
2009-01-14 16:13:50 +00:00
|
|
|
#ifndef ED_GPENCIL_INTERN_H
|
|
|
|
#define ED_GPENCIL_INTERN_H
|
|
|
|
|
|
|
|
/* internal exports only */
|
2009-08-26 12:01:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* ***************************************************** */
|
|
|
|
/* Operator Defines */
|
|
|
|
|
2011-09-06 07:59:18 +00:00
|
|
|
struct bGPdata;
|
2009-08-26 12:01:15 +00:00
|
|
|
struct wmOperatorType;
|
|
|
|
|
|
|
|
/* drawing ---------- */
|
|
|
|
|
|
|
|
void GPENCIL_OT_draw(struct wmOperatorType *ot);
|
|
|
|
|
2009-08-30 04:48:34 +00:00
|
|
|
/* Paint Modes for operator*/
|
|
|
|
typedef enum eGPencil_PaintModes {
|
|
|
|
GP_PAINTMODE_DRAW = 0,
|
|
|
|
GP_PAINTMODE_ERASER,
|
|
|
|
GP_PAINTMODE_DRAW_STRAIGHT,
|
2011-09-06 08:30:17 +00:00
|
|
|
GP_PAINTMODE_DRAW_POLY
|
2009-08-30 04:48:34 +00:00
|
|
|
} eGPencil_PaintModes;
|
|
|
|
|
2009-08-29 06:50:32 +00:00
|
|
|
/* buttons editing --- */
|
|
|
|
|
|
|
|
void GPENCIL_OT_data_add(struct wmOperatorType *ot);
|
|
|
|
void GPENCIL_OT_data_unlink(struct wmOperatorType *ot);
|
|
|
|
|
|
|
|
void GPENCIL_OT_layer_add(struct wmOperatorType *ot);
|
|
|
|
|
2009-08-31 01:58:11 +00:00
|
|
|
void GPENCIL_OT_active_frame_delete(struct wmOperatorType *ot);
|
|
|
|
|
|
|
|
void GPENCIL_OT_convert(struct wmOperatorType *ot);
|
|
|
|
|
2011-09-06 07:59:18 +00:00
|
|
|
/* undo stack ---------- */
|
|
|
|
|
|
|
|
void gpencil_undo_init(struct bGPdata *gpd);
|
|
|
|
void gpencil_undo_push(struct bGPdata *gpd);
|
|
|
|
void gpencil_undo_finish(void);
|
2009-08-26 12:01:15 +00:00
|
|
|
|
2009-01-14 16:13:50 +00:00
|
|
|
/******************************************************* */
|
2009-08-26 12:01:15 +00:00
|
|
|
/* FILTERED ACTION DATA - TYPES ---> XXX DEPRECEATED OLD ANIM SYSTEM CODE! */
|
2009-01-14 16:13:50 +00:00
|
|
|
|
2.5
Patch from Joshua, converting Grease Pencil to 2.5.
All GP data now is an ID block, allowing re-use, link and append.
For better contextual control within 2.5, these GP ID's will get
linked to actual data, like NodeTrees, Scenes, Images or Objects.
That will ensure Undo works, and opens up exciting new use cases
as well. :)
Patch note: on reading files, GPencils linked from editors will
get moved to the main library, using standard naming (indicating
where it was used), and with "Fake User" set. That way the user
can manually relink the pencils where appropriate.
We can check on just linking GP to some default, like 3d window
pencils to Scene? Nice to experiment with.
Notes for Joshua:
- for reading old GPencil, it has to use old code as well, meaning
to tread data as "indirect data, within another ID".
- Saving ID data means the chunk in file BHead needs the ID_GD code,
and not "DATA", which indicates 'indirect data'. That's the file
format spec.
- I've added do_versions_gpencil_2_50(), feel free to further tweak
things here, like linking things to scene or so.
- Formerly GPencil saved 2.50 files won't convert gpencil
2009-04-20 10:13:55 +00:00
|
|
|
/* XXX - TODO: replace this with the modern bAnimListElem... */
|
2009-01-14 16:13:50 +00:00
|
|
|
/* This struct defines a structure used for quick access */
|
|
|
|
typedef struct bActListElem {
|
|
|
|
struct bActListElem *next, *prev;
|
|
|
|
|
|
|
|
void *data; /* source data this elem represents */
|
|
|
|
int type; /* one of the ACTTYPE_* values */
|
|
|
|
int flag; /* copy of elem's flags for quick access */
|
|
|
|
int index; /* copy of adrcode where applicable */
|
|
|
|
|
|
|
|
void *key_data; /* motion data - ipo or ipo-curve */
|
|
|
|
short datatype; /* type of motion data to expect */
|
|
|
|
|
|
|
|
struct bActionGroup *grp; /* action group that owns the channel */
|
|
|
|
|
|
|
|
void *owner; /* will either be an action channel or fake ipo-channel (for keys) */
|
|
|
|
short ownertype; /* type of owner */
|
|
|
|
} bActListElem;
|
|
|
|
|
|
|
|
/******************************************************* */
|
|
|
|
/* FILTER ACTION DATA - METHODS/TYPES */
|
|
|
|
|
|
|
|
/* filtering flags - under what circumstances should a channel be added */
|
|
|
|
typedef enum ACTFILTER_FLAGS {
|
|
|
|
ACTFILTER_VISIBLE = (1<<0), /* should channels be visible */
|
|
|
|
ACTFILTER_SEL = (1<<1), /* should channels be selected */
|
|
|
|
ACTFILTER_FOREDIT = (1<<2), /* does editable status matter */
|
|
|
|
ACTFILTER_CHANNELS = (1<<3), /* do we only care that it is a channel */
|
|
|
|
ACTFILTER_IPOKEYS = (1<<4), /* only channels referencing ipo's */
|
|
|
|
ACTFILTER_ONLYICU = (1<<5), /* only reference ipo-curves */
|
|
|
|
ACTFILTER_FORDRAWING = (1<<6), /* make list for interface drawing */
|
|
|
|
ACTFILTER_ACTGROUPED = (1<<7) /* belongs to the active group */
|
|
|
|
} ACTFILTER_FLAGS;
|
|
|
|
|
|
|
|
/* Action Editor - Main Data types */
|
|
|
|
typedef enum ACTCONT_TYPES {
|
|
|
|
ACTCONT_NONE = 0,
|
|
|
|
ACTCONT_ACTION,
|
|
|
|
ACTCONT_SHAPEKEY,
|
|
|
|
ACTCONT_GPENCIL
|
|
|
|
} ACTCONT_TYPES;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* ED_GPENCIL_INTERN_H */
|
|
|
|
|