2012-04-30 16:24:11 +02:00
|
|
|
/*
|
2011-05-24 09:08:58 +02: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.
|
|
|
|
*
|
2012-04-30 16:24:11 +02:00
|
|
|
* 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.
|
2011-05-24 09:08:58 +02:00
|
|
|
*/
|
|
|
|
|
2012-02-17 19:59:41 +01:00
|
|
|
#ifndef __BKE_DYNAMICPAINT_H__
|
|
|
|
#define __BKE_DYNAMICPAINT_H__
|
2011-05-24 09:08:58 +02:00
|
|
|
|
2019-02-17 22:08:12 +01:00
|
|
|
/** \file
|
|
|
|
* \ingroup bke
|
2012-04-30 16:24:11 +02:00
|
|
|
*/
|
|
|
|
|
2018-04-06 12:07:27 +02:00
|
|
|
struct Depsgraph;
|
2018-06-20 18:42:11 +02:00
|
|
|
struct DynamicPaintCanvasSettings;
|
|
|
|
struct DynamicPaintModifierData;
|
2019-03-26 00:15:46 +01:00
|
|
|
struct DynamicPaintRuntime;
|
Fix #36058: Displace Modifier errors using a baked Image and displace baking inconsistency between 2.67/2.68RC and previous versions
This was in fact really nasty bug, caused by multitex_nodes
function using global variable R (which is a copy of current
renderer). this variable is not initialized to anything
meaningful for until first rendering (preview or final)
happened.
Since multitex_nodes might be used outside of render pipeline,
made it so whether CM is on or off as an argument to functions
multitex_ext_safe and multitex_ext. Now multitex_nodes() is
only shall be used for stuff happening from render pipeline!
Also needed to make some changes to other places, so all the
usages of texture sampling knows for the fact whether CM is
on or off.
And one more change is related on behavior of dispalcement,
wave, warp, weightvg modifiers and smoke. They'll be always
using CM off since texture is used for influence, not for
color.
It's rather bigger patch, but it's mostly straightforward
changes, which we really need to be done.
Reviewed by Brecht, thanks!
2013-07-15 16:47:58 +02:00
|
|
|
struct Scene;
|
2011-06-27 09:30:58 +02:00
|
|
|
|
2018-11-14 07:12:52 +01:00
|
|
|
/* Actual surface point */
|
2011-06-16 12:41:00 +02:00
|
|
|
typedef struct PaintSurfaceData {
|
2019-04-17 06:17:24 +02:00
|
|
|
void *format_data; /* special data for each surface "format" */
|
|
|
|
void *type_data; /* data used by specific surface type */
|
|
|
|
struct PaintAdjData *adj_data; /* adjacency data for current surface */
|
2011-08-21 21:03:47 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
struct PaintBakeData *bData; /* temporary per step data used for frame calculation */
|
|
|
|
int total_points;
|
2011-05-24 09:08:58 +02:00
|
|
|
|
2011-06-16 12:41:00 +02:00
|
|
|
} PaintSurfaceData;
|
|
|
|
|
2018-11-14 07:12:52 +01:00
|
|
|
/* Paint type surface point */
|
2011-06-16 12:41:00 +02:00
|
|
|
typedef struct PaintPoint {
|
2011-05-24 09:08:58 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
/* Wet paint is handled at effect layer only
|
|
|
|
* and mixed to surface when drying */
|
|
|
|
float e_color[4];
|
|
|
|
float wetness;
|
|
|
|
short state;
|
|
|
|
float color[4];
|
2011-06-16 12:41:00 +02:00
|
|
|
} PaintPoint;
|
2011-05-24 09:08:58 +02:00
|
|
|
|
2018-11-14 07:12:52 +01:00
|
|
|
/* height field waves */
|
2018-06-17 17:05:51 +02:00
|
|
|
typedef struct PaintWavePoint {
|
2011-05-24 09:08:58 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
float height;
|
|
|
|
float velocity;
|
|
|
|
float brush_isect;
|
|
|
|
short state;
|
2011-07-02 20:06:39 +02:00
|
|
|
} PaintWavePoint;
|
2011-05-24 09:08:58 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
struct Mesh *dynamicPaint_Modifier_do(struct DynamicPaintModifierData *pmd,
|
|
|
|
struct Depsgraph *depsgraph,
|
|
|
|
struct Scene *scene,
|
|
|
|
struct Object *ob,
|
|
|
|
struct Mesh *me);
|
2012-05-12 22:39:39 +02:00
|
|
|
void dynamicPaint_Modifier_free(struct DynamicPaintModifierData *pmd);
|
2019-03-20 14:56:20 +01:00
|
|
|
void dynamicPaint_Modifier_free_runtime(struct DynamicPaintRuntime *runtime);
|
2018-11-20 10:22:32 +01:00
|
|
|
void dynamicPaint_Modifier_copy(const struct DynamicPaintModifierData *pmd,
|
|
|
|
struct DynamicPaintModifierData *tsmd,
|
|
|
|
int flag);
|
2011-05-24 09:08:58 +02:00
|
|
|
|
2014-02-05 12:36:15 +01:00
|
|
|
bool dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene);
|
2019-04-17 06:17:24 +02:00
|
|
|
struct DynamicPaintSurface *dynamicPaint_createNewSurface(
|
|
|
|
struct DynamicPaintCanvasSettings *canvas, struct Scene *scene);
|
2015-03-21 12:10:43 +01:00
|
|
|
void dynamicPaint_clearSurface(const struct Scene *scene, struct DynamicPaintSurface *surface);
|
|
|
|
bool dynamicPaint_resetSurface(const struct Scene *scene, struct DynamicPaintSurface *surface);
|
2018-11-20 10:22:32 +01:00
|
|
|
void dynamicPaint_freeSurface(const struct DynamicPaintModifierData *pmd,
|
|
|
|
struct DynamicPaintSurface *surface);
|
2011-09-05 18:04:15 +02:00
|
|
|
void dynamicPaint_freeCanvas(struct DynamicPaintModifierData *pmd);
|
|
|
|
void dynamicPaint_freeBrush(struct DynamicPaintModifierData *pmd);
|
2011-10-13 22:00:22 +02:00
|
|
|
void dynamicPaint_freeSurfaceData(struct DynamicPaintSurface *surface);
|
2011-09-05 18:04:15 +02:00
|
|
|
|
2016-12-28 17:30:58 +01:00
|
|
|
void dynamicPaint_cacheUpdateFrames(struct DynamicPaintSurface *surface);
|
2019-04-17 06:17:24 +02:00
|
|
|
bool dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface,
|
|
|
|
struct Object *ob,
|
|
|
|
int output);
|
2011-07-02 20:06:39 +02:00
|
|
|
void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface);
|
2011-11-10 13:28:26 +01:00
|
|
|
void dynamicPaintSurface_setUniqueName(struct DynamicPaintSurface *surface, const char *basename);
|
2011-09-05 18:04:15 +02:00
|
|
|
struct DynamicPaintSurface *get_activeSurface(struct DynamicPaintCanvasSettings *canvas);
|
|
|
|
|
2011-10-13 22:00:22 +02:00
|
|
|
/* image sequence baking */
|
2019-04-17 06:17:24 +02:00
|
|
|
int dynamicPaint_createUVSurface(struct Scene *scene,
|
|
|
|
struct DynamicPaintSurface *surface,
|
|
|
|
float *progress,
|
|
|
|
short *do_update);
|
|
|
|
int dynamicPaint_calculateFrame(struct DynamicPaintSurface *surface,
|
|
|
|
struct Depsgraph *depsgraph,
|
|
|
|
struct Scene *scene,
|
|
|
|
struct Object *cObject,
|
|
|
|
int frame);
|
|
|
|
void dynamicPaint_outputSurfaceImage(struct DynamicPaintSurface *surface,
|
|
|
|
char *filename,
|
|
|
|
short output_layer);
|
2011-10-28 16:46:09 +02:00
|
|
|
|
|
|
|
/* PaintPoint state */
|
|
|
|
#define DPAINT_PAINT_NONE -1
|
|
|
|
#define DPAINT_PAINT_DRY 0
|
|
|
|
#define DPAINT_PAINT_WET 1
|
|
|
|
#define DPAINT_PAINT_NEW 2
|
|
|
|
|
|
|
|
/* PaintWavePoint state */
|
2011-11-16 19:32:28 +01:00
|
|
|
#define DPAINT_WAVE_ISECT_CHANGED -1
|
2011-10-28 16:46:09 +02:00
|
|
|
#define DPAINT_WAVE_NONE 0
|
|
|
|
#define DPAINT_WAVE_OBSTACLE 1
|
|
|
|
#define DPAINT_WAVE_REFLECT_ONLY 2
|
2011-07-02 20:06:39 +02:00
|
|
|
|
2012-02-17 19:59:41 +01:00
|
|
|
#endif /* __BKE_DYNAMICPAINT_H__ */
|