2012-03-18 09:27:36 +00:00
|
|
|
/*
|
2011-05-24 07:08:58 +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.
|
|
|
|
|
*
|
2012-03-18 09:27:36 +00: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-11-10 12:28:26 +00:00
|
|
|
* Contributor(s): Miika Hämäläinen
|
2011-05-24 07:08:58 +00:00
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
2012-03-18 09:27:36 +00:00
|
|
|
/** \file blender/makesrna/intern/rna_dynamicpaint.c
|
|
|
|
|
* \ingroup RNA
|
|
|
|
|
*/
|
|
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <limits.h>
|
|
|
|
|
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
#include "BLI_math_base.h"
|
|
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
#include "BKE_modifier.h"
|
|
|
|
|
#include "BKE_dynamicpaint.h"
|
|
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
#include "DNA_dynamicpaint_types.h"
|
2011-05-24 07:08:58 +00:00
|
|
|
#include "DNA_modifier_types.h"
|
2011-06-16 10:41:00 +00:00
|
|
|
#include "DNA_object_force.h"
|
2011-05-24 07:08:58 +00:00
|
|
|
#include "DNA_object_types.h"
|
|
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
|
|
2013-03-07 02:44:55 +00:00
|
|
|
#include "RNA_define.h"
|
2013-09-11 21:27:14 +00:00
|
|
|
#include "RNA_enum_types.h"
|
2013-03-07 02:44:55 +00:00
|
|
|
|
|
|
|
|
#include "rna_internal.h"
|
|
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
2015-11-23 13:49:52 +11:00
|
|
|
EnumPropertyItem rna_enum_prop_dynamicpaint_type_items[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{MOD_DYNAMICPAINT_TYPE_CANVAS, "CANVAS", 0, "Canvas", ""},
|
|
|
|
|
{MOD_DYNAMICPAINT_TYPE_BRUSH, "BRUSH", 0, "Brush", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2011-07-08 11:03:37 +00:00
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
|
#ifdef RNA_RUNTIME
|
|
|
|
|
|
|
|
|
|
#include "BKE_context.h"
|
|
|
|
|
#include "BKE_depsgraph.h"
|
|
|
|
|
#include "BKE_particle.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static char *rna_DynamicPaintCanvasSettings_path(PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
DynamicPaintCanvasSettings *settings = (DynamicPaintCanvasSettings *)ptr->data;
|
2012-03-05 23:30:41 +00:00
|
|
|
ModifierData *md = (ModifierData *)settings->pmd;
|
2013-04-23 20:10:22 +00:00
|
|
|
char name_esc[sizeof(md->name) * 2];
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2013-04-23 20:10:22 +00:00
|
|
|
BLI_strescape(name_esc, md->name, sizeof(name_esc));
|
|
|
|
|
return BLI_sprintfN("modifiers[\"%s\"].canvas_settings", name_esc);
|
2011-05-24 07:08:58 +00:00
|
|
|
}
|
|
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
static char *rna_DynamicPaintBrushSettings_path(PointerRNA *ptr)
|
2011-05-24 07:08:58 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
DynamicPaintBrushSettings *settings = (DynamicPaintBrushSettings *)ptr->data;
|
2012-03-05 23:30:41 +00:00
|
|
|
ModifierData *md = (ModifierData *)settings->pmd;
|
2013-04-23 20:10:22 +00:00
|
|
|
char name_esc[sizeof(md->name) * 2];
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2013-04-23 20:10:22 +00:00
|
|
|
BLI_strescape(name_esc, md->name, sizeof(name_esc));
|
|
|
|
|
return BLI_sprintfN("modifiers[\"%s\"].brush_settings", name_esc);
|
2011-05-24 07:08:58 +00:00
|
|
|
}
|
|
|
|
|
|
2011-06-18 18:41:20 +00:00
|
|
|
static char *rna_DynamicPaintSurface_path(PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data;
|
2012-03-05 23:30:41 +00:00
|
|
|
ModifierData *md = (ModifierData *)surface->canvas->pmd;
|
2013-04-23 20:10:22 +00:00
|
|
|
char name_esc[sizeof(md->name) * 2];
|
|
|
|
|
char name_esc_surface[sizeof(surface->name) * 2];
|
2011-06-18 18:41:20 +00:00
|
|
|
|
2013-04-23 20:10:22 +00:00
|
|
|
BLI_strescape(name_esc, md->name, sizeof(name_esc));
|
|
|
|
|
BLI_strescape(name_esc_surface, surface->name, sizeof(name_esc_surface));
|
|
|
|
|
return BLI_sprintfN("modifiers[\"%s\"].canvas_settings.canvas_surfaces[\"%s\"]", name_esc, name_esc_surface);
|
2011-06-18 18:41:20 +00:00
|
|
|
}
|
|
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
|
|
|
|
|
/*
|
2012-03-09 18:28:30 +00:00
|
|
|
* Surfaces
|
|
|
|
|
*/
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2013-09-20 06:35:28 +00:00
|
|
|
static void rna_DynamicPaint_redoModifier(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
2011-06-16 10:41:00 +00:00
|
|
|
{
|
|
|
|
|
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-20 06:35:28 +00:00
|
|
|
static void rna_DynamicPaintSurfaces_updateFrames(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
2011-06-16 10:41:00 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
dynamicPaint_cacheUpdateFrames((DynamicPaintSurface *)ptr->data);
|
2011-06-16 10:41:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_DynamicPaintSurface_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
|
|
|
|
|
{
|
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 14:47:58 +00:00
|
|
|
dynamicPaint_resetSurface(scene, (DynamicPaintSurface *)ptr->data);
|
2011-06-16 10:41:00 +00:00
|
|
|
rna_DynamicPaint_redoModifier(bmain, scene, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
2011-09-05 16:04:15 +00:00
|
|
|
static void rna_DynamicPaintSurface_initialcolortype(Main *bmain, Scene *scene, PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data;
|
2011-09-05 16:04:15 +00:00
|
|
|
|
|
|
|
|
surface->init_layername[0] = '\0';
|
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 14:47:58 +00:00
|
|
|
dynamicPaint_clearSurface(scene, surface);
|
2011-09-05 16:04:15 +00:00
|
|
|
rna_DynamicPaint_redoModifier(bmain, scene, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
static void rna_DynamicPaintSurface_changePreview(Main *bmain, Scene *scene, PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
DynamicPaintSurface *act_surface = (DynamicPaintSurface *)ptr->data;
|
2011-06-16 10:41:00 +00:00
|
|
|
DynamicPaintSurface *surface = act_surface->canvas->surfaces.first;
|
|
|
|
|
|
|
|
|
|
/* since only one color surface can show preview at time
|
2012-03-09 18:28:30 +00:00
|
|
|
* disable preview on other surfaces*/
|
2012-03-05 23:30:41 +00:00
|
|
|
for (; surface; surface = surface->next) {
|
|
|
|
|
if (surface != act_surface)
|
2011-06-16 10:41:00 +00:00
|
|
|
surface->flags &= ~MOD_DPAINT_PREVIEW;
|
|
|
|
|
}
|
|
|
|
|
rna_DynamicPaint_redoModifier(bmain, scene, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-20 06:35:28 +00:00
|
|
|
static void rna_DynamicPaintSurface_uniqueName(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
2011-06-16 10:41:00 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
dynamicPaintSurface_setUniqueName((DynamicPaintSurface *)ptr->data, ((DynamicPaintSurface *)ptr->data)->name);
|
2011-06-16 10:41:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void rna_DynamicPaintSurface_changeType(Main *bmain, Scene *scene, PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
dynamicPaintSurface_updateType((DynamicPaintSurface *)ptr->data);
|
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 14:47:58 +00:00
|
|
|
dynamicPaint_resetSurface(scene, (DynamicPaintSurface *)ptr->data);
|
2011-06-16 10:41:00 +00:00
|
|
|
rna_DynamicPaintSurface_reset(bmain, scene, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_DynamicPaintSurfaces_changeFormat(Main *bmain, Scene *scene, PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data;
|
2011-06-16 10:41:00 +00:00
|
|
|
|
|
|
|
|
surface->type = MOD_DPAINT_SURFACE_T_PAINT;
|
2012-05-12 11:01:29 +00:00
|
|
|
dynamicPaintSurface_updateType((DynamicPaintSurface *)ptr->data);
|
2011-06-16 10:41:00 +00:00
|
|
|
rna_DynamicPaintSurface_reset(bmain, scene, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-17 01:54:37 +11:00
|
|
|
static void rna_DynamicPaint_reset_dependency(Main *bmain, Scene *scene, PointerRNA *ptr)
|
2011-07-08 11:03:37 +00:00
|
|
|
{
|
|
|
|
|
rna_DynamicPaintSurface_reset(bmain, scene, ptr);
|
2013-02-21 19:33:04 +00:00
|
|
|
DAG_relations_tag_update(bmain);
|
2011-07-08 11:03:37 +00:00
|
|
|
}
|
|
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
static PointerRNA rna_PaintSurface_active_get(PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data;
|
2011-06-16 10:41:00 +00:00
|
|
|
DynamicPaintSurface *surface = canvas->surfaces.first;
|
2012-03-05 23:30:41 +00:00
|
|
|
int id = 0;
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
for (; surface; surface = surface->next) {
|
|
|
|
|
if (id == canvas->active_sur)
|
2011-06-16 10:41:00 +00:00
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_DynamicPaintSurface, surface);
|
|
|
|
|
id++;
|
|
|
|
|
}
|
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_DynamicPaintSurface, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_DynamicPaint_surfaces_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data;
|
2012-07-29 16:59:51 +00:00
|
|
|
/*rna_iterator_array_begin(iter, (void *)canvas->surfaces, sizeof(PaintSurface), canvas->totsur, 0, 0); */
|
2011-06-16 10:41:00 +00:00
|
|
|
rna_iterator_listbase_begin(iter, &canvas->surfaces, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int rna_Surface_active_point_index_get(PointerRNA *ptr)
|
2011-05-24 07:08:58 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data;
|
2011-06-16 10:41:00 +00:00
|
|
|
return canvas->active_sur;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Surface_active_point_index_set(struct PointerRNA *ptr, int value)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data;
|
2011-06-16 10:41:00 +00:00
|
|
|
canvas->active_sur = value;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-20 06:35:28 +00:00
|
|
|
static void rna_Surface_active_point_range(PointerRNA *ptr, int *min, int *max,
|
|
|
|
|
int *UNUSED(softmin), int *UNUSED(softmax))
|
2011-06-16 10:41:00 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data;
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
*min = 0;
|
2014-11-16 13:57:58 +01:00
|
|
|
*max = BLI_listbase_count(&canvas->surfaces) - 1;
|
2011-06-16 10:41:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* uvlayer */
|
|
|
|
|
static void rna_DynamicPaint_uvlayer_set(PointerRNA *ptr, const char *value)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
DynamicPaintCanvasSettings *canvas = ((DynamicPaintSurface *)ptr->data)->canvas;
|
2011-06-16 10:41:00 +00:00
|
|
|
DynamicPaintSurface *surface = canvas->surfaces.first;
|
2012-03-05 23:30:41 +00:00
|
|
|
int id = 0;
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
for (; surface; surface = surface->next) {
|
|
|
|
|
if (id == canvas->active_sur) {
|
2011-06-16 10:41:00 +00:00
|
|
|
rna_object_uvlayer_name_set(ptr, value, surface->uvlayer_name, sizeof(surface->uvlayer_name));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
id++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* is point cache used */
|
2011-11-14 07:07:59 +00:00
|
|
|
static int rna_DynamicPaint_is_cache_user_get(PointerRNA *ptr)
|
2011-06-16 10:41:00 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data;
|
2011-06-16 10:41:00 +00:00
|
|
|
|
|
|
|
|
return (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) ? 1 : 0;
|
|
|
|
|
}
|
|
|
|
|
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
/* is some 3D view preview available */
|
|
|
|
|
static int rna_DynamicPaint_use_color_preview_get(PointerRNA *ptr)
|
|
|
|
|
{
|
|
|
|
|
DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data;
|
|
|
|
|
|
|
|
|
|
return dynamicPaint_surfaceHasColorPreview(surface);
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-03 18:31:48 +00:00
|
|
|
/* does output layer exist*/
|
|
|
|
|
static int rna_DynamicPaint_is_output_exists(DynamicPaintSurface *surface, Object *ob, int index)
|
|
|
|
|
{
|
|
|
|
|
return dynamicPaint_outputLayerExists(surface, ob, index);
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2013-09-20 06:35:28 +00:00
|
|
|
static EnumPropertyItem *rna_DynamicPaint_surface_type_itemf(
|
2014-01-04 18:08:43 +11:00
|
|
|
bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
|
2011-06-16 10:41:00 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data;
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
EnumPropertyItem *item = NULL;
|
|
|
|
|
EnumPropertyItem tmp = {0, "", 0, "", ""};
|
|
|
|
|
int totitem = 0;
|
2011-06-16 10:41:00 +00:00
|
|
|
|
|
|
|
|
/* Paint type - available for all formats */
|
|
|
|
|
tmp.value = MOD_DPAINT_SURFACE_T_PAINT;
|
|
|
|
|
tmp.identifier = "PAINT";
|
|
|
|
|
tmp.name = "Paint";
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
tmp.icon = ICON_TPAINT_HLT;
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_enum_item_add(&item, &totitem, &tmp);
|
|
|
|
|
|
|
|
|
|
/* Displace */
|
|
|
|
|
if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX ||
|
2012-05-20 19:49:27 +00:00
|
|
|
surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ)
|
|
|
|
|
{
|
2011-06-16 10:41:00 +00:00
|
|
|
tmp.value = MOD_DPAINT_SURFACE_T_DISPLACE;
|
|
|
|
|
tmp.identifier = "DISPLACE";
|
|
|
|
|
tmp.name = "Displace";
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
tmp.icon = ICON_MOD_DISPLACE;
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_enum_item_add(&item, &totitem, &tmp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Weight */
|
2011-06-18 18:41:20 +00:00
|
|
|
if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
|
2011-06-16 10:41:00 +00:00
|
|
|
tmp.value = MOD_DPAINT_SURFACE_T_WEIGHT;
|
|
|
|
|
tmp.identifier = "WEIGHT";
|
|
|
|
|
tmp.name = "Weight";
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
tmp.icon = ICON_MOD_VERTEX_WEIGHT;
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_enum_item_add(&item, &totitem, &tmp);
|
2011-06-18 18:41:20 +00:00
|
|
|
}
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2011-07-02 18:06:39 +00:00
|
|
|
/* Height waves */
|
|
|
|
|
{
|
|
|
|
|
tmp.value = MOD_DPAINT_SURFACE_T_WAVE;
|
|
|
|
|
tmp.identifier = "WAVE";
|
|
|
|
|
tmp.name = "Waves";
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
tmp.icon = ICON_MOD_WAVE;
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_enum_item_add(&item, &totitem, &tmp);
|
2011-07-02 18:06:39 +00:00
|
|
|
}
|
2011-06-16 10:41:00 +00:00
|
|
|
|
|
|
|
|
RNA_enum_item_end(&item, &totitem);
|
2014-01-04 18:08:43 +11:00
|
|
|
*r_free = true;
|
2011-06-16 10:41:00 +00:00
|
|
|
|
|
|
|
|
return item;
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
#else
|
|
|
|
|
|
2011-06-18 18:41:20 +00:00
|
|
|
/* canvas.canvas_surfaces */
|
|
|
|
|
static void rna_def_canvas_surfaces(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "DynamicPaintSurfaces");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "DynamicPaintSurfaces", NULL);
|
2011-06-18 18:41:20 +00:00
|
|
|
RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Canvas Surfaces", "Collection of Dynamic Paint Canvas surfaces");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
|
2011-06-18 18:41:20 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_int_funcs(prop, "rna_Surface_active_point_index_get", "rna_Surface_active_point_index_set",
|
|
|
|
|
"rna_Surface_active_point_range");
|
2011-06-18 18:41:20 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Active Point Cache Index", "");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
|
2011-06-18 18:41:20 +00:00
|
|
|
RNA_def_property_struct_type(prop, "DynamicPaintSurface");
|
|
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_PaintSurface_active_get", NULL, NULL, NULL);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Active Surface", "Active Dynamic Paint surface being displayed");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
|
2011-06-18 18:41:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void rna_def_canvas_surface(BlenderRNA *brna)
|
2011-05-24 07:08:58 +00:00
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2011-08-03 18:31:48 +00:00
|
|
|
PropertyRNA *parm;
|
|
|
|
|
FunctionRNA *func;
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
/* Surface format */
|
|
|
|
|
static EnumPropertyItem prop_dynamicpaint_surface_format[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
/*{MOD_DPAINT_SURFACE_F_PTEX, "PTEX", ICON_TEXTURE_SHADED, "Ptex", ""}, */
|
|
|
|
|
{MOD_DPAINT_SURFACE_F_VERTEX, "VERTEX", ICON_OUTLINER_DATA_MESH, "Vertex", ""},
|
|
|
|
|
{MOD_DPAINT_SURFACE_F_IMAGESEQ, "IMAGE", ICON_FILE_IMAGE, "Image Sequence", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2011-06-16 10:41:00 +00:00
|
|
|
|
|
|
|
|
/* Surface type - generated dynamically based on surface format */
|
|
|
|
|
static EnumPropertyItem prop_dynamicpaint_surface_type[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{MOD_DPAINT_SURFACE_T_PAINT, "PAINT", 0, "Paint", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2011-08-28 16:36:47 +00:00
|
|
|
/* Surface output preview. currently only paint has multiple outputs */
|
|
|
|
|
static EnumPropertyItem prop_dynamicpaint_surface_preview[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{MOD_DPAINT_SURFACE_PREV_PAINT, "PAINT", 0, "Paint", ""},
|
|
|
|
|
{MOD_DPAINT_SURFACE_PREV_WETMAP, "WETMAP", 0, "Wetmap", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2011-08-28 16:36:47 +00:00
|
|
|
|
2011-09-05 16:04:15 +00:00
|
|
|
/* Initial color setting */
|
|
|
|
|
static EnumPropertyItem prop_dynamicpaint_init_color_type[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{MOD_DPAINT_INITIAL_NONE, "NONE", 0, "None", ""},
|
|
|
|
|
{MOD_DPAINT_INITIAL_COLOR, "COLOR", ICON_COLOR, "Color", ""},
|
|
|
|
|
{MOD_DPAINT_INITIAL_TEXTURE, "TEXTURE", ICON_TEXTURE, "UV Texture", ""},
|
|
|
|
|
{MOD_DPAINT_INITIAL_VERTEXCOLOR, "VERTEX_COLOR", ICON_GROUP_VCOL, "Vertex Color", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2011-09-05 16:04:15 +00:00
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
/* Effect type
|
2012-03-09 18:28:30 +00:00
|
|
|
* Only used by ui to view per effect settings */
|
2011-05-24 07:08:58 +00:00
|
|
|
static EnumPropertyItem prop_dynamicpaint_effecttype[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{1, "SPREAD", 0, "Spread", ""},
|
|
|
|
|
{2, "DRIP", 0, "Drip", ""},
|
|
|
|
|
{3, "SHRINK", 0, "Shrink", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
/* Displacemap file format */
|
|
|
|
|
static EnumPropertyItem prop_dynamicpaint_image_fileformat[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{MOD_DPAINT_IMGFORMAT_PNG, "PNG", 0, "PNG", ""},
|
2011-05-24 07:08:58 +00:00
|
|
|
#ifdef WITH_OPENEXR
|
2012-05-12 11:01:29 +00:00
|
|
|
{MOD_DPAINT_IMGFORMAT_OPENEXR, "OPENEXR", 0, "OpenEXR", ""},
|
2011-05-24 07:08:58 +00:00
|
|
|
#endif
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
/* Displacemap type */
|
2011-10-28 14:46:09 +00:00
|
|
|
static EnumPropertyItem prop_dynamicpaint_displace_type[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{MOD_DPAINT_DISP_DISPLACE, "DISPLACE", 0, "Displacement", ""},
|
|
|
|
|
{MOD_DPAINT_DISP_DEPTH, "DEPTH", 0, "Depth", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Surface */
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "DynamicPaintSurface", NULL);
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_def_struct_sdna(srna, "DynamicPaintSurface");
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Paint Surface", "A canvas surface layer");
|
2011-06-18 18:41:20 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_DynamicPaintSurface_path");
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "surface_format", PROP_ENUM, PROP_NONE);
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "format");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_format);
|
2011-08-21 19:03:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Format", "Surface Format");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurfaces_changeFormat");
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "surface_type", PROP_ENUM, PROP_NONE);
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "type");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_type);
|
|
|
|
|
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_DynamicPaint_surface_type_itemf");
|
2011-08-21 19:03:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Surface Type", "Surface Type");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_changeType");
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "is_active", PROP_BOOLEAN, PROP_NONE);
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ACTIVE);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Is Active", "Toggle whether surface is processed or ignored");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "show_preview", PROP_BOOLEAN, PROP_NONE);
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PREVIEW);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Show Preview", "Display surface preview in 3D-views");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_changePreview");
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Name", "Surface name");
|
|
|
|
|
RNA_def_property_update(prop, NC_OBJECT, "rna_DynamicPaintSurface_uniqueName");
|
|
|
|
|
RNA_def_struct_name_property(srna, prop);
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "brush_group", PROP_POINTER, PROP_NONE);
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_def_property_struct_type(prop, "Group");
|
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Brush Group", "Only use brush objects from this group");
|
2014-01-17 01:54:37 +11:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_reset_dependency");
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
|
/*
|
2012-03-09 18:28:30 +00:00
|
|
|
* Paint, wet and displace
|
|
|
|
|
*/
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_dissolve", PROP_BOOLEAN, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Dissolve", "Enable to make surface changes disappear over time");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "diss_speed");
|
|
|
|
|
RNA_def_property_range(prop, 1.0, 10000.0);
|
2013-04-08 18:55:08 +00:00
|
|
|
RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, -1);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Dissolve Speed", "Approximately in how many frames should dissolve happen");
|
2012-01-16 17:18:07 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_drying", PROP_BOOLEAN, PROP_NONE);
|
2012-01-16 17:18:07 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_USE_DRYING);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Dry", "Enable to make surface wetness dry over time");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "dry_speed", PROP_INT, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_range(prop, 1.0, 10000.0);
|
2013-04-08 18:55:08 +00:00
|
|
|
RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, -1);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Dry Speed", "Approximately in how many frames should drying happen");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
|
/*
|
2012-03-09 18:28:30 +00:00
|
|
|
* Simulation settings
|
|
|
|
|
*/
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "image_resolution", PROP_INT, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_range(prop, 16.0, 4096.0);
|
2013-04-08 18:55:08 +00:00
|
|
|
RNA_def_property_ui_range(prop, 16.0, 4096.0, 1, -1);
|
2011-08-21 19:03:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Resolution", "Output image resolution");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
|
2011-11-23 17:25:25 +00:00
|
|
|
RNA_def_property_ui_text(prop, "UV Map", "UV map name");
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DynamicPaint_uvlayer_set");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
|
2011-10-28 14:46:09 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "start_frame");
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2013-10-29 16:06:21 +00:00
|
|
|
RNA_def_property_range(prop, 1.0, MAXFRAMEF);
|
2013-04-08 18:55:08 +00:00
|
|
|
RNA_def_property_ui_range(prop, 1.0, 9999, 1, -1);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Start Frame", "Simulation start frame");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
|
2011-10-28 14:46:09 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "end_frame");
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2013-10-29 16:06:21 +00:00
|
|
|
RNA_def_property_range(prop, 1.0, MAXFRAMEF);
|
2013-04-08 18:55:08 +00:00
|
|
|
RNA_def_property_ui_range(prop, 1.0, 9999.0, 1, -1);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "End Frame", "Simulation end frame");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "frame_substeps", PROP_INT, PROP_NONE);
|
2011-10-28 14:46:09 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "substeps");
|
2011-12-31 10:28:36 +00:00
|
|
|
RNA_def_property_range(prop, 0.0, 20.0);
|
2013-04-08 18:55:08 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0.0, 10, 1, -1);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Sub-Steps", "Do extra frames between scene frames to ensure smooth motion");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
|
2011-06-18 18:41:20 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ANTIALIAS);
|
2012-07-04 15:04:38 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Anti-aliasing", "Use 5x multisampling to smooth paint edges");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "brush_influence_scale", PROP_FLOAT, PROP_FACTOR);
|
2012-01-16 17:18:07 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "influence_scale");
|
|
|
|
|
RNA_def_property_range(prop, 0.0, 1.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Influence Scale", "Adjust influence brush objects have on this surface");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2012-01-16 17:18:07 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "brush_radius_scale", PROP_FLOAT, PROP_FACTOR);
|
2012-01-16 17:18:07 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "radius_scale");
|
|
|
|
|
RNA_def_property_range(prop, 0.0, 10.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Radius Scale", "Adjust radius of proximity brushes or particles for this surface");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2012-01-16 17:18:07 +00:00
|
|
|
|
2011-09-05 16:04:15 +00:00
|
|
|
/*
|
2012-03-09 18:28:30 +00:00
|
|
|
* Initial Color
|
|
|
|
|
*/
|
2011-09-05 16:04:15 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "init_color_type", PROP_ENUM, PROP_NONE);
|
2011-09-05 16:04:15 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_init_color_type);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Initial Color", "");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING_DRAW | ND_MODIFIER, "rna_DynamicPaintSurface_initialcolortype");
|
2011-09-05 16:04:15 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "init_color", PROP_FLOAT, PROP_COLOR_GAMMA);
|
2012-01-16 17:18:07 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-09-05 16:04:15 +00:00
|
|
|
RNA_def_property_array(prop, 4);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Color", "Initial color of the surface");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING_DRAW | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
|
2011-09-05 16:04:15 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "init_texture", PROP_POINTER, PROP_NONE);
|
2011-09-05 16:04:15 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Texture", "");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING_DRAW | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
|
2011-09-05 16:04:15 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "init_layername", PROP_STRING, PROP_NONE);
|
2011-09-05 16:04:15 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Data Layer", "");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING_DRAW | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
|
2011-09-05 16:04:15 +00:00
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
/*
|
2012-03-09 18:28:30 +00:00
|
|
|
* Effect Settings
|
|
|
|
|
*/
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "effect_ui", PROP_ENUM, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_effecttype);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Effect Type", "");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_dry_log", PROP_BOOLEAN, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DRY_LOG);
|
2011-11-22 18:18:16 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Slow", "Use logarithmic drying (makes high values to dry faster than low values)");
|
2011-06-18 18:41:20 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_dissolve_log", PROP_BOOLEAN, PROP_NONE);
|
2011-06-18 18:41:20 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE_LOG);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Slow",
|
|
|
|
|
"Use logarithmic dissolve (makes high values to fade faster than low values)");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_spread", PROP_BOOLEAN, PROP_NONE);
|
2011-07-08 11:03:37 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SPREAD);
|
2011-11-14 19:13:52 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Spread", "Process spread effect (spread wet paint around surface)");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "spread_speed", PROP_FLOAT, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "spread_speed");
|
2011-07-03 14:01:57 +00:00
|
|
|
RNA_def_property_range(prop, 0.001, 10.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Spread Speed", "How fast spread effect moves on the canvas surface");
|
2011-08-05 09:31:35 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "color_dry_threshold", PROP_FLOAT, PROP_FACTOR);
|
2012-01-16 17:18:07 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "color_dry_threshold");
|
|
|
|
|
RNA_def_property_range(prop, 0.0, 1.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Color Dry", "The wetness level when colors start to shift to the background");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "color_spread_speed", PROP_FLOAT, PROP_NONE);
|
2011-08-05 09:31:35 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "color_spread_speed");
|
|
|
|
|
RNA_def_property_range(prop, 0.0, 2.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0, 2.0, 1, 2);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Color Spread", "How fast colors get mixed within wet paint");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_drip", PROP_BOOLEAN, PROP_NONE);
|
2011-07-08 11:03:37 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_DRIP);
|
2011-11-14 19:13:52 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Drip", "Process drip effect (drip wet paint to gravity direction)");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_shrink", PROP_BOOLEAN, PROP_NONE);
|
2011-07-08 11:03:37 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SHRINK);
|
2011-11-14 19:13:52 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Shrink", "Process shrink effect (shrink paint areas)");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "shrink_speed", PROP_FLOAT, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "shrink_speed");
|
2011-07-03 14:01:57 +00:00
|
|
|
RNA_def_property_range(prop, 0.001, 10.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Shrink Speed", "How fast shrink effect moves on the canvas surface");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
|
2011-06-27 07:30:58 +00:00
|
|
|
RNA_def_property_struct_type(prop, "EffectorWeights");
|
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Effector Weights", "");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "drip_velocity", PROP_FLOAT, PROP_NONE);
|
2011-08-03 18:31:48 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "drip_vel");
|
|
|
|
|
RNA_def_property_range(prop, -200.0f, 200.0f);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
|
2011-11-14 19:13:52 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Velocity", "How much surface velocity affects dripping");
|
2011-08-03 18:31:48 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "drip_acceleration", PROP_FLOAT, PROP_NONE);
|
2011-08-03 18:31:48 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "drip_acc");
|
|
|
|
|
RNA_def_property_range(prop, -200.0f, 200.0f);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
|
2011-11-14 19:13:52 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Acceleration", "How much surface acceleration affects dripping");
|
2011-08-03 18:31:48 +00:00
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
/*
|
2012-03-09 18:28:30 +00:00
|
|
|
* Output settings
|
|
|
|
|
*/
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_MULALPHA);
|
2011-11-14 19:13:52 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Premultiply alpha", "Multiply color by alpha (recommended for Blender input)");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "image_output_path", PROP_STRING, PROP_DIRPATH);
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_def_property_string_sdna(prop, NULL, "image_output_path");
|
2011-08-21 19:03:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Output Path", "Directory to save the textures");
|
2011-06-16 10:41:00 +00:00
|
|
|
|
|
|
|
|
/* output for primary surface data */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "output_name_a", PROP_STRING, PROP_NONE);
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_def_property_string_sdna(prop, NULL, "output_name");
|
2011-11-22 18:18:16 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Output Name", "Name used to save output from this surface");
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_output_a", PROP_BOOLEAN, PROP_NONE);
|
2011-06-27 07:30:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_OUT1);
|
2011-11-22 18:18:16 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Output", "Save this output layer");
|
2011-06-27 07:30:58 +00:00
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
/* output for secondary sufrace data */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "output_name_b", PROP_STRING, PROP_NONE);
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_def_property_string_sdna(prop, NULL, "output_name2");
|
2011-11-22 18:18:16 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Output Name", "Name used to save output from this surface");
|
2011-06-27 07:30:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_output_b", PROP_BOOLEAN, PROP_NONE);
|
2011-06-27 07:30:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_OUT2);
|
2011-11-22 18:18:16 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Output", "Save this output layer");
|
2011-08-03 18:31:48 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "preview_id", PROP_ENUM, PROP_NONE);
|
2011-08-28 16:36:47 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "preview_id");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_preview);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Preview", "");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-08-28 16:36:47 +00:00
|
|
|
|
2011-08-03 18:31:48 +00:00
|
|
|
/* to check if output name exists */
|
|
|
|
|
func = RNA_def_function(srna, "output_exists", "rna_DynamicPaint_is_output_exists");
|
|
|
|
|
RNA_def_function_ui_description(func, "Checks if surface output layer of given name exists");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "object", "Object", "", "");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_int(func, "index", 0, 0, 1, "Index", "", 0, 1);
|
2011-08-03 18:31:48 +00:00
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
|
|
|
|
/* return type */
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_boolean(func, "exists", 0, "", "");
|
2011-08-03 18:31:48 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "depth_clamp", PROP_FLOAT, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-08-05 09:31:35 +00:00
|
|
|
RNA_def_property_range(prop, 0.00, 50.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Max Displace",
|
|
|
|
|
"Maximum level of depth intersection in object space (use 0.0 to disable)");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-10-13 20:00:22 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "displace_factor", PROP_FLOAT, PROP_NONE);
|
2011-10-28 14:46:09 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "disp_factor");
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_range(prop, -50.0, 50.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, -5.0, 5.0, 1, 2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Displace Factor", "Strength of displace when applied to the mesh");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "image_fileformat", PROP_ENUM, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_image_fileformat);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "File Format", "");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "displace_type", PROP_ENUM, PROP_NONE);
|
2011-10-28 14:46:09 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "disp_type");
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-10-28 14:46:09 +00:00
|
|
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_displace_type);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Data Type", "");
|
2011-06-16 10:41:00 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_incremental_displace", PROP_BOOLEAN, PROP_NONE);
|
2011-08-05 09:31:35 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISP_INCREMENTAL);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Incremental", "New displace is added cumulatively on top of existing");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
|
2011-08-05 09:31:35 +00:00
|
|
|
|
2011-07-02 18:06:39 +00:00
|
|
|
/* wave simulator settings */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "wave_damping", PROP_FLOAT, PROP_NONE);
|
2011-12-31 10:28:36 +00:00
|
|
|
RNA_def_property_range(prop, 0.0, 1.0);
|
2011-07-02 18:06:39 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Damping", "Wave damping factor");
|
2011-07-02 18:06:39 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "wave_speed", PROP_FLOAT, PROP_NONE);
|
2011-11-16 18:32:28 +00:00
|
|
|
RNA_def_property_range(prop, 0.01, 5.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.20, 4.0, 1, 2);
|
2012-07-04 15:04:38 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Speed", "Wave propagation speed");
|
2011-07-02 18:06:39 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE);
|
2011-07-02 18:06:39 +00:00
|
|
|
RNA_def_property_range(prop, 0.01, 3.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.01, 1.5, 1, 2);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Timescale", "Wave time scaling factor");
|
2011-07-02 18:06:39 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "wave_spring", PROP_FLOAT, PROP_NONE);
|
2011-12-31 10:28:36 +00:00
|
|
|
RNA_def_property_range(prop, 0.0, 1.0);
|
2011-07-02 18:06:39 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Spring", "Spring force that pulls water level back to zero");
|
2011-07-02 18:06:39 +00:00
|
|
|
|
2013-08-03 09:46:38 +00:00
|
|
|
prop = RNA_def_property(srna, "wave_smoothness", PROP_FLOAT, PROP_NONE);
|
|
|
|
|
RNA_def_property_range(prop, 0.0, 10.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.1, 5.0, 1, 2);
|
2013-08-06 14:55:00 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Smoothness", "Limit maximum steepness of wave slope between simulation points "
|
|
|
|
|
"(use higher values for smoother waves at expense of reduced detail)");
|
2013-08-03 09:46:38 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_wave_open_border", PROP_BOOLEAN, PROP_NONE);
|
2011-07-02 18:06:39 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_WAVE_OPEN_BORDERS);
|
2011-11-14 19:13:52 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Open Borders", "Pass waves through mesh edges");
|
2011-07-02 18:06:39 +00:00
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
|
|
|
|
|
/* cache */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_NEVER_NULL);
|
|
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "pointcache");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Point Cache", "");
|
|
|
|
|
|
|
|
|
|
/* is cache used */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "is_cache_user", PROP_BOOLEAN, PROP_NONE);
|
2011-11-14 07:07:59 +00:00
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_DynamicPaint_is_cache_user_get", NULL);
|
2011-11-14 19:13:52 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Cache", "");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
|
|
|
|
|
/* whether this surface has preview data for 3D view */
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_define_verify_sdna(false);
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
prop = RNA_def_property(srna, "use_color_preview", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_DynamicPaint_use_color_preview_get", NULL);
|
2012-12-30 23:21:33 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Color Preview", "Whether this surface has some color preview for 3D view");
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_define_verify_sdna(true);
|
2011-06-16 10:41:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_dynamic_paint_canvas_settings(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
|
|
srna = RNA_def_struct(brna, "DynamicPaintCanvasSettings", NULL);
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Canvas Settings", "Dynamic Paint canvas settings");
|
|
|
|
|
RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings");
|
|
|
|
|
RNA_def_struct_path_func(srna, "rna_DynamicPaintCanvasSettings_path");
|
|
|
|
|
|
|
|
|
|
/*
|
2012-03-09 18:28:30 +00:00
|
|
|
* Surface Slots
|
|
|
|
|
*/
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "canvas_surfaces", PROP_COLLECTION, PROP_NONE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_DynamicPaint_surfaces_begin", "rna_iterator_listbase_next",
|
|
|
|
|
"rna_iterator_listbase_end", "rna_iterator_listbase_get",
|
|
|
|
|
NULL, NULL, NULL, NULL);
|
2011-06-16 10:41:00 +00:00
|
|
|
RNA_def_property_struct_type(prop, "DynamicPaintSurface");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Paint Surface List", "Paint surface list");
|
2011-06-18 18:41:20 +00:00
|
|
|
rna_def_canvas_surfaces(brna, prop);
|
2011-05-24 07:08:58 +00:00
|
|
|
}
|
|
|
|
|
|
2011-06-16 18:25:41 +00:00
|
|
|
static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
|
2011-05-24 07:08:58 +00:00
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
|
|
/* paint collision type */
|
|
|
|
|
static EnumPropertyItem prop_dynamicpaint_collisiontype[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{MOD_DPAINT_COL_PSYS, "PARTICLE_SYSTEM", ICON_PARTICLES, "Particle System", ""},
|
|
|
|
|
{MOD_DPAINT_COL_POINT, "POINT", ICON_META_EMPTY, "Object Center", ""},
|
|
|
|
|
{MOD_DPAINT_COL_DIST, "DISTANCE", ICON_META_EMPTY, "Proximity", ""},
|
|
|
|
|
{MOD_DPAINT_COL_VOLDIST, "VOLUME_DISTANCE", ICON_META_CUBE, "Mesh Volume + Proximity", ""},
|
|
|
|
|
{MOD_DPAINT_COL_VOLUME, "VOLUME", ICON_MESH_CUBE, "Mesh Volume", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
|
static EnumPropertyItem prop_dynamicpaint_prox_falloff[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{MOD_DPAINT_PRFALL_SMOOTH, "SMOOTH", ICON_SPHERECURVE, "Smooth", ""},
|
|
|
|
|
{MOD_DPAINT_PRFALL_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""},
|
|
|
|
|
{MOD_DPAINT_PRFALL_RAMP, "RAMP", ICON_COLOR, "Color Ramp", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-07-02 18:06:39 +00:00
|
|
|
static EnumPropertyItem prop_dynamicpaint_brush_wave_type[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{MOD_DPAINT_WAVEB_CHANGE, "CHANGE", 0, "Depth Change", ""},
|
|
|
|
|
{MOD_DPAINT_WAVEB_DEPTH, "DEPTH", 0, "Obstacle", ""},
|
|
|
|
|
{MOD_DPAINT_WAVEB_FORCE, "FORCE", 0, "Force", ""},
|
|
|
|
|
{MOD_DPAINT_WAVEB_REFLECT, "REFLECT", 0, "Reflect Only", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2011-07-02 18:06:39 +00:00
|
|
|
|
2011-07-08 11:03:37 +00:00
|
|
|
static EnumPropertyItem prop_dynamicpaint_brush_ray_dir[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{MOD_DPAINT_RAY_CANVAS, "CANVAS", 0, "Canvas Normal", ""},
|
|
|
|
|
{MOD_DPAINT_RAY_BRUSH_AVG, "BRUSH", 0, "Brush Normal", ""},
|
|
|
|
|
{MOD_DPAINT_RAY_ZPLUS, "Z_AXIS", 0, "Z-Axis", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2011-07-08 11:03:37 +00:00
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
srna = RNA_def_struct(brna, "DynamicPaintBrushSettings", NULL);
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Brush Settings", "Brush settings");
|
|
|
|
|
RNA_def_struct_sdna(srna, "DynamicPaintBrushSettings");
|
|
|
|
|
RNA_def_struct_path_func(srna, "rna_DynamicPaintBrushSettings_path");
|
|
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
/*
|
2012-03-09 18:28:30 +00:00
|
|
|
* Paint
|
|
|
|
|
*/
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "paint_color", PROP_FLOAT, PROP_COLOR_GAMMA);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "r");
|
|
|
|
|
RNA_def_property_array(prop, 3);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Paint Color", "Color of the paint");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "paint_alpha", PROP_FLOAT, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "alpha");
|
2011-10-31 13:01:06 +00:00
|
|
|
RNA_def_property_range(prop, 0.0, 1.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Paint Alpha", "Paint alpha");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_USE_MATERIAL);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use object material", "Use object material to define color and influence");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "mat");
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Material",
|
|
|
|
|
"Material to use (if not defined, material linked to the mesh is used)");
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_absolute_alpha", PROP_BOOLEAN, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ABS_ALPHA);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Absolute Alpha",
|
|
|
|
|
"Only increase alpha value if paint alpha is higher than existing");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "paint_wetness", PROP_FLOAT, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "wetness");
|
2011-11-05 07:39:59 +00:00
|
|
|
RNA_def_property_range(prop, 0.0, 1.0);
|
2011-07-03 14:01:57 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Paint Wetness",
|
|
|
|
|
"Paint wetness, visible in wetmap (some effects only affect wet paint)");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_paint_erase", PROP_BOOLEAN, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ERASE);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Erase Paint", "Erase / remove paint instead of adding it");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-07-02 18:06:39 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
|
2011-07-02 18:06:39 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_wave_type);
|
2011-11-16 18:32:28 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Wave Type", "");
|
2011-07-02 18:06:39 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "wave_factor", PROP_FLOAT, PROP_NONE);
|
2011-07-02 18:06:39 +00:00
|
|
|
RNA_def_property_range(prop, -2.0, 2.0);
|
2011-07-03 14:01:57 +00:00
|
|
|
RNA_def_property_ui_range(prop, -1.0, 1.0, 5, 2);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Factor", "Multiplier for wave influence of this brush");
|
2011-08-03 18:31:48 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "wave_clamp", PROP_FLOAT, PROP_NONE);
|
2011-09-05 16:04:15 +00:00
|
|
|
RNA_def_property_range(prop, 0.00, 50.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Clamp Waves",
|
|
|
|
|
"Maximum level of surface intersection used to influence waves (use 0.0 to disable)");
|
2011-09-05 16:04:15 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_smudge", PROP_BOOLEAN, PROP_NONE);
|
2011-08-03 18:31:48 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DO_SMUDGE);
|
2011-11-14 19:13:52 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Do Smudge", "Make this brush to smudge existing paint as it moves");
|
2011-08-03 18:31:48 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "smudge_strength", PROP_FLOAT, PROP_NONE);
|
2011-08-03 18:31:48 +00:00
|
|
|
RNA_def_property_range(prop, 0.0, 1.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
|
2011-08-21 19:03:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Smudge Strength", "Smudge effect strength");
|
2011-08-03 18:31:48 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
|
2011-11-14 06:46:07 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "max_velocity");
|
2011-08-03 18:31:48 +00:00
|
|
|
RNA_def_property_range(prop, 0.0001, 10.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.1, 2.0, 5, 2);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Max Velocity",
|
|
|
|
|
"Velocity considered as maximum influence (Blender units per frame)");
|
2011-08-03 18:31:48 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_velocity_alpha", PROP_BOOLEAN, PROP_NONE);
|
2011-08-03 18:31:48 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_ALPHA);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Multiply Alpha", "Multiply brush influence by velocity color ramp alpha");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-08-03 18:31:48 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_velocity_depth", PROP_BOOLEAN, PROP_NONE);
|
2011-08-03 18:31:48 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_DEPTH);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Multiply Depth",
|
|
|
|
|
"Multiply brush intersection depth (displace, waves) by velocity ramp alpha");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-08-03 18:31:48 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_velocity_color", PROP_BOOLEAN, PROP_NONE);
|
2011-08-03 18:31:48 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_COLOR);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Replace Color", "Replace brush color by velocity color ramp");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
|
/*
|
2012-05-12 11:01:29 +00:00
|
|
|
* Paint Area / Collision
|
|
|
|
|
*/
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "paint_source", PROP_ENUM, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "collision");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_collisiontype);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Paint Source", "");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "paint_distance", PROP_FLOAT, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "paint_distance");
|
|
|
|
|
RNA_def_property_range(prop, 0.0, 500.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0, 500.0, 10, 3);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Proximity Distance",
|
|
|
|
|
"Maximum distance from brush to mesh surface to affect paint");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_proximity_ramp_alpha", PROP_BOOLEAN, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_RAMP_ALPHA);
|
2011-11-14 19:13:52 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Only Use Alpha", "Only read color ramp alpha");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "proximity_falloff", PROP_ENUM, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "proximity_falloff");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_prox_falloff);
|
2011-08-21 19:03:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Falloff", "Proximity falloff type");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_proximity_project", PROP_BOOLEAN, PROP_NONE);
|
2011-09-10 08:55:44 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PROX_PROJECT);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Project",
|
|
|
|
|
"Brush is projected to canvas from defined direction within brush proximity");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-09-10 08:55:44 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "ray_direction", PROP_ENUM, PROP_NONE);
|
2011-09-10 08:55:44 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "ray_dir");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_ray_dir);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Ray Direction",
|
|
|
|
|
"Ray direction to use for projection (if brush object is located in that direction "
|
|
|
|
|
"it's painted)");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-06-17 18:04:56 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "invert_proximity", PROP_BOOLEAN, PROP_NONE);
|
2011-06-17 18:04:56 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_INVERSE_PROX);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Inner Proximity", "Proximity falloff is applied inside the volume");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-11-11 10:46:26 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_negative_volume", PROP_BOOLEAN, PROP_NONE);
|
2011-11-11 10:46:26 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_NEGATE_VOLUME);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Negate Volume", "Negate influence inside the volume");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2012-03-09 18:28:30 +00:00
|
|
|
* Particle
|
|
|
|
|
*/
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "psys");
|
|
|
|
|
RNA_def_property_struct_type(prop, "ParticleSystem");
|
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Particle Systems", "The particle system to paint with");
|
2014-01-17 01:54:37 +11:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_reset_dependency");
|
2011-07-08 11:03:37 +00:00
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_particle_radius", PROP_BOOLEAN, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PART_RAD);
|
2011-11-14 19:13:52 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Particle Radius", "Use radius from particle settings");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "solid_radius", PROP_FLOAT, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "particle_radius");
|
|
|
|
|
RNA_def_property_range(prop, 0.01, 10.0);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.01, 2.0, 5, 3);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Solid Radius", "Radius that will be painted solid");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "smooth_radius", PROP_FLOAT, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "particle_smooth");
|
|
|
|
|
RNA_def_property_range(prop, 0.0, 10.0);
|
2013-04-08 18:55:08 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, -1);
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Smooth Radius", "Smooth falloff added after solid radius");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2012-03-09 18:28:30 +00:00
|
|
|
* Color ramps
|
|
|
|
|
*/
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "paint_ramp", PROP_POINTER, PROP_NONE);
|
2011-05-24 07:08:58 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "paint_ramp");
|
|
|
|
|
RNA_def_property_struct_type(prop, "ColorRamp");
|
2011-10-13 20:00:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Paint Color Ramp", "Color ramp used to define proximity falloff");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-08-03 18:31:48 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "velocity_ramp", PROP_POINTER, PROP_NONE);
|
2011-08-03 18:31:48 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "vel_ramp");
|
|
|
|
|
RNA_def_property_struct_type(prop, "ColorRamp");
|
2011-08-21 19:03:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Velocity Color Ramp", "Color ramp used to define brush velocity effect");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
2011-05-24 07:08:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RNA_def_dynamic_paint(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
rna_def_dynamic_paint_canvas_settings(brna);
|
2011-06-16 18:25:41 +00:00
|
|
|
rna_def_dynamic_paint_brush_settings(brna);
|
2011-06-18 18:41:20 +00:00
|
|
|
rna_def_canvas_surface(brna);
|
2011-05-24 07:08:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|