2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-11-30 16:38:56 +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.
|
2008-11-30 16:38:56 +00:00
|
|
|
*
|
|
|
|
|
* Contributor(s): Blender Foundation (2008).
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
2011-02-27 20:20:01 +00:00
|
|
|
/** \file blender/makesrna/intern/rna_lattice.c
|
|
|
|
|
* \ingroup RNA
|
|
|
|
|
*/
|
|
|
|
|
|
2008-11-30 16:38:56 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
2009-01-08 13:57:29 +00:00
|
|
|
#include "DNA_curve_types.h"
|
2008-11-30 16:38:56 +00:00
|
|
|
#include "DNA_key_types.h"
|
2009-01-02 14:48:03 +00:00
|
|
|
#include "DNA_lattice_types.h"
|
|
|
|
|
#include "DNA_meshdata_types.h"
|
2008-11-30 16:38:56 +00:00
|
|
|
|
2013-03-07 02:44:55 +00:00
|
|
|
#include "BLI_utildefines.h"
|
|
|
|
|
|
|
|
|
|
#include "RNA_define.h"
|
|
|
|
|
#include "RNA_enum_types.h"
|
|
|
|
|
#include "rna_internal.h"
|
|
|
|
|
|
2008-11-30 16:38:56 +00:00
|
|
|
#ifdef RNA_RUNTIME
|
2009-01-02 14:48:03 +00:00
|
|
|
|
2009-07-03 15:23:33 +00:00
|
|
|
#include "DNA_object_types.h"
|
|
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
|
|
|
|
|
|
#include "BKE_depsgraph.h"
|
|
|
|
|
#include "BKE_lattice.h"
|
|
|
|
|
#include "BKE_main.h"
|
2010-04-20 21:38:55 +00:00
|
|
|
#include "BKE_deform.h"
|
2009-07-03 15:23:33 +00:00
|
|
|
|
|
|
|
|
#include "WM_api.h"
|
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_LatticePoint_co_get(PointerRNA *ptr, float *values)
|
2009-01-02 14:48:03 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lattice *lt = (Lattice *)ptr->id.data;
|
|
|
|
|
BPoint *bp = (BPoint *)ptr->data;
|
2013-06-24 13:45:35 +00:00
|
|
|
int index = bp - lt->def;
|
|
|
|
|
int u, v, w;
|
|
|
|
|
|
|
|
|
|
BKE_lattice_index_to_uvw(lt, index, &u, &v, &w);
|
|
|
|
|
|
|
|
|
|
values[0] = lt->fu + u * lt->du;
|
|
|
|
|
values[1] = lt->fv + v * lt->dv;
|
|
|
|
|
values[2] = lt->fw + w * lt->dw;
|
2009-01-02 14:48:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lattice *lt = (Lattice *)ptr->id.data;
|
2009-01-02 14:48:03 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (lt->dvert) {
|
2012-05-12 11:01:29 +00:00
|
|
|
BPoint *bp = (BPoint *)ptr->data;
|
|
|
|
|
MDeformVert *dvert = lt->dvert + (bp - lt->def);
|
2009-01-02 14:48:03 +00:00
|
|
|
|
2012-05-12 11:01:29 +00:00
|
|
|
rna_iterator_array_begin(iter, (void *)dvert->dw, sizeof(MDeformWeight), dvert->totweight, 0, NULL);
|
2009-01-02 14:48:03 +00:00
|
|
|
}
|
|
|
|
|
else
|
2009-07-13 19:33:59 +00:00
|
|
|
rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL);
|
2009-01-02 14:48:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lattice *lt = (Lattice *)ptr->data;
|
|
|
|
|
int tot = lt->pntsu * lt->pntsv * lt->pntsw;
|
2009-01-02 14:48:03 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (lt->editlatt && lt->editlatt->latt->def)
|
2012-05-12 11:01:29 +00:00
|
|
|
rna_iterator_array_begin(iter, (void *)lt->editlatt->latt->def, sizeof(BPoint), tot, 0, NULL);
|
2012-03-05 23:30:41 +00:00
|
|
|
else if (lt->def)
|
2012-05-12 11:01:29 +00:00
|
|
|
rna_iterator_array_begin(iter, (void *)lt->def, sizeof(BPoint), tot, 0, NULL);
|
2009-01-02 14:48:03 +00:00
|
|
|
else
|
2009-07-13 19:33:59 +00:00
|
|
|
rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL);
|
2009-01-02 14:48:03 +00:00
|
|
|
}
|
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_Lattice_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
2009-07-03 15:23:33 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
ID *id = ptr->id.data;
|
2009-07-03 15:23:33 +00:00
|
|
|
|
2011-01-03 12:41:16 +00:00
|
|
|
DAG_id_tag_update(id, 0);
|
2012-05-12 11:01:29 +00:00
|
|
|
WM_main_add_notifier(NC_GEOM | ND_DATA, id);
|
2009-07-03 15:23:33 +00:00
|
|
|
}
|
|
|
|
|
|
2009-12-08 17:23:48 +00:00
|
|
|
static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr)
|
2009-07-03 15:23:33 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
Lattice *lt = ptr->id.data;
|
2009-07-03 15:23:33 +00:00
|
|
|
Object *ob;
|
|
|
|
|
int newu, newv, neww;
|
|
|
|
|
|
|
|
|
|
/* we don't modify the actual pnts, but go through opnts instead */
|
2012-05-12 11:01:29 +00:00
|
|
|
newu = (lt->opntsu > 0) ? lt->opntsu : lt->pntsu;
|
|
|
|
|
newv = (lt->opntsv > 0) ? lt->opntsv : lt->pntsv;
|
|
|
|
|
neww = (lt->opntsw > 0) ? lt->opntsw : lt->pntsw;
|
2009-07-03 15:23:33 +00:00
|
|
|
|
2012-05-05 16:03:57 +00:00
|
|
|
/* BKE_lattice_resize needs an object, any object will have the same result */
|
2012-03-05 23:30:41 +00:00
|
|
|
for (ob = bmain->object.first; ob; ob = ob->id.next) {
|
|
|
|
|
if (ob->data == lt) {
|
2012-05-05 16:03:57 +00:00
|
|
|
BKE_lattice_resize(lt, newu, newv, neww, ob);
|
2012-03-05 23:30:41 +00:00
|
|
|
if (lt->editlatt)
|
2012-05-05 16:03:57 +00:00
|
|
|
BKE_lattice_resize(lt->editlatt->latt, newu, newv, neww, ob);
|
2009-07-03 15:23:33 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* otherwise without, means old points are not repositioned */
|
2012-03-05 23:30:41 +00:00
|
|
|
if (!ob) {
|
2012-05-05 16:03:57 +00:00
|
|
|
BKE_lattice_resize(lt, newu, newv, neww, NULL);
|
2012-03-05 23:30:41 +00:00
|
|
|
if (lt->editlatt)
|
2012-05-05 16:03:57 +00:00
|
|
|
BKE_lattice_resize(lt->editlatt->latt, newu, newv, neww, NULL);
|
2009-07-03 15:23:33 +00:00
|
|
|
}
|
|
|
|
|
|
2009-12-08 17:23:48 +00:00
|
|
|
rna_Lattice_update_data(bmain, scene, ptr);
|
2009-07-03 15:23:33 +00:00
|
|
|
}
|
|
|
|
|
|
2010-08-18 07:14:10 +00:00
|
|
|
static void rna_Lattice_use_outside_set(PointerRNA *ptr, int value)
|
2009-07-03 15:23:33 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
Lattice *lt = ptr->data;
|
2009-07-03 15:23:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (value) lt->flag |= LT_OUTSIDE;
|
2009-07-03 15:23:33 +00:00
|
|
|
else lt->flag &= ~LT_OUTSIDE;
|
|
|
|
|
|
|
|
|
|
outside_lattice(lt);
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (lt->editlatt) {
|
|
|
|
|
if (value) lt->editlatt->latt->flag |= LT_OUTSIDE;
|
2010-08-10 06:36:42 +00:00
|
|
|
else lt->editlatt->latt->flag &= ~LT_OUTSIDE;
|
2009-07-03 15:23:33 +00:00
|
|
|
|
2010-08-10 06:36:42 +00:00
|
|
|
outside_lattice(lt->editlatt->latt);
|
2009-07-03 15:23:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-10 06:36:42 +00:00
|
|
|
static int rna_Lattice_size_editable(PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lattice *lt = (Lattice *)ptr->data;
|
2010-08-10 06:36:42 +00:00
|
|
|
|
|
|
|
|
return lt->key == NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2009-07-03 15:23:33 +00:00
|
|
|
static void rna_Lattice_points_u_set(PointerRNA *ptr, int value)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lattice *lt = (Lattice *)ptr->data;
|
2010-08-10 06:36:42 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
lt->opntsu = CLAMPIS(value, 1, 64);
|
2009-07-03 15:23:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Lattice_points_v_set(PointerRNA *ptr, int value)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lattice *lt = (Lattice *)ptr->data;
|
2010-08-10 06:36:42 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
lt->opntsv = CLAMPIS(value, 1, 64);
|
2009-07-03 15:23:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Lattice_points_w_set(PointerRNA *ptr, int value)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lattice *lt = (Lattice *)ptr->data;
|
2010-08-10 06:36:42 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
lt->opntsw = CLAMPIS(value, 1, 64);
|
2009-07-03 15:23:33 +00:00
|
|
|
}
|
|
|
|
|
|
2010-04-20 21:38:55 +00:00
|
|
|
static void rna_Lattice_vg_name_set(PointerRNA *ptr, const char *value)
|
|
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
Lattice *lt = ptr->data;
|
2011-10-19 23:10:54 +00:00
|
|
|
BLI_strncpy(lt->vgroup, value, sizeof(lt->vgroup));
|
2010-04-20 21:38:55 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (lt->editlatt) {
|
2011-10-19 23:10:54 +00:00
|
|
|
BLI_strncpy(lt->editlatt->latt->vgroup, value, sizeof(lt->editlatt->latt->vgroup));
|
|
|
|
|
}
|
2010-04-20 21:38:55 +00:00
|
|
|
}
|
|
|
|
|
|
2010-12-13 06:31:49 +00:00
|
|
|
/* annoying, but is a consequence of RNA structures... */
|
|
|
|
|
static char *rna_LatticePoint_path(PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lattice *lt = (Lattice *)ptr->id.data;
|
2012-03-05 23:30:41 +00:00
|
|
|
void *point = ptr->data;
|
2010-12-13 06:31:49 +00:00
|
|
|
BPoint *points = NULL;
|
|
|
|
|
|
|
|
|
|
if (lt->editlatt && lt->editlatt->latt->def)
|
|
|
|
|
points = lt->editlatt->latt->def;
|
|
|
|
|
else
|
|
|
|
|
points = lt->def;
|
|
|
|
|
|
|
|
|
|
if (points && point) {
|
2012-05-12 11:01:29 +00:00
|
|
|
int tot = lt->pntsu * lt->pntsv * lt->pntsw;
|
2010-12-13 06:31:49 +00:00
|
|
|
|
|
|
|
|
/* only return index if in range */
|
|
|
|
|
if ((point >= (void *)points) && (point < (void *)(points + tot))) {
|
|
|
|
|
int pt_index = (int)((BPoint *)point - points);
|
|
|
|
|
|
|
|
|
|
return BLI_sprintfN("points[%d]", pt_index);
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-12-13 08:44:07 +00:00
|
|
|
|
|
|
|
|
return BLI_strdup("");
|
2010-12-13 06:31:49 +00:00
|
|
|
}
|
|
|
|
|
|
2010-04-20 21:38:55 +00:00
|
|
|
|
2008-11-30 16:38:56 +00:00
|
|
|
#else
|
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static void rna_def_latticepoint(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "LatticePoint", NULL);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_struct_sdna(srna, "BPoint");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "LatticePoint", "Point in the lattice grid");
|
2010-12-13 06:31:49 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_LatticePoint_path");
|
2009-01-02 14:48:03 +00:00
|
|
|
|
2012-07-19 11:40:25 +00:00
|
|
|
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Point selected", "Selection status");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_array(prop, 3);
|
2009-03-23 13:24:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_LatticePoint_co_get", NULL, NULL);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Location", "");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "co_deform", PROP_FLOAT, PROP_TRANSLATION);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "vec");
|
|
|
|
|
RNA_def_property_array(prop, 3);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Deformed Location", "");
|
2009-07-03 15:23:33 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
|
2009-01-02 14:48:03 +00:00
|
|
|
|
2012-10-09 08:40:20 +00:00
|
|
|
prop = RNA_def_property(srna, "weight_softbody", PROP_FLOAT, PROP_NONE);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "weight");
|
|
|
|
|
RNA_def_property_range(prop, 0.01f, 100.0f);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next",
|
|
|
|
|
"rna_iterator_array_end", "rna_iterator_array_get",
|
|
|
|
|
NULL, NULL, NULL, NULL);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_struct_type(prop, "VertexGroupElement");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this point is member of");
|
2009-01-02 14:48:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_lattice(BlenderRNA *brna)
|
2008-11-30 16:38:56 +00:00
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "Lattice", "ID");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Lattice", "Lattice datablock defining a grid for deforming other objects");
|
2009-06-03 23:16:51 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_LATTICE_DATA);
|
2008-11-30 16:38:56 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "points_u", PROP_INT, PROP_NONE);
|
2008-11-30 16:38:56 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "pntsu");
|
2009-07-03 15:23:33 +00:00
|
|
|
RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_u_set", NULL);
|
|
|
|
|
RNA_def_property_range(prop, 1, 64);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "U", "Point in U direction (can't be changed when there are shape keys)");
|
2009-07-03 15:23:33 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
|
2010-08-10 06:36:42 +00:00
|
|
|
RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");
|
2008-11-30 16:38:56 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "points_v", PROP_INT, PROP_NONE);
|
2008-11-30 16:38:56 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "pntsv");
|
2009-07-03 15:23:33 +00:00
|
|
|
RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_v_set", NULL);
|
|
|
|
|
RNA_def_property_range(prop, 1, 64);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "V", "Point in V direction (can't be changed when there are shape keys)");
|
2009-07-03 15:23:33 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
|
2010-08-10 06:36:42 +00:00
|
|
|
RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");
|
2008-11-30 16:38:56 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "points_w", PROP_INT, PROP_NONE);
|
2008-11-30 16:38:56 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "pntsw");
|
2009-07-03 15:23:33 +00:00
|
|
|
RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_w_set", NULL);
|
|
|
|
|
RNA_def_property_range(prop, 1, 64);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "W", "Point in W direction (can't be changed when there are shape keys)");
|
2009-07-03 15:23:33 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
|
2010-08-10 06:36:42 +00:00
|
|
|
RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");
|
2008-11-30 16:38:56 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "interpolation_type_u", PROP_ENUM, PROP_NONE);
|
2008-12-03 20:17:12 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "typeu");
|
2012-05-22 13:43:36 +00:00
|
|
|
RNA_def_property_enum_items(prop, keyblock_type_items);
|
2008-11-30 16:38:56 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Interpolation Type U", "");
|
2009-07-03 15:23:33 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
|
2008-11-30 16:38:56 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "interpolation_type_v", PROP_ENUM, PROP_NONE);
|
2008-12-03 20:17:12 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "typev");
|
2012-05-22 13:43:36 +00:00
|
|
|
RNA_def_property_enum_items(prop, keyblock_type_items);
|
2008-11-30 16:38:56 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Interpolation Type V", "");
|
2009-07-03 15:23:33 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
|
2008-11-30 16:38:56 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "interpolation_type_w", PROP_ENUM, PROP_NONE);
|
2008-12-03 20:17:12 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "typew");
|
2012-05-22 13:43:36 +00:00
|
|
|
RNA_def_property_enum_items(prop, keyblock_type_items);
|
2008-11-30 16:38:56 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Interpolation Type W", "");
|
2009-07-03 15:23:33 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
|
2008-11-30 16:38:56 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_outside", PROP_BOOLEAN, PROP_NONE);
|
2008-11-30 16:38:56 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", LT_OUTSIDE);
|
2010-08-18 07:14:10 +00:00
|
|
|
RNA_def_property_boolean_funcs(prop, NULL, "rna_Lattice_use_outside_set");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Outside", "Only draw, and take into account, the outer vertices");
|
2009-07-03 15:23:33 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
|
2010-04-20 21:38:55 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
|
2010-04-20 21:38:55 +00:00
|
|
|
RNA_def_property_string_sdna(prop, NULL, "vgroup");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group to apply the influence of the lattice");
|
|
|
|
|
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Lattice_vg_name_set");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
|
2008-12-03 21:18:10 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "key");
|
2008-12-04 00:07:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Shape Keys", "");
|
2009-01-02 14:48:03 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_struct_type(prop, "LatticePoint");
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_Lattice_points_begin", "rna_iterator_array_next",
|
|
|
|
|
"rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Points", "Points of the lattice");
|
2012-10-09 08:40:20 +00:00
|
|
|
|
2010-12-13 06:31:49 +00:00
|
|
|
/* pointers */
|
|
|
|
|
rna_def_animdata_common(srna);
|
2009-01-02 14:48:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RNA_def_lattice(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
rna_def_lattice(brna);
|
|
|
|
|
rna_def_latticepoint(brna);
|
2008-11-30 16:38:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|