2009-01-06 21:23:42 +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-06 21:23:42 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2006 by Nicholas Bishop
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2011-02-27 20:29:51 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/** \file blender/editors/sculpt_paint/sculpt_intern.h
|
|
|
|
* \ingroup edsculpt
|
|
|
|
*/
|
|
|
|
|
2009-01-06 21:23:42 +00:00
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __SCULPT_INTERN_H__
|
|
|
|
#define __SCULPT_INTERN_H__
|
2009-01-06 21:23:42 +00:00
|
|
|
|
|
|
|
#include "DNA_listBase.h"
|
|
|
|
#include "DNA_vec_types.h"
|
2010-07-14 14:11:03 +00:00
|
|
|
#include "DNA_key_types.h"
|
|
|
|
|
2012-03-14 06:32:43 +00:00
|
|
|
#include "BLI_bitmap.h"
|
2012-12-15 15:59:25 +00:00
|
|
|
#include "BKE_pbvh.h"
|
2009-01-06 21:23:42 +00:00
|
|
|
|
2009-09-18 15:48:49 +00:00
|
|
|
struct bContext;
|
2009-01-07 04:38:30 +00:00
|
|
|
struct Brush;
|
2009-12-09 11:09:56 +00:00
|
|
|
struct KeyBlock;
|
2009-01-06 21:23:42 +00:00
|
|
|
struct Mesh;
|
2009-12-09 11:09:56 +00:00
|
|
|
struct MultiresModifierData;
|
2009-01-06 21:23:42 +00:00
|
|
|
struct Object;
|
|
|
|
struct Scene;
|
2009-01-17 16:58:05 +00:00
|
|
|
struct Sculpt;
|
2009-01-06 21:23:42 +00:00
|
|
|
struct SculptStroke;
|
|
|
|
|
|
|
|
/* Interface */
|
2010-06-02 18:04:31 +00:00
|
|
|
struct MultiresModifierData *sculpt_multires_active(struct Scene *scene, struct Object *ob);
|
2009-01-06 21:23:42 +00:00
|
|
|
|
2012-05-10 20:35:51 +00:00
|
|
|
void sculpt(struct Sculpt *sd);
|
2009-01-06 21:23:42 +00:00
|
|
|
|
2012-03-14 06:32:43 +00:00
|
|
|
int sculpt_mode_poll(struct bContext *C);
|
2012-09-23 05:33:23 +00:00
|
|
|
int sculpt_mode_poll_view3d(struct bContext *C);
|
2009-09-18 15:48:49 +00:00
|
|
|
int sculpt_poll(struct bContext *C);
|
2012-10-01 05:19:57 +00:00
|
|
|
void sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct Object *ob,
|
|
|
|
int need_pmap, int need_mask);
|
2009-09-18 15:48:49 +00:00
|
|
|
|
2011-01-31 20:02:51 +00:00
|
|
|
/* Deformed mesh sculpt */
|
2011-09-14 00:37:27 +00:00
|
|
|
void free_sculptsession_deformMats(struct SculptSession *ss);
|
2011-01-31 20:02:51 +00:00
|
|
|
|
2009-01-06 21:23:42 +00:00
|
|
|
/* Stroke */
|
2012-10-08 07:08:29 +00:00
|
|
|
int sculpt_stroke_get_location(bContext *C, float out[3], const float mouse[2]);
|
2009-01-06 21:23:42 +00:00
|
|
|
|
2010-07-14 14:11:03 +00:00
|
|
|
/* Undo */
|
|
|
|
|
2012-03-14 06:32:43 +00:00
|
|
|
typedef enum {
|
|
|
|
SCULPT_UNDO_COORDS,
|
2012-05-10 20:34:47 +00:00
|
|
|
SCULPT_UNDO_HIDDEN,
|
|
|
|
SCULPT_UNDO_MASK
|
2012-03-14 06:32:43 +00:00
|
|
|
} SculptUndoType;
|
|
|
|
|
2010-07-14 14:11:03 +00:00
|
|
|
typedef struct SculptUndoNode {
|
|
|
|
struct SculptUndoNode *next, *prev;
|
|
|
|
|
2012-03-14 06:32:43 +00:00
|
|
|
SculptUndoType type;
|
|
|
|
|
2012-05-11 08:05:47 +00:00
|
|
|
char idname[MAX_ID_NAME]; /* name instead of pointer*/
|
|
|
|
void *node; /* only during push, not valid afterwards! */
|
2010-07-14 14:11:03 +00:00
|
|
|
|
|
|
|
float (*co)[3];
|
2011-01-31 20:02:51 +00:00
|
|
|
float (*orig_co)[3];
|
2010-07-14 14:11:03 +00:00
|
|
|
short (*no)[3];
|
2012-05-10 20:34:47 +00:00
|
|
|
float *mask;
|
2010-07-14 14:11:03 +00:00
|
|
|
int totvert;
|
|
|
|
|
|
|
|
/* non-multires */
|
2012-05-11 08:05:47 +00:00
|
|
|
int maxvert; /* to verify if totvert it still the same */
|
|
|
|
int *index; /* to restore into right location */
|
2012-03-14 06:32:43 +00:00
|
|
|
BLI_bitmap vert_hidden;
|
2010-07-14 14:11:03 +00:00
|
|
|
|
|
|
|
/* multires */
|
2012-05-11 08:05:47 +00:00
|
|
|
int maxgrid; /* same for grid */
|
|
|
|
int gridsize; /* same for grid */
|
|
|
|
int totgrid; /* to restore into right location */
|
|
|
|
int *grids; /* to restore into right location */
|
2012-03-14 06:32:43 +00:00
|
|
|
BLI_bitmap *grid_hidden;
|
2010-07-14 14:11:03 +00:00
|
|
|
|
|
|
|
/* shape keys */
|
2011-03-05 10:37:59 +00:00
|
|
|
char shapeName[sizeof(((KeyBlock *)0))->name];
|
2010-07-14 14:11:03 +00:00
|
|
|
} SculptUndoNode;
|
|
|
|
|
2012-03-14 06:32:43 +00:00
|
|
|
SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType type);
|
2010-07-14 14:11:03 +00:00
|
|
|
SculptUndoNode *sculpt_undo_get_node(PBVHNode *node);
|
2010-12-03 17:05:21 +00:00
|
|
|
void sculpt_undo_push_begin(const char *name);
|
2010-07-14 14:11:03 +00:00
|
|
|
void sculpt_undo_push_end(void);
|
|
|
|
|
|
|
|
void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3]);
|
|
|
|
|
2009-01-06 21:23:42 +00:00
|
|
|
#endif
|