2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2009-07-25 22:31:02 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-07-25 22:31:02 +00:00
|
|
|
*
|
|
|
|
|
* Contributor(s): Campbell Barton
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
2011-02-27 20:20:01 +00:00
|
|
|
/** \file blender/makesrna/intern/rna_sculpt_paint.c
|
|
|
|
|
* \ingroup RNA
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2009-07-25 22:31:02 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
|
|
#include "RNA_define.h"
|
|
|
|
|
|
|
|
|
|
#include "rna_internal.h"
|
|
|
|
|
|
Change to the way brush/tool selection works, as discussed a while ago
Now, there are preset brushes made for each tool type (eg. for sculpt mode, Grab,
Draw, Inflate, etc), and the recommended method for changing sculpt tools is to
change between Brushes. The shortcut keys for changing between tools have
now been changed to change between named brushes - the G key in sculpt
mode now changes to any brush named 'Grab'.
The advantages of this are:
* Changing between brushes remembers the strength/size/texture etc settings for
each brush. This means that for example, you can draw with a strong textured
Clay brush, but then switch quickly to a weaker, untextured Smooth brush,
without having to re-do your settings each time.
* You can now add your own custom shortcut keys to your own custom brushes -
just add a keymap entry similar to the existing ones, that references your own
custom brush names.
To bring over these new default brushes to an existing B.blend setup, just
append them in from the new B.blend in svn.
2009-12-28 01:27:05 +00:00
|
|
|
#include "DNA_ID.h"
|
2009-07-25 22:31:02 +00:00
|
|
|
#include "DNA_scene_types.h"
|
2010-08-04 04:01:27 +00:00
|
|
|
#include "DNA_brush_types.h"
|
2014-08-28 16:40:38 +02:00
|
|
|
#include "DNA_screen_types.h"
|
|
|
|
|
#include "DNA_space_types.h"
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2009-08-16 19:50:00 +00:00
|
|
|
#include "BKE_paint.h"
|
2014-08-28 16:40:38 +02:00
|
|
|
#include "BKE_material.h"
|
|
|
|
|
|
|
|
|
|
#include "ED_image.h"
|
2009-08-16 19:50:00 +00:00
|
|
|
|
2010-03-22 17:12:08 +00:00
|
|
|
#include "WM_api.h"
|
2009-08-29 15:20:36 +00:00
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
2012-12-30 18:31:01 +00:00
|
|
|
#include "BLI_utildefines.h"
|
|
|
|
|
#include "bmesh.h"
|
|
|
|
|
|
2010-01-11 18:10:13 +00:00
|
|
|
static EnumPropertyItem particle_edit_hair_brush_items[] = {
|
2010-02-11 01:11:52 +00:00
|
|
|
{PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush"},
|
|
|
|
|
{PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
|
|
|
|
|
{PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
|
|
|
|
|
{PE_BRUSH_ADD, "ADD", 0, "Add", "Add hairs"},
|
|
|
|
|
{PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"},
|
|
|
|
|
{PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up"},
|
|
|
|
|
{PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
|
|
|
|
|
{PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2015-12-13 21:03:13 +13:00
|
|
|
EnumPropertyItem rna_enum_gpencil_sculpt_brush_items[] = {
|
|
|
|
|
{GP_EDITBRUSH_TYPE_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth stroke points"},
|
|
|
|
|
{GP_EDITBRUSH_TYPE_THICKNESS, "THICKNESS", 0, "Thickness", "Adjust thickness of strokes"},
|
|
|
|
|
{GP_EDITBRUSH_TYPE_GRAB, "GRAB", 0, "Grab", "Translate the set of points initially within the brush circle"},
|
|
|
|
|
{GP_EDITBRUSH_TYPE_PUSH, "PUSH", 0, "Push", "Move points out of the way, as if combing them"},
|
|
|
|
|
{GP_EDITBRUSH_TYPE_TWIST, "TWIST", 0, "Twist", "Rotate points around the midpoint of the brush"},
|
|
|
|
|
{GP_EDITBRUSH_TYPE_PINCH, "PINCH", 0, "Pinch", "Pull points towards the midpoint of the brush"},
|
2015-12-14 19:20:31 +01:00
|
|
|
{GP_EDITBRUSH_TYPE_RANDOMIZE, "RANDOMIZE", 0, "Randomize", "Introduce jitter/randomness into strokes"},
|
2015-12-13 21:03:13 +13:00
|
|
|
//{GP_EDITBRUSH_TYPE_SUBDIVIDE, "SUBDIVIDE", 0, "Subdivide", "Increase point density for higher resolution strokes when zoomed in"},
|
|
|
|
|
//{GP_EDITBRUSH_TYPE_SIMPLIFY, "SIMPLIFY", 0, "Simplify", "Reduce density of stroke points"},
|
|
|
|
|
{GP_EDITBRUSH_TYPE_CLONE, "CLONE", 0, "Clone", "Paste copies of the strokes stored on the clipboard"},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
|
|
|
|
|
2015-11-23 13:49:52 +11:00
|
|
|
EnumPropertyItem rna_enum_symmetrize_direction_items[] = {
|
2012-12-30 18:31:01 +00:00
|
|
|
{BMO_SYMMETRIZE_NEGATIVE_X, "NEGATIVE_X", 0, "-X to +X", ""},
|
|
|
|
|
{BMO_SYMMETRIZE_POSITIVE_X, "POSITIVE_X", 0, "+X to -X", ""},
|
|
|
|
|
|
|
|
|
|
{BMO_SYMMETRIZE_NEGATIVE_Y, "NEGATIVE_Y", 0, "-Y to +Y", ""},
|
|
|
|
|
{BMO_SYMMETRIZE_POSITIVE_Y, "POSITIVE_Y", 0, "+Y to -Y", ""},
|
|
|
|
|
|
|
|
|
|
{BMO_SYMMETRIZE_NEGATIVE_Z, "NEGATIVE_Z", 0, "-Z to +Z", ""},
|
|
|
|
|
{BMO_SYMMETRIZE_POSITIVE_Z, "POSITIVE_Z", 0, "+Z to -Z", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL},
|
|
|
|
|
};
|
|
|
|
|
|
2009-07-25 22:31:02 +00:00
|
|
|
#ifdef RNA_RUNTIME
|
2010-08-16 05:46:10 +00:00
|
|
|
#include "MEM_guardedalloc.h"
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2009-08-29 15:20:36 +00:00
|
|
|
#include "BKE_context.h"
|
2014-09-03 12:14:09 +02:00
|
|
|
#include "BKE_DerivedMesh.h"
|
2009-08-29 15:20:36 +00:00
|
|
|
#include "BKE_pointcache.h"
|
|
|
|
|
#include "BKE_particle.h"
|
|
|
|
|
#include "BKE_depsgraph.h"
|
2012-12-15 15:59:25 +00:00
|
|
|
#include "BKE_pbvh.h"
|
2012-10-22 17:33:53 +00:00
|
|
|
|
2014-09-03 12:14:09 +02:00
|
|
|
#include "GPU_buffers.h"
|
|
|
|
|
|
2009-08-29 15:20:36 +00:00
|
|
|
#include "ED_particle.h"
|
|
|
|
|
|
2010-03-09 03:42:20 +00:00
|
|
|
static EnumPropertyItem particle_edit_disconnected_hair_brush_items[] = {
|
|
|
|
|
{PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush"},
|
|
|
|
|
{PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
|
|
|
|
|
{PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
|
|
|
|
|
{PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"},
|
|
|
|
|
{PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
|
|
|
|
|
{PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2010-03-09 03:42:20 +00:00
|
|
|
|
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
|
|
|
static EnumPropertyItem particle_edit_cache_brush_items[] = {
|
2010-02-11 01:11:52 +00:00
|
|
|
{PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush"},
|
|
|
|
|
{PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths"},
|
|
|
|
|
{PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths"},
|
|
|
|
|
{PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
|
|
|
|
2009-07-25 22:31:02 +00:00
|
|
|
static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data;
|
2012-03-05 23:30:41 +00:00
|
|
|
ParticleBrushData *brush = NULL;
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (pset->brushtype != PE_BRUSH_NONE)
|
|
|
|
|
brush = &pset->brush[pset->brushtype];
|
2009-07-25 22:31:02 +00:00
|
|
|
|
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_ParticleBrush, brush);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr)
|
|
|
|
|
{
|
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_ParticleEdit_redo(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
|
2009-08-29 15:20:36 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Object *ob = (scene->basact) ? scene->basact->object : NULL;
|
2009-12-08 17:23:48 +00:00
|
|
|
PTCacheEdit *edit = PE_get_current(scene, ob);
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (!edit)
|
2009-08-29 15:20:36 +00:00
|
|
|
return;
|
|
|
|
|
|
2009-09-05 20:12:08 +00:00
|
|
|
psys_free_path_cache(edit->psys, edit);
|
2009-08-29 15:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_ParticleEdit_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
|
2009-08-29 15:20:36 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Object *ob = (scene->basact) ? scene->basact->object : NULL;
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (ob) DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
|
2009-08-29 15:20:36 +00:00
|
|
|
}
|
2010-03-22 17:12:08 +00:00
|
|
|
static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data;
|
2010-03-22 17:12:08 +00:00
|
|
|
|
|
|
|
|
/* redraw hair completely if weight brush is/was used */
|
2012-03-05 23:30:41 +00:00
|
|
|
if ((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->scene) {
|
2012-05-12 11:01:29 +00:00
|
|
|
Object *ob = (pset->scene->basact) ? pset->scene->basact->object : NULL;
|
2012-03-05 23:30:41 +00:00
|
|
|
if (ob) {
|
2010-12-05 18:59:23 +00:00
|
|
|
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
|
2012-05-12 11:01:29 +00:00
|
|
|
WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL);
|
2010-03-22 17:12:08 +00:00
|
|
|
}
|
|
|
|
|
}
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2010-03-22 17:12:08 +00:00
|
|
|
pset->brushtype = value;
|
|
|
|
|
}
|
2011-10-20 07:56:04 +00:00
|
|
|
static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UNUSED(ptr),
|
2014-01-04 18:08:43 +11:00
|
|
|
PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
|
2009-08-29 15:20:36 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
Scene *scene = CTX_data_scene(C);
|
2012-05-12 11:01:29 +00:00
|
|
|
Object *ob = (scene->basact) ? scene->basact->object : NULL;
|
2011-10-12 01:36:06 +00:00
|
|
|
#if 0
|
2009-12-08 17:23:48 +00:00
|
|
|
PTCacheEdit *edit = PE_get_current(scene, ob);
|
2012-03-05 23:30:41 +00:00
|
|
|
ParticleSystem *psys = edit ? edit->psys : NULL;
|
2011-10-12 01:36:06 +00:00
|
|
|
#else
|
|
|
|
|
/* use this rather than PE_get_current() - because the editing cache is
|
2012-03-01 12:20:18 +00:00
|
|
|
* dependent on the cache being updated which can happen after this UI
|
2011-10-12 01:36:06 +00:00
|
|
|
* draws causing a glitch [#28883] */
|
2012-03-05 23:30:41 +00:00
|
|
|
ParticleSystem *psys = psys_get_current(ob);
|
2011-10-12 01:36:06 +00:00
|
|
|
#endif
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (psys) {
|
|
|
|
|
if (psys->flag & PSYS_GLOBAL_HAIR) {
|
2010-03-09 03:42:20 +00:00
|
|
|
return particle_edit_disconnected_hair_brush_items;
|
2011-10-12 01:36:06 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2010-03-09 03:42:20 +00:00
|
|
|
return particle_edit_hair_brush_items;
|
2011-10-12 01:36:06 +00:00
|
|
|
}
|
2010-03-09 03:42:20 +00:00
|
|
|
}
|
2009-10-14 19:19:43 +00:00
|
|
|
|
|
|
|
|
return particle_edit_cache_brush_items;
|
2009-08-29 15:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int rna_ParticleEdit_editable_get(PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data;
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2010-08-04 09:20:59 +00:00
|
|
|
return (pset->object && pset->scene && PE_get_current(pset->scene, pset->object));
|
2009-08-29 15:20:36 +00:00
|
|
|
}
|
|
|
|
|
static int rna_ParticleEdit_hair_get(PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data;
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (pset->scene) {
|
2010-08-04 09:20:59 +00:00
|
|
|
PTCacheEdit *edit = PE_get_current(pset->scene, pset->object);
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2010-08-04 09:20:59 +00:00
|
|
|
return (edit && edit->psys);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
2009-08-29 15:20:36 +00:00
|
|
|
}
|
2009-11-17 15:10:19 +00:00
|
|
|
|
2013-09-20 06:35:28 +00:00
|
|
|
static char *rna_ParticleEdit_path(PointerRNA *UNUSED(ptr))
|
2013-01-22 03:11:11 +00:00
|
|
|
{
|
|
|
|
|
return BLI_strdup("tool_settings.particle_edit");
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-04 12:18:07 +00:00
|
|
|
static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
|
Change to the way brush/tool selection works, as discussed a while ago
Now, there are preset brushes made for each tool type (eg. for sculpt mode, Grab,
Draw, Inflate, etc), and the recommended method for changing sculpt tools is to
change between Brushes. The shortcut keys for changing between tools have
now been changed to change between named brushes - the G key in sculpt
mode now changes to any brush named 'Grab'.
The advantages of this are:
* Changing between brushes remembers the strength/size/texture etc settings for
each brush. This means that for example, you can draw with a strong textured
Clay brush, but then switch quickly to a weaker, untextured Smooth brush,
without having to re-do your settings each time.
* You can now add your own custom shortcut keys to your own custom brushes -
just add a keymap entry similar to the existing ones, that references your own
custom brush names.
To bring over these new default brushes to an existing B.blend setup, just
append them in from the new B.blend in svn.
2009-12-28 01:27:05 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
Scene *scene = (Scene *)ptr->id.data;
|
2011-01-16 18:33:08 +00:00
|
|
|
ToolSettings *ts = scene->toolsettings;
|
2012-03-05 23:30:41 +00:00
|
|
|
Brush *brush = value.id.data;
|
2011-01-16 18:33:08 +00:00
|
|
|
int mode = 0;
|
|
|
|
|
|
|
|
|
|
/* check the origin of the Paint struct to see which paint
|
2012-03-09 18:28:30 +00:00
|
|
|
* mode to select from */
|
2011-01-16 18:33:08 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (ptr->data == &ts->imapaint)
|
2011-01-16 18:33:08 +00:00
|
|
|
mode = OB_MODE_TEXTURE_PAINT;
|
2012-03-05 23:30:41 +00:00
|
|
|
else if (ptr->data == ts->sculpt)
|
2011-01-16 18:33:08 +00:00
|
|
|
mode = OB_MODE_SCULPT;
|
2012-03-05 23:30:41 +00:00
|
|
|
else if (ptr->data == ts->vpaint)
|
2011-01-16 18:33:08 +00:00
|
|
|
mode = OB_MODE_VERTEX_PAINT;
|
2012-03-05 23:30:41 +00:00
|
|
|
else if (ptr->data == ts->wpaint)
|
2011-01-16 18:33:08 +00:00
|
|
|
mode = OB_MODE_WEIGHT_PAINT;
|
|
|
|
|
|
|
|
|
|
return brush->ob_mode & mode;
|
Change to the way brush/tool selection works, as discussed a while ago
Now, there are preset brushes made for each tool type (eg. for sculpt mode, Grab,
Draw, Inflate, etc), and the recommended method for changing sculpt tools is to
change between Brushes. The shortcut keys for changing between tools have
now been changed to change between named brushes - the G key in sculpt
mode now changes to any brush named 'Grab'.
The advantages of this are:
* Changing between brushes remembers the strength/size/texture etc settings for
each brush. This means that for example, you can draw with a strong textured
Clay brush, but then switch quickly to a weaker, untextured Smooth brush,
without having to re-do your settings each time.
* You can now add your own custom shortcut keys to your own custom brushes -
just add a keymap entry similar to the existing ones, that references your own
custom brush names.
To bring over these new default brushes to an existing B.blend setup, just
append them in from the new B.blend in svn.
2009-12-28 01:27:05 +00:00
|
|
|
}
|
2010-11-03 21:23:02 +00:00
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_Sculpt_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
|
2011-05-04 13:15:42 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Object *ob = (scene->basact) ? scene->basact->object : NULL;
|
2011-05-04 13:15:42 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (ob) {
|
2011-05-04 13:15:42 +00:00
|
|
|
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
|
2012-05-12 11:01:29 +00:00
|
|
|
WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob);
|
2012-12-30 18:27:33 +00:00
|
|
|
|
|
|
|
|
if (ob->sculpt) {
|
2014-06-01 20:44:12 +03:00
|
|
|
ob->sculpt->bm_smooth_shading = ((scene->toolsettings->sculpt->flags &
|
|
|
|
|
SCULPT_DYNTOPO_SMOOTH_SHADING) != 0);
|
2012-12-30 18:27:33 +00:00
|
|
|
}
|
2011-05-04 13:15:42 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-10-22 17:33:53 +00:00
|
|
|
static void rna_Sculpt_ShowDiffuseColor_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
|
|
|
|
|
{
|
|
|
|
|
Object *ob = (scene->basact) ? scene->basact->object : NULL;
|
|
|
|
|
|
2013-02-14 01:01:08 +00:00
|
|
|
if (ob && ob->sculpt) {
|
2012-10-22 17:33:53 +00:00
|
|
|
Sculpt *sd = scene->toolsettings->sculpt;
|
2014-06-01 20:44:12 +03:00
|
|
|
ob->sculpt->show_diffuse_color = ((sd->flags & SCULPT_SHOW_DIFFUSE) != 0);
|
2012-10-22 17:33:53 +00:00
|
|
|
|
|
|
|
|
if (ob->sculpt->pbvh)
|
|
|
|
|
pbvh_show_diffuse_color_set(ob->sculpt->pbvh, ob->sculpt->show_diffuse_color);
|
|
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-20 06:35:28 +00:00
|
|
|
static char *rna_Sculpt_path(PointerRNA *UNUSED(ptr))
|
2013-01-22 03:11:11 +00:00
|
|
|
{
|
|
|
|
|
return BLI_strdup("tool_settings.sculpt");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *rna_VertexPaint_path(PointerRNA *ptr)
|
|
|
|
|
{
|
|
|
|
|
Scene *scene = (Scene *)ptr->id.data;
|
|
|
|
|
ToolSettings *ts = scene->toolsettings;
|
|
|
|
|
if (ptr->data == ts->vpaint) {
|
|
|
|
|
return BLI_strdup("tool_settings.vertex_paint");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return BLI_strdup("tool_settings.weight_paint");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-20 06:35:28 +00:00
|
|
|
static char *rna_ImagePaintSettings_path(PointerRNA *UNUSED(ptr))
|
2013-01-22 03:11:11 +00:00
|
|
|
{
|
|
|
|
|
return BLI_strdup("tool_settings.image_paint");
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-20 06:35:28 +00:00
|
|
|
static char *rna_UvSculpt_path(PointerRNA *UNUSED(ptr))
|
2013-01-22 03:11:11 +00:00
|
|
|
{
|
|
|
|
|
return BLI_strdup("tool_settings.uv_sculpt");
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-20 06:35:28 +00:00
|
|
|
static char *rna_ParticleBrush_path(PointerRNA *UNUSED(ptr))
|
2013-01-22 13:47:44 +00:00
|
|
|
{
|
|
|
|
|
return BLI_strdup("tool_settings.particle_edit.brush");
|
|
|
|
|
}
|
|
|
|
|
|
2013-04-12 21:58:18 +00:00
|
|
|
static void rna_Paint_brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
|
|
|
|
{
|
2014-12-01 19:54:19 +01:00
|
|
|
Paint *paint = ptr->data;
|
|
|
|
|
Brush *br = paint->brush;
|
2013-04-12 21:58:18 +00:00
|
|
|
BKE_paint_invalidate_overlay_all();
|
2015-02-17 03:26:03 +01:00
|
|
|
WM_main_add_notifier(NC_BRUSH | NA_SELECTED, br);
|
2013-04-12 21:58:18 +00:00
|
|
|
}
|
2014-07-21 12:02:05 +02:00
|
|
|
|
2014-08-28 16:40:38 +02:00
|
|
|
static void rna_ImaPaint_viewport_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
|
2014-07-21 12:02:05 +02:00
|
|
|
{
|
|
|
|
|
/* not the best solution maybe, but will refresh the 3D viewport */
|
|
|
|
|
WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
|
|
|
|
|
}
|
2014-08-28 16:40:38 +02:00
|
|
|
|
|
|
|
|
static void rna_ImaPaint_mode_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
|
|
|
|
|
{
|
|
|
|
|
Object *ob = OBACT;
|
|
|
|
|
|
2014-12-24 14:51:35 +11:00
|
|
|
if (ob && ob->type == OB_MESH) {
|
|
|
|
|
/* of course we need to invalidate here */
|
|
|
|
|
BKE_texpaint_slots_refresh_object(scene, ob);
|
|
|
|
|
|
|
|
|
|
/* we assume that changing the current mode will invalidate the uv layers so we need to refresh display */
|
|
|
|
|
GPU_drawobject_free(ob->derivedFinal);
|
|
|
|
|
BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
|
|
|
|
|
WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
|
|
|
|
|
}
|
2014-10-06 15:12:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_ImaPaint_stencil_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
|
|
|
|
|
{
|
2014-12-24 14:51:35 +11:00
|
|
|
Object *ob = OBACT;
|
|
|
|
|
|
|
|
|
|
if (ob && ob->type == OB_MESH) {
|
|
|
|
|
GPU_drawobject_free(ob->derivedFinal);
|
|
|
|
|
BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
|
|
|
|
|
WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
|
|
|
|
|
}
|
2014-08-28 16:40:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_ImaPaint_canvas_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr))
|
|
|
|
|
{
|
2014-10-06 15:12:06 +02:00
|
|
|
Object *ob = OBACT;
|
2014-08-28 16:40:38 +02:00
|
|
|
bScreen *sc;
|
|
|
|
|
Image *ima = scene->toolsettings->imapaint.canvas;
|
|
|
|
|
|
|
|
|
|
for (sc = bmain->screen.first; sc; sc = sc->id.next) {
|
|
|
|
|
ScrArea *sa;
|
|
|
|
|
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
|
|
|
|
SpaceLink *sl;
|
|
|
|
|
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
|
|
|
|
if (sl->spacetype == SPACE_IMAGE) {
|
|
|
|
|
SpaceImage *sima = (SpaceImage *)sl;
|
2014-09-22 11:01:50 +02:00
|
|
|
|
|
|
|
|
if (!sima->pin)
|
|
|
|
|
ED_space_image_set(sima, scene, scene->obedit, ima);
|
2014-08-28 16:40:38 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-10-06 15:12:06 +02:00
|
|
|
|
2014-12-09 14:36:24 +01:00
|
|
|
if (ob && ob->type == OB_MESH) {
|
|
|
|
|
GPU_drawobject_free(ob->derivedFinal);
|
|
|
|
|
BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
|
|
|
|
|
WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
|
|
|
|
|
}
|
2014-08-28 16:40:38 +02:00
|
|
|
}
|
2014-10-06 15:12:06 +02:00
|
|
|
|
|
|
|
|
static int rna_ImaPaint_detect_data(ImagePaintSettings *imapaint)
|
|
|
|
|
{
|
|
|
|
|
return imapaint->missing_data == 0;
|
|
|
|
|
}
|
2015-12-13 21:03:13 +13:00
|
|
|
|
|
|
|
|
|
|
|
|
|
static PointerRNA rna_GPencilSculptSettings_brush_get(PointerRNA *ptr)
|
|
|
|
|
{
|
|
|
|
|
GP_BrushEdit_Settings *gset = (GP_BrushEdit_Settings *)ptr->data;
|
|
|
|
|
GP_EditBrush_Data *brush = NULL;
|
|
|
|
|
|
|
|
|
|
if ((gset->brushtype >= 0) && (gset->brushtype < TOT_GP_EDITBRUSH_TYPES))
|
|
|
|
|
brush = &gset->brush[gset->brushtype];
|
|
|
|
|
|
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_GPencilSculptBrush, brush);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *rna_GPencilSculptSettings_path(PointerRNA *UNUSED(ptr))
|
|
|
|
|
{
|
|
|
|
|
return BLI_strdup("tool_settings.gpencil_sculpt");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *rna_GPencilSculptBrush_path(PointerRNA *UNUSED(ptr))
|
|
|
|
|
{
|
|
|
|
|
return BLI_strdup("tool_settings.gpencil_sculpt.brush");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-07-25 22:31:02 +00:00
|
|
|
#else
|
|
|
|
|
|
2014-07-21 12:02:05 +02:00
|
|
|
static void rna_def_paint_curve(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
|
|
|
|
|
srna = RNA_def_struct(brna, "PaintCurve", "ID");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Paint Curve", "");
|
|
|
|
|
RNA_def_struct_ui_icon(srna, ICON_CURVE_BEZCURVE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-08-16 19:50:00 +00:00
|
|
|
static void rna_def_paint(BlenderRNA *brna)
|
2009-07-25 22:31:02 +00:00
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "Paint", NULL);
|
2009-08-16 19:50:00 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Paint", "");
|
|
|
|
|
|
2010-08-04 12:18:07 +00:00
|
|
|
/* Global Settings */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
|
2009-08-16 19:50:00 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
2010-08-04 12:18:07 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_mode_poll");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Brush", "Active Brush");
|
2013-04-12 21:58:18 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Paint_brush_update");
|
2009-11-03 22:50:09 +00:00
|
|
|
|
2014-07-21 12:02:05 +02:00
|
|
|
prop = RNA_def_property(srna, "palette", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
|
|
|
|
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, NULL);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Palette", "Active Palette");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
|
2009-11-03 22:50:09 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Show Brush", "");
|
2013-12-09 22:36:33 +02:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2009-11-25 14:13:43 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE);
|
2010-07-14 14:11:03 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH_ON_SURFACE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Show Brush On Surface", "");
|
2013-12-09 22:36:33 +02:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE);
|
2009-11-25 14:13:43 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_FAST_NAVIGATE);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Fast Navigate", "For multires, show low resolution while navigating the view");
|
2013-12-09 22:36:33 +02:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2012-05-21 23:32:46 +00:00
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_UNSIGNED);
|
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "num_input_samples");
|
2013-04-08 18:55:08 +00:00
|
|
|
RNA_def_property_ui_range(prop, 1, PAINT_MAX_INPUT_SAMPLES, 0, -1);
|
2012-05-21 23:32:46 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Input Samples", "Average multiple input samples together to smooth the brush stroke");
|
2013-12-09 22:36:33 +02:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "use_symmetry_x", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMM_X);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "use_symmetry_y", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMM_Y);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "use_symmetry_z", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMM_Z);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMMETRY_FEATHER);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Symmetry Feathering",
|
|
|
|
|
"Reduce the strength of the brush where it overlaps symmetrical daubs");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2015-02-11 15:07:04 +01:00
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "cavity_curve", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_flag(prop, PROP_NEVER_NULL);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Curve", "Editable cavity curve");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "use_cavity", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_USE_CAVITY_MASK);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Cavity Mask", "Mask painting according to mesh geometry cavity");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
|
|
|
|
|
2015-07-23 22:52:03 +02:00
|
|
|
prop = RNA_def_property(srna, "tile_offset", PROP_FLOAT, PROP_XYZ);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "tile_offset");
|
|
|
|
|
RNA_def_property_array(prop, 3);
|
|
|
|
|
RNA_def_property_range(prop, 0.01, FLT_MAX);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.01, 100, 1 * 100, 2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Tiling offset for the X Axis",
|
|
|
|
|
"Stride at which tiled strokes are copied");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "tile_x", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_TILE_X);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Tile X", "Tile along X axis");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "tile_y", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_TILE_Y);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Tile Y", "Tile along Y axis");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "tile_z", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_TILE_Z);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Tile Z", "Tile along Z axis");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2009-08-16 19:50:00 +00:00
|
|
|
}
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2009-08-16 19:50:00 +00:00
|
|
|
static void rna_def_sculpt(BlenderRNA *brna)
|
|
|
|
|
{
|
2013-11-19 21:55:46 +01:00
|
|
|
static EnumPropertyItem detail_refine_items[] = {
|
|
|
|
|
{SCULPT_DYNTOPO_SUBDIVIDE, "SUBDIVIDE", 0,
|
|
|
|
|
"Subdivide Edges", "Subdivide long edges to add mesh detail where needed"},
|
|
|
|
|
{SCULPT_DYNTOPO_COLLAPSE, "COLLAPSE", 0,
|
|
|
|
|
"Collapse Edges", "Collapse short edges to remove mesh detail where possible"},
|
2013-12-10 13:44:46 +11:00
|
|
|
{SCULPT_DYNTOPO_SUBDIVIDE | SCULPT_DYNTOPO_COLLAPSE, "SUBDIVIDE_COLLAPSE", 0,
|
2013-11-19 21:55:46 +01:00
|
|
|
"Subdivide Collapse", "Both subdivide long edges and collapse short edges to refine mesh detail"},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
|
|
|
|
|
2014-03-06 20:04:57 +02:00
|
|
|
static EnumPropertyItem detail_type_items[] = {
|
|
|
|
|
{0, "RELATIVE", 0,
|
|
|
|
|
"Relative Detail", "Mesh detail is relative to the brush size and detail size"},
|
|
|
|
|
{SCULPT_DYNTOPO_DETAIL_CONSTANT, "CONSTANT", 0,
|
|
|
|
|
"Constant Detail", "Mesh detail is constant in object space according to detail size"},
|
2015-05-06 22:51:49 +02:00
|
|
|
{SCULPT_DYNTOPO_DETAIL_BRUSH, "BRUSH", 0,
|
|
|
|
|
"Brush Detail", "Mesh detail is relative to brush radius"},
|
2014-03-06 20:04:57 +02:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
|
|
|
|
|
2009-08-16 19:50:00 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "Sculpt", "Paint");
|
2013-01-22 03:11:11 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_Sculpt_path");
|
2009-08-16 19:50:00 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Sculpt", "");
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
|
2010-07-14 14:11:03 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "radial_symm");
|
|
|
|
|
RNA_def_property_int_default(prop, 1);
|
|
|
|
|
RNA_def_property_range(prop, 1, 64);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0, 32, 1, 1);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Radial Symmetry Count X Axis",
|
|
|
|
|
"Number of times to copy strokes across the surface");
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_X);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices");
|
2013-10-30 04:56:32 +00:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Y);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices");
|
2013-10-30 04:56:32 +00:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Z);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices");
|
2013-10-30 04:56:32 +00:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_threaded", PROP_BOOLEAN, PROP_NONE);
|
2010-07-14 14:11:03 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_USE_OPENMP);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use OpenMP",
|
|
|
|
|
"Take advantage of multiple CPU cores to improve sculpting performance");
|
2013-10-30 04:56:32 +00:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2011-05-04 13:15:42 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE);
|
2011-05-04 13:15:42 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_ONLY_DEFORM);
|
2011-10-20 07:56:04 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Deform Only",
|
|
|
|
|
"Use only deformation modifiers (temporary disable all "
|
|
|
|
|
"constructive modifiers except multi-resolution)");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update");
|
2012-10-22 17:33:53 +00:00
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "show_diffuse_color", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SHOW_DIFFUSE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Show Diffuse Color",
|
|
|
|
|
"Show diffuse color of object and overlay sculpt mask on top of it");
|
|
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_ShowDiffuseColor_update");
|
2012-12-30 18:27:33 +00:00
|
|
|
|
2014-03-31 19:30:51 +03:00
|
|
|
prop = RNA_def_property(srna, "detail_size", PROP_FLOAT, PROP_PIXEL);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.5, 40.0, 10, 2);
|
2014-03-22 23:35:07 +02:00
|
|
|
RNA_def_property_ui_text(prop, "Detail Size", "Maximum edge length for dynamic topology sculpting (in pixels)");
|
2014-03-22 17:47:18 +02:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
|
|
|
|
|
2015-05-06 22:51:49 +02:00
|
|
|
prop = RNA_def_property(srna, "detail_percent", PROP_FLOAT, PROP_PERCENTAGE);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.5, 100.0, 10, 2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Detail Percentage", "Maximum edge length for dynamic topology sculpting (in brush percenage)");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
|
|
|
|
|
2014-03-22 23:35:07 +02:00
|
|
|
prop = RNA_def_property(srna, "constant_detail", PROP_FLOAT, PROP_PERCENTAGE);
|
|
|
|
|
RNA_def_property_range(prop, 0.001, 10000.0);
|
2014-03-22 17:47:18 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0.1, 100.0, 10, 2);
|
2014-03-22 23:35:07 +02:00
|
|
|
RNA_def_property_ui_text(prop, "Detail Size", "Maximum edge length for dynamic topology sculpting (as percentage of blender unit)");
|
2014-02-27 09:39:04 +02:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2012-12-30 18:27:33 +00:00
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "use_smooth_shading", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_DYNTOPO_SMOOTH_SHADING);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Smooth Shading",
|
2012-12-31 02:37:28 +00:00
|
|
|
"Show faces in dynamic-topology mode with smooth "
|
|
|
|
|
"shading rather than flat shaded");
|
2012-12-30 18:27:33 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update");
|
|
|
|
|
|
2012-12-30 18:31:01 +00:00
|
|
|
prop = RNA_def_property(srna, "symmetrize_direction", PROP_ENUM, PROP_NONE);
|
2015-11-23 13:49:52 +11:00
|
|
|
RNA_def_property_enum_items(prop, rna_enum_symmetrize_direction_items);
|
2012-12-30 18:31:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Direction", "Source and destination for symmetrize operator");
|
2013-11-19 21:55:46 +01:00
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "detail_refine_method", PROP_ENUM, PROP_NONE);
|
|
|
|
|
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
|
|
|
|
|
RNA_def_property_enum_items(prop, detail_refine_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Detail Refine Method",
|
|
|
|
|
"In dynamic-topology mode, how to add or remove mesh detail");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2013-12-12 19:01:11 +02:00
|
|
|
|
2014-03-06 20:04:57 +02:00
|
|
|
prop = RNA_def_property(srna, "detail_type_method", PROP_ENUM, PROP_NONE);
|
|
|
|
|
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
|
|
|
|
|
RNA_def_property_enum_items(prop, detail_type_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Detail Type Method",
|
2014-03-07 13:28:39 +11:00
|
|
|
"In dynamic-topology mode, how mesh detail size is calculated");
|
2014-03-06 20:04:57 +02:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
|
|
|
|
|
2013-12-12 19:01:11 +02:00
|
|
|
prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_NONE);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "gravity_factor");
|
|
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Gravity", "Amount of gravity after each dab");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "gravity_object", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Orientation", "Object whose Z axis defines orientation of gravity");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2009-07-25 22:31:02 +00:00
|
|
|
}
|
|
|
|
|
|
2012-01-17 16:31:13 +00:00
|
|
|
|
|
|
|
|
static void rna_def_uv_sculpt(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "UvSculpt", "Paint");
|
2013-01-22 03:11:11 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_UvSculpt_path");
|
2012-01-17 16:31:13 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "UV Sculpting", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-01-15 13:23:57 +00:00
|
|
|
/* use for weight paint too */
|
2009-07-25 22:31:02 +00:00
|
|
|
static void rna_def_vertex_paint(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2010-01-20 08:30:40 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "VertexPaint", "Paint");
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "VPaint");
|
2013-01-22 03:11:11 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_VertexPaint_path");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode");
|
2012-01-15 13:23:57 +00:00
|
|
|
|
|
|
|
|
/* vertex paint only */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_NORMALS);
|
2011-12-04 17:36:13 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Normals", "Apply the vertex normal before painting");
|
2013-10-30 04:56:32 +00:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SPRAY);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Spray", "Keep applying paint effect while holding mouse");
|
2013-10-30 04:56:32 +00:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2012-01-15 13:23:57 +00:00
|
|
|
|
|
|
|
|
/* weight paint only */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE);
|
2012-01-15 13:23:57 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_ONLYVGROUP);
|
2013-06-23 17:27:50 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to vertices in the group");
|
2013-10-30 04:56:32 +00:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2009-07-25 22:31:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_image_paint(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2014-10-06 15:12:06 +02:00
|
|
|
FunctionRNA *func;
|
2014-08-28 16:40:38 +02:00
|
|
|
|
|
|
|
|
static EnumPropertyItem paint_type_items[] = {
|
|
|
|
|
{IMAGEPAINT_MODE_MATERIAL, "MATERIAL", 0,
|
|
|
|
|
"Material", "Detect image slots from the material"},
|
|
|
|
|
{IMAGEPAINT_MODE_IMAGE, "IMAGE", 0,
|
|
|
|
|
"Image", "Set image for texture painting directly"},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "ImagePaint", "Paint");
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "ImagePaintSettings");
|
2013-01-22 03:11:11 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_ImagePaintSettings_path");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode");
|
2014-10-06 15:12:06 +02:00
|
|
|
|
|
|
|
|
/* functions */
|
|
|
|
|
func = RNA_def_function(srna, "detect_data", "rna_ImaPaint_detect_data");
|
|
|
|
|
RNA_def_function_ui_description(func, "Check if required texpaint data exist");
|
|
|
|
|
|
|
|
|
|
/* return type */
|
|
|
|
|
RNA_def_function_return(func, RNA_def_boolean(func, "ok", 1, "", ""));
|
2010-01-20 08:30:40 +00:00
|
|
|
|
2013-03-06 19:54:43 +00:00
|
|
|
/* booleans */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE);
|
2009-07-26 03:54:17 +00:00
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_XRAY);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Occlude", "Only paint onto the faces directly under the brush (slower)");
|
2013-10-30 04:56:32 +00:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
|
2009-07-26 03:54:17 +00:00
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_BACKFACE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)");
|
2013-10-30 04:56:32 +00:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE);
|
2009-07-26 03:54:17 +00:00
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_FLAT);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view");
|
2013-10-30 04:56:32 +00:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE);
|
2009-12-22 10:48:13 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL);
|
2011-11-23 17:25:25 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Stencil Layer", "Set the mask layer from the UV map buttons");
|
2014-08-28 16:40:38 +02:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
|
2015-02-10 20:22:25 +01:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE);
|
2009-12-22 10:48:13 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL_INV);
|
2009-07-26 03:54:17 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer");
|
2014-08-28 16:40:38 +02:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
|
2014-07-21 12:02:05 +02:00
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "stencil_image", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "stencil");
|
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Stencil Image", "Image used as stencil");
|
2014-10-06 15:12:06 +02:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_stencil_update");
|
2014-07-21 12:02:05 +02:00
|
|
|
|
2014-08-28 16:40:38 +02:00
|
|
|
prop = RNA_def_property(srna, "canvas", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Canvas", "Image used as canvas");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_canvas_update");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "clone");
|
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Clone Image", "Image used as clone source");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
|
|
|
|
|
2014-07-21 12:02:05 +02:00
|
|
|
prop = RNA_def_property(srna, "stencil_color", PROP_FLOAT, PROP_COLOR_GAMMA);
|
|
|
|
|
RNA_def_property_range(prop, 0.0, 1.0);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "stencil_col");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Stencil Color", "Stencil color in the viewport");
|
2014-08-28 16:40:38 +02:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
|
2015-01-29 19:23:45 +01:00
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "dither", PROP_FLOAT, PROP_NONE);
|
|
|
|
|
RNA_def_property_range(prop, 0.0, 2.0);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Dither", "Amount of dithering when painting on byte images");
|
|
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_CLONE);
|
2011-11-23 17:25:25 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Clone Map",
|
2011-12-04 17:36:13 +00:00
|
|
|
"Use another UV map as clone source, otherwise use the 3D cursor as the source");
|
2015-02-17 03:26:03 +01:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
|
|
|
|
/* integers */
|
|
|
|
|
|
2013-12-13 04:39:15 +11:00
|
|
|
prop = RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_PIXEL);
|
2013-04-08 18:55:08 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0, 8, 0, -1);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Bleed", "Extend paint beyond the faces UVs to reduce seams (in pixels, slower)");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_range(prop, 0, 90);
|
2010-05-04 05:15:53 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Angle", "Paint most on faces pointing towards the view according to this angle");
|
2010-03-08 20:08:04 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_int_array(srna, "screen_grab_size", 2, NULL, 0, 0, "screen_grab_size",
|
2012-05-12 11:01:29 +00:00
|
|
|
"Size to capture the image for re-projecting", 0, 0);
|
2010-03-08 20:08:04 +00:00
|
|
|
RNA_def_property_range(prop, 512, 16384);
|
2014-08-28 16:40:38 +02:00
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
|
|
|
|
|
RNA_def_property_enum_items(prop, paint_type_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Mode", "Mode of operation for projection painting");
|
2014-10-06 15:12:06 +02:00
|
|
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update");
|
|
|
|
|
|
|
|
|
|
/* Missing data */
|
|
|
|
|
prop = RNA_def_property(srna, "missing_uvs", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "missing_data", IMAGEPAINT_MISSING_UVS);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Missing UVs",
|
|
|
|
|
"A UV layer is missing on the mesh");
|
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "missing_materials", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "missing_data", IMAGEPAINT_MISSING_MATERIAL);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Missing Materials",
|
|
|
|
|
"The mesh is missing materials");
|
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "missing_stencil", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "missing_data", IMAGEPAINT_MISSING_STENCIL);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Missing Stencil",
|
|
|
|
|
"Image Painting does not have a stencil");
|
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "missing_texture", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "missing_data", IMAGEPAINT_MISSING_TEX);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Missing Texture",
|
|
|
|
|
"Image Painting does not have a texture to paint on");
|
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
2009-07-25 22:31:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_particle_edit(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
|
|
static EnumPropertyItem select_mode_items[] = {
|
2009-11-28 18:19:34 +00:00
|
|
|
{SCE_SELECT_PATH, "PATH", ICON_PARTICLE_PATH, "Path", "Path edit mode"},
|
|
|
|
|
{SCE_SELECT_POINT, "POINT", ICON_PARTICLE_POINT, "Point", "Point select mode"},
|
|
|
|
|
{SCE_SELECT_END, "TIP", ICON_PARTICLE_TIP, "Tip", "Tip select mode"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2009-07-25 22:31:02 +00:00
|
|
|
|
|
|
|
|
static EnumPropertyItem puff_mode[] = {
|
2010-02-11 01:11:52 +00:00
|
|
|
{0, "ADD", 0, "Add", "Make hairs more puffy"},
|
|
|
|
|
{1, "SUB", 0, "Sub", "Make hairs less puffy"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2009-07-25 22:31:02 +00:00
|
|
|
|
|
|
|
|
static EnumPropertyItem length_mode[] = {
|
2010-02-11 01:11:52 +00:00
|
|
|
{0, "GROW", 0, "Grow", "Make hairs longer"},
|
|
|
|
|
{1, "SHRINK", 0, "Shrink", "Make hairs shorter"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
static EnumPropertyItem edit_type_items[] = {
|
2009-08-29 15:20:36 +00:00
|
|
|
{PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
|
|
|
|
|
{PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft body", ""},
|
|
|
|
|
{PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2009-07-25 22:31:02 +00:00
|
|
|
/* edit */
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "ParticleEdit", NULL);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "ParticleEditSettings");
|
2013-01-22 03:11:11 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_ParticleEdit_path");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "brushtype");
|
2009-08-29 15:20:36 +00:00
|
|
|
RNA_def_property_enum_items(prop, particle_edit_hair_brush_items);
|
2010-03-22 17:12:08 +00:00
|
|
|
RNA_def_property_enum_funcs(prop, NULL, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Tool", "");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode");
|
|
|
|
|
RNA_def_property_enum_items(prop, select_mode_items);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_LOCK_FIRST);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DEFLECT_EMITTER);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "emitter_distance", PROP_FLOAT, PROP_UNSIGNED);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "emitterdist");
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Emitter Distance", "Distance to keep particles away from the emitter");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE);
|
2009-08-29 15:20:36 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_FADE_TIME);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Fade Time", "Fade paths and keys further away from current frame");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE);
|
2009-08-29 15:20:36 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically");
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
|
2009-08-29 15:20:36 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Draw Particles", "Draw actual particles");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_INTERPOLATE_ADDED);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Interpolate", "Interpolate new particles from the existing ones");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "totaddkey");
|
2010-11-21 03:45:35 +00:00
|
|
|
RNA_def_property_range(prop, 2, SHRT_MAX);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_ui_range(prop, 2, 20, 10, 3);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Keys", "How many keys to make new particles with");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_struct_type(prop, "ParticleBrush");
|
2010-08-03 05:14:59 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL, NULL);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Brush", "");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
|
2012-01-19 09:58:25 +00:00
|
|
|
RNA_def_property_range(prop, 1, 10);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Steps", "How many steps to draw the path with");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE);
|
2012-01-19 09:58:25 +00:00
|
|
|
RNA_def_property_range(prop, 1, 100);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Frames", "How many frames to fade");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
|
2009-08-29 15:20:36 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "edittype");
|
|
|
|
|
RNA_def_property_enum_items(prop, edit_type_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Type", "");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
|
2009-08-29 15:20:36 +00:00
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL);
|
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "is_hair", PROP_BOOLEAN, PROP_NONE);
|
2009-08-29 15:20:36 +00:00
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", NULL);
|
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Hair", "Editing hair");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
|
2009-08-29 15:20:36 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Object", "The edited object");
|
|
|
|
|
|
2014-10-22 16:36:23 +02:00
|
|
|
prop = RNA_def_property(srna, "shape_object", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Shape Object", "Outer shape to use for tools");
|
2015-06-05 12:56:56 +02:00
|
|
|
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Mesh_object_poll");
|
2014-10-22 16:36:23 +02:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2009-07-25 22:31:02 +00:00
|
|
|
/* brush */
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "ParticleBrush", NULL);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "ParticleBrushData");
|
2013-01-22 13:47:44 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_ParticleBrush_path");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Particle Brush", "Particle editing brush");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2013-12-13 04:39:15 +11:00
|
|
|
prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
|
2010-11-21 09:06:27 +00:00
|
|
|
RNA_def_property_range(prop, 1, SHRT_MAX);
|
2015-04-16 00:59:43 +10:00
|
|
|
RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 10, 3);
|
2011-04-01 20:36:27 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
|
2010-03-22 17:12:08 +00:00
|
|
|
RNA_def_property_range(prop, 0.001, 1.0);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Strength", "Brush strength");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
|
2010-03-22 17:12:08 +00:00
|
|
|
RNA_def_property_range(prop, 1, 1000);
|
|
|
|
|
RNA_def_property_ui_range(prop, 1, 100, 10, 3);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Count", "Particle count");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "steps", PROP_INT, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "step");
|
2010-11-21 03:45:35 +00:00
|
|
|
RNA_def_property_range(prop, 1, SHRT_MAX);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_ui_range(prop, 1, 50, 10, 3);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Steps", "Brush steps");
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "puff_mode", PROP_ENUM, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "invert");
|
|
|
|
|
RNA_def_property_enum_items(prop, puff_mode);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Puff Mode", "");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE);
|
2010-01-12 16:35:34 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_BRUSH_DATA_PUFF_VOLUME);
|
2011-10-20 07:56:04 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Puff Volume",
|
|
|
|
|
"Apply puff to unselected end-points (helps maintain hair volume when puffing root)");
|
2010-01-12 16:35:34 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "invert");
|
|
|
|
|
RNA_def_property_enum_items(prop, length_mode);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Length Mode", "");
|
|
|
|
|
|
|
|
|
|
/* dummy */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_struct_type(prop, "CurveMapping");
|
2010-08-03 05:14:59 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", NULL, NULL, NULL);
|
2009-07-25 22:31:02 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Curve", "");
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-13 21:03:13 +13:00
|
|
|
static void rna_def_gpencil_sculpt(BlenderRNA *brna)
|
|
|
|
|
{
|
2015-12-13 19:50:59 +11:00
|
|
|
static EnumPropertyItem prop_direction_items[] = {
|
2015-12-13 21:03:13 +13:00
|
|
|
{0, "ADD", 0, "Add", "Add effect of brush"},
|
|
|
|
|
{GP_EDITBRUSH_FLAG_INVERT, "SUBTRACT", 0, "Subtract", "Subtract effect of brush"},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}};
|
|
|
|
|
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
|
|
/* == Settings == */
|
|
|
|
|
srna = RNA_def_struct(brna, "GPencilSculptSettings", NULL);
|
|
|
|
|
RNA_def_struct_sdna(srna, "GP_BrushEdit_Settings");
|
|
|
|
|
RNA_def_struct_path_func(srna, "rna_GPencilSculptSettings_path");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "GPencil Sculpt Settings", "Properties for Grease Pencil stroke sculpting tool");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
|
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "brushtype");
|
|
|
|
|
RNA_def_property_enum_items(prop, rna_enum_gpencil_sculpt_brush_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Tool", "");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_struct_type(prop, "GPencilSculptBrush");
|
|
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_GPencilSculptSettings_brush_get", NULL, NULL, NULL);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Brush", "");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "use_select_mask", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSHEDIT_FLAG_SELECT_MASK);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected stroke points");
|
|
|
|
|
RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0); // FIXME: this needs a custom icon
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* brush */
|
|
|
|
|
srna = RNA_def_struct(brna, "GPencilSculptBrush", NULL);
|
|
|
|
|
RNA_def_struct_sdna(srna, "GP_EditBrush_Data");
|
|
|
|
|
RNA_def_struct_path_func(srna, "rna_GPencilSculptBrush_path");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "GPencil Sculpt Brush", "Stroke editing brush");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
|
|
|
|
|
RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS);
|
|
|
|
|
RNA_def_property_ui_range(prop, 1, 100, 10, 3); // XXX: too big
|
|
|
|
|
RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
|
|
|
|
|
RNA_def_property_range(prop, 0.001, 1.0);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Strength", "Brush strength");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_EDITBRUSH_FLAG_USE_PRESSURE);
|
|
|
|
|
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "use_falloff", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_EDITBRUSH_FLAG_USE_FALLOFF);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Use Falloff", "Strength of brush decays with distance from cursor");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "affect_pressure", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_EDITBRUSH_FLAG_SMOOTH_PRESSURE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Affect Pressure", "Affect pressure values as well when smoothing strokes");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
|
|
|
|
|
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_direction_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Direction", "");
|
|
|
|
|
}
|
|
|
|
|
|
2009-07-25 22:31:02 +00:00
|
|
|
void RNA_def_sculpt_paint(BlenderRNA *brna)
|
|
|
|
|
{
|
2013-02-05 14:25:22 +00:00
|
|
|
/* *** Non-Animated *** */
|
|
|
|
|
RNA_define_animate_sdna(false);
|
2014-07-21 12:02:05 +02:00
|
|
|
rna_def_paint_curve(brna);
|
2009-08-16 19:50:00 +00:00
|
|
|
rna_def_paint(brna);
|
2009-07-25 22:31:02 +00:00
|
|
|
rna_def_sculpt(brna);
|
2012-01-17 16:31:13 +00:00
|
|
|
rna_def_uv_sculpt(brna);
|
2009-07-25 22:31:02 +00:00
|
|
|
rna_def_vertex_paint(brna);
|
|
|
|
|
rna_def_image_paint(brna);
|
|
|
|
|
rna_def_particle_edit(brna);
|
2015-12-13 21:03:13 +13:00
|
|
|
rna_def_gpencil_sculpt(brna);
|
2013-02-05 14:25:22 +00:00
|
|
|
RNA_define_animate_sdna(true);
|
2009-07-25 22:31:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|