2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-11-07 02:58:25 +00:00
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* ***** 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-07 02:58:25 +00:00
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation (2008).
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2011-02-27 20:20:01 +00:00
|
|
|
/** \file blender/makesrna/intern/rna_mesh.c
|
|
|
|
* \ingroup RNA
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "RNA_define.h"
|
|
|
|
|
|
|
|
#include "rna_internal.h"
|
|
|
|
|
2008-11-24 12:12:24 +00:00
|
|
|
#include "DNA_material_types.h"
|
2008-11-07 02:58:25 +00:00
|
|
|
#include "DNA_mesh_types.h"
|
|
|
|
#include "DNA_meshdata_types.h"
|
2008-11-24 12:12:24 +00:00
|
|
|
#include "DNA_object_types.h"
|
|
|
|
|
2010-06-13 02:54:55 +00:00
|
|
|
#include "WM_types.h"
|
|
|
|
|
2011-06-09 08:58:27 +00:00
|
|
|
#include "BLI_math_base.h"
|
|
|
|
#include "BLI_math_rotation.h"
|
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
#ifdef RNA_RUNTIME
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
|
|
|
|
#include "BLI_editVert.h"
|
2009-11-10 20:43:45 +00:00
|
|
|
#include "BLI_math.h"
|
2009-07-01 22:25:49 +00:00
|
|
|
|
|
|
|
#include "BKE_customdata.h"
|
|
|
|
#include "BKE_depsgraph.h"
|
|
|
|
#include "BKE_main.h"
|
|
|
|
#include "BKE_mesh.h"
|
2011-01-07 19:18:31 +00:00
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
|
2010-04-12 03:06:49 +00:00
|
|
|
#include "ED_mesh.h" /* XXX Bad level call */
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
#include "WM_api.h"
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_Mesh_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
2009-07-01 22:25:49 +00:00
|
|
|
{
|
|
|
|
ID *id= ptr->id.data;
|
|
|
|
|
2010-08-13 14:42:45 +00:00
|
|
|
/* cheating way for importers to avoid slow updates */
|
|
|
|
if(id->us > 0) {
|
2011-01-03 12:41:16 +00:00
|
|
|
DAG_id_tag_update(id, 0);
|
2010-08-13 14:42:45 +00:00
|
|
|
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_Mesh_update_select(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
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
|
|
|
{
|
|
|
|
ID *id= ptr->id.data;
|
2010-08-13 14:42:45 +00:00
|
|
|
/* cheating way for importers to avoid slow updates */
|
|
|
|
if(id->us > 0) {
|
|
|
|
WM_main_add_notifier(NC_GEOM|ND_SELECT, id);
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
void rna_Mesh_update_draw(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
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
|
|
|
{
|
|
|
|
ID *id= ptr->id.data;
|
2010-08-13 14:42:45 +00:00
|
|
|
/* cheating way for importers to avoid slow updates */
|
|
|
|
if(id->us > 0) {
|
|
|
|
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
|
|
|
|
}
|
2009-07-01 22:25:49 +00:00
|
|
|
}
|
|
|
|
|
2011-09-18 17:10:28 +00:00
|
|
|
|
2011-07-20 15:56:35 +00:00
|
|
|
void rna_Mesh_update_vertmask(Main *bmain, Scene *scene, PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh* me = ptr->data;
|
|
|
|
if ((me->editflag & ME_EDIT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_MASK)) {
|
|
|
|
me->editflag ^= ME_EDIT_PAINT_MASK;
|
|
|
|
}
|
|
|
|
rna_Mesh_update_draw(bmain, scene, ptr);
|
|
|
|
}
|
2011-09-18 17:10:28 +00:00
|
|
|
|
2011-07-20 15:56:35 +00:00
|
|
|
void rna_Mesh_update_facemask(Main *bmain, Scene *scene, PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh* me = ptr->data;
|
|
|
|
if ((me->editflag & ME_EDIT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_MASK)) {
|
|
|
|
me->editflag ^= ME_EDIT_VERT_SEL;
|
|
|
|
}
|
|
|
|
rna_Mesh_update_draw(bmain, scene, ptr);
|
|
|
|
}
|
2009-06-20 15:06:18 +00:00
|
|
|
static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MVert *mvert= (MVert*)ptr->data;
|
2010-01-04 15:37:22 +00:00
|
|
|
normal_short_to_float_v3(value, mvert->no);
|
2009-06-20 15:06:18 +00:00
|
|
|
}
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2010-01-04 15:37:22 +00:00
|
|
|
static void rna_MeshVertex_normal_set(PointerRNA *ptr, const float *value)
|
2010-01-04 15:25:21 +00:00
|
|
|
{
|
|
|
|
MVert *mvert= (MVert*)ptr->data;
|
2010-01-04 15:37:22 +00:00
|
|
|
float no[3];
|
2010-01-04 15:25:21 +00:00
|
|
|
|
2010-01-04 15:37:22 +00:00
|
|
|
copy_v3_v3(no, value);
|
|
|
|
normalize_v3(no);
|
|
|
|
normal_float_to_short_v3(mvert->no, no);
|
2010-01-04 15:25:21 +00:00
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static float rna_MeshVertex_bevel_weight_get(PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MVert *mvert= (MVert*)ptr->data;
|
|
|
|
return mvert->bweight/255.0f;
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static void rna_MeshVertex_bevel_weight_set(PointerRNA *ptr, float value)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MVert *mvert= (MVert*)ptr->data;
|
|
|
|
mvert->bweight= (char)(CLAMPIS(value*255.0f, 0, 255));
|
|
|
|
}
|
|
|
|
|
|
|
|
static float rna_MEdge_bevel_weight_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
MEdge *medge= (MEdge*)ptr->data;
|
|
|
|
return medge->bweight/255.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_MEdge_bevel_weight_set(PointerRNA *ptr, float value)
|
|
|
|
{
|
|
|
|
MEdge *medge= (MEdge*)ptr->data;
|
|
|
|
medge->bweight= (char)(CLAMPIS(value*255.0f, 0, 255));
|
|
|
|
}
|
|
|
|
|
|
|
|
static float rna_MEdge_crease_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
MEdge *medge= (MEdge*)ptr->data;
|
|
|
|
return medge->crease/255.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_MEdge_crease_set(PointerRNA *ptr, float value)
|
|
|
|
{
|
|
|
|
MEdge *medge= (MEdge*)ptr->data;
|
|
|
|
medge->crease= (char)(CLAMPIS(value*255.0f, 0, 255));
|
|
|
|
}
|
|
|
|
|
2009-07-27 18:17:21 +00:00
|
|
|
static void rna_MeshFace_normal_get(PointerRNA *ptr, float *values)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
MFace *mface= (MFace*)ptr->data;
|
|
|
|
|
|
|
|
if(mface->v4)
|
2011-10-04 07:48:56 +00:00
|
|
|
normal_quad_v3(values,me->mvert[mface->v1].co, me->mvert[mface->v2].co,
|
|
|
|
me->mvert[mface->v3].co, me->mvert[mface->v4].co);
|
2009-07-27 18:17:21 +00:00
|
|
|
else
|
2009-11-10 20:43:45 +00:00
|
|
|
normal_tri_v3( values,me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co);
|
2009-07-27 18:17:21 +00:00
|
|
|
}
|
|
|
|
|
2009-11-03 17:51:22 +00:00
|
|
|
static float rna_MeshFace_area_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
MFace *mface= (MFace*)ptr->data;
|
|
|
|
|
|
|
|
if(mface->v4)
|
2009-11-10 20:43:45 +00:00
|
|
|
return area_quad_v3(me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co, me->mvert[mface->v4].co);
|
2009-11-03 17:51:22 +00:00
|
|
|
else
|
2009-11-10 20:43:45 +00:00
|
|
|
return area_tri_v3(me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co);
|
2009-11-03 17:51:22 +00:00
|
|
|
}
|
|
|
|
|
2009-06-20 13:53:14 +00:00
|
|
|
/* notice red and blue are swapped */
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshColor_color1_get(PointerRNA *ptr, float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
2009-06-20 13:53:14 +00:00
|
|
|
values[2]= (&mcol[0].r)[0]/255.0f;
|
2009-02-02 19:57:57 +00:00
|
|
|
values[1]= (&mcol[0].r)[1]/255.0f;
|
2009-06-20 13:53:14 +00:00
|
|
|
values[0]= (&mcol[0].r)[2]/255.0f;
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshColor_color1_set(PointerRNA *ptr, const float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
2009-06-20 13:53:14 +00:00
|
|
|
(&mcol[0].r)[2]= (char)(CLAMPIS(values[0]*255.0f, 0, 255));
|
2009-02-02 19:57:57 +00:00
|
|
|
(&mcol[0].r)[1]= (char)(CLAMPIS(values[1]*255.0f, 0, 255));
|
2009-06-20 13:53:14 +00:00
|
|
|
(&mcol[0].r)[0]= (char)(CLAMPIS(values[2]*255.0f, 0, 255));
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshColor_color2_get(PointerRNA *ptr, float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
2009-06-20 13:53:14 +00:00
|
|
|
values[2]= (&mcol[1].r)[0]/255.0f;
|
2009-02-02 19:57:57 +00:00
|
|
|
values[1]= (&mcol[1].r)[1]/255.0f;
|
2009-06-20 13:53:14 +00:00
|
|
|
values[0]= (&mcol[1].r)[2]/255.0f;
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshColor_color2_set(PointerRNA *ptr, const float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
2009-06-20 13:53:14 +00:00
|
|
|
(&mcol[1].r)[2]= (char)(CLAMPIS(values[0]*255.0f, 0, 255));
|
2009-02-02 19:57:57 +00:00
|
|
|
(&mcol[1].r)[1]= (char)(CLAMPIS(values[1]*255.0f, 0, 255));
|
2009-06-20 13:53:14 +00:00
|
|
|
(&mcol[1].r)[0]= (char)(CLAMPIS(values[2]*255.0f, 0, 255));
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshColor_color3_get(PointerRNA *ptr, float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
2009-06-20 13:53:14 +00:00
|
|
|
values[2]= (&mcol[2].r)[0]/255.0f;
|
2009-02-02 19:57:57 +00:00
|
|
|
values[1]= (&mcol[2].r)[1]/255.0f;
|
2009-06-20 13:53:14 +00:00
|
|
|
values[0]= (&mcol[2].r)[2]/255.0f;
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshColor_color3_set(PointerRNA *ptr, const float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
2009-06-20 13:53:14 +00:00
|
|
|
(&mcol[2].r)[2]= (char)(CLAMPIS(values[0]*255.0f, 0, 255));
|
2009-02-02 19:57:57 +00:00
|
|
|
(&mcol[2].r)[1]= (char)(CLAMPIS(values[1]*255.0f, 0, 255));
|
2009-06-20 13:53:14 +00:00
|
|
|
(&mcol[2].r)[0]= (char)(CLAMPIS(values[2]*255.0f, 0, 255));
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshColor_color4_get(PointerRNA *ptr, float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
2009-06-20 13:53:14 +00:00
|
|
|
values[2]= (&mcol[3].r)[0]/255.0f;
|
2009-02-02 19:57:57 +00:00
|
|
|
values[1]= (&mcol[3].r)[1]/255.0f;
|
2009-06-20 13:53:14 +00:00
|
|
|
values[0]= (&mcol[3].r)[2]/255.0f;
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshColor_color4_set(PointerRNA *ptr, const float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
2009-06-20 13:53:14 +00:00
|
|
|
(&mcol[3].r)[2]= (char)(CLAMPIS(values[0]*255.0f, 0, 255));
|
2009-02-02 19:57:57 +00:00
|
|
|
(&mcol[3].r)[1]= (char)(CLAMPIS(values[1]*255.0f, 0, 255));
|
2009-06-20 13:53:14 +00:00
|
|
|
(&mcol[3].r)[0]= (char)(CLAMPIS(values[2]*255.0f, 0, 255));
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_Mesh_texspace_set(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
2011-01-06 11:16:35 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
|
|
|
|
if (me->texflag & AUTOSPACE)
|
|
|
|
tex_space_mesh(me);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-11-24 12:12:24 +00:00
|
|
|
static int rna_Mesh_texspace_editable(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
2009-03-23 13:24:48 +00:00
|
|
|
return (me->texflag & AUTOSPACE)? 0: PROP_EDITABLE;
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2010-04-12 05:04:49 +00:00
|
|
|
static void rna_Mesh_texspace_loc_get(PointerRNA *ptr, float *values)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh *)ptr->data;
|
|
|
|
|
|
|
|
if (!me->bb)
|
|
|
|
tex_space_mesh(me);
|
|
|
|
|
|
|
|
copy_v3_v3(values, me->loc);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_Mesh_texspace_loc_set(PointerRNA *ptr, const float *values)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh *)ptr->data;
|
|
|
|
|
|
|
|
copy_v3_v3(me->loc, values);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_Mesh_texspace_size_get(PointerRNA *ptr, float *values)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh *)ptr->data;
|
|
|
|
|
|
|
|
if (!me->bb)
|
|
|
|
tex_space_mesh(me);
|
|
|
|
|
|
|
|
copy_v3_v3(values, me->size);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_Mesh_texspace_size_set(PointerRNA *ptr, const float *values)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh *)ptr->data;
|
|
|
|
|
|
|
|
copy_v3_v3(me->size, values);
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static void rna_MeshVertex_groups_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
|
|
|
|
if(me->dvert) {
|
|
|
|
MVert *mvert= (MVert*)ptr->data;
|
|
|
|
MDeformVert *dvert= me->dvert + (mvert-me->mvert);
|
|
|
|
|
2009-07-13 19:33:59 +00:00
|
|
|
rna_iterator_array_begin(iter, (void*)dvert->dw, sizeof(MDeformWeight), dvert->totweight, 0, NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
else
|
2009-07-13 19:33:59 +00:00
|
|
|
rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static void rna_MeshFace_material_index_range(PointerRNA *ptr, int *min, int *max)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
*min= 0;
|
|
|
|
*max= me->totcol-1;
|
2011-06-23 06:13:21 +00:00
|
|
|
*max= MAX2(0, *max);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static CustomData *rna_mesh_fdata(Mesh *me)
|
|
|
|
{
|
|
|
|
return (me->edit_mesh)? &me->edit_mesh->fdata: &me->fdata;
|
|
|
|
}
|
|
|
|
|
2008-11-24 12:12:24 +00:00
|
|
|
static int rna_CustomDataLayer_length(PointerRNA *ptr, int type)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
2008-11-24 12:12:24 +00:00
|
|
|
CustomDataLayer *layer;
|
|
|
|
int i, length= 0;
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
for(layer=fdata->layers, i=0; i<fdata->totlayer; layer++, i++)
|
2008-11-24 12:12:24 +00:00
|
|
|
if(layer->type == type)
|
|
|
|
length++;
|
|
|
|
|
|
|
|
return length;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_CustomDataLayer_active_get(PointerRNA *ptr, int type, int render)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
int n= ((CustomDataLayer*)ptr->data) - fdata->layers;
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
if(render) return (n == CustomData_get_render_layer_index(fdata, type));
|
|
|
|
else return (n == CustomData_get_active_layer_index(fdata, type));
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static int rna_CustomDataLayer_clone_get(PointerRNA *ptr, int type, int UNUSED(render))
|
2009-11-24 00:56:52 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
int n= ((CustomDataLayer*)ptr->data) - fdata->layers;
|
|
|
|
|
|
|
|
return (n == CustomData_get_clone_layer_index(fdata, type));
|
|
|
|
}
|
|
|
|
|
2008-11-24 12:12:24 +00:00
|
|
|
static void rna_CustomDataLayer_active_set(PointerRNA *ptr, int value, int type, int render)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
int n= ((CustomDataLayer*)ptr->data) - fdata->layers;
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
if(value == 0)
|
|
|
|
return;
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
if(render) CustomData_set_layer_render_index(fdata, type, n);
|
|
|
|
else CustomData_set_layer_active_index(fdata, type, n);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_CustomDataLayer_clone_set(PointerRNA *ptr, int value, int type, int UNUSED(render))
|
2009-11-24 00:56:52 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
int n= ((CustomDataLayer*)ptr->data) - fdata->layers;
|
|
|
|
|
|
|
|
if(value == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
CustomData_set_layer_clone_index(fdata, type, n);
|
|
|
|
}
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static int rna_uv_texture_check(CollectionPropertyIterator *UNUSED(iter), void *data)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
CustomDataLayer *layer= (CustomDataLayer*)data;
|
|
|
|
return (layer->type != CD_MTFACE);
|
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static void rna_Mesh_uv_textures_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
2011-01-11 14:39:14 +00:00
|
|
|
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_uv_texture_check);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static int rna_Mesh_uv_textures_length(PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_length(ptr, CD_MTFACE);
|
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static PointerRNA rna_Mesh_active_uv_texture_get(PointerRNA *ptr)
|
2009-06-27 01:10:39 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
int index= CustomData_get_active_layer_index(fdata, CD_MTFACE);
|
|
|
|
CustomDataLayer *cdl= (index == -1)? NULL: &fdata->layers[index];
|
2009-06-27 01:10:39 +00:00
|
|
|
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_MeshTextureFaceLayer, cdl);
|
|
|
|
}
|
|
|
|
|
2009-12-22 10:48:13 +00:00
|
|
|
static PointerRNA rna_Mesh_uv_texture_clone_get(PointerRNA *ptr)
|
2009-11-24 00:56:52 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
int index= CustomData_get_clone_layer_index(fdata, CD_MTFACE);
|
|
|
|
CustomDataLayer *cdl= (index == -1)? NULL: &fdata->layers[index];
|
|
|
|
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_MeshTextureFaceLayer, cdl);
|
|
|
|
}
|
|
|
|
|
2009-12-22 10:48:13 +00:00
|
|
|
static PointerRNA rna_Mesh_uv_texture_stencil_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
int index= CustomData_get_stencil_layer_index(fdata, CD_MTFACE);
|
|
|
|
CustomDataLayer *cdl= (index == -1)? NULL: &fdata->layers[index];
|
|
|
|
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_MeshTextureFaceLayer, cdl);
|
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static void rna_Mesh_active_uv_texture_set(PointerRNA *ptr, PointerRNA value)
|
2009-06-27 01:10:39 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
2009-06-27 01:10:39 +00:00
|
|
|
CustomDataLayer *cdl;
|
|
|
|
int a;
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
for(cdl=fdata->layers, a=0; a<fdata->totlayer; cdl++, a++) {
|
2009-06-27 01:10:39 +00:00
|
|
|
if(value.data == cdl) {
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData_set_layer_active_index(fdata, CD_MTFACE, a);
|
|
|
|
mesh_update_customdata_pointers(me);
|
2009-06-27 01:10:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-22 10:48:13 +00:00
|
|
|
static void rna_Mesh_uv_texture_clone_set(PointerRNA *ptr, PointerRNA value)
|
2009-11-24 00:56:52 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
CustomDataLayer *cdl;
|
|
|
|
int a;
|
|
|
|
|
|
|
|
for(cdl=fdata->layers, a=0; a<fdata->totlayer; cdl++, a++) {
|
|
|
|
if(value.data == cdl) {
|
|
|
|
CustomData_set_layer_clone_index(fdata, CD_MTFACE, a);
|
2009-12-22 10:48:13 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_Mesh_uv_texture_stencil_set(PointerRNA *ptr, PointerRNA value)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
CustomDataLayer *cdl;
|
|
|
|
int a;
|
|
|
|
|
|
|
|
for(cdl=fdata->layers, a=0; a<fdata->totlayer; cdl++, a++) {
|
|
|
|
if(value.data == cdl) {
|
|
|
|
CustomData_set_layer_stencil_index(fdata, CD_MTFACE, a);
|
2009-11-24 00:56:52 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static int rna_Mesh_active_uv_texture_index_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
return CustomData_get_active_layer(fdata, CD_MTFACE);
|
|
|
|
}
|
|
|
|
|
2009-12-22 10:48:13 +00:00
|
|
|
static int rna_Mesh_uv_texture_clone_index_get(PointerRNA *ptr)
|
2009-11-24 00:56:52 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
return CustomData_get_clone_layer(fdata, CD_MTFACE);
|
|
|
|
}
|
|
|
|
|
2009-12-22 10:48:13 +00:00
|
|
|
static int rna_Mesh_uv_texture_stencil_index_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
return CustomData_get_stencil_layer(fdata, CD_MTFACE);
|
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static void rna_Mesh_active_uv_texture_index_set(PointerRNA *ptr, int value)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
|
|
|
|
CustomData_set_layer_active(fdata, CD_MTFACE, value);
|
|
|
|
mesh_update_customdata_pointers(me);
|
|
|
|
}
|
|
|
|
|
2009-12-22 10:48:13 +00:00
|
|
|
static void rna_Mesh_uv_texture_clone_index_set(PointerRNA *ptr, int value)
|
2009-11-24 00:56:52 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
|
|
|
|
CustomData_set_layer_clone(fdata, CD_MTFACE, value);
|
2009-12-22 10:48:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_Mesh_uv_texture_stencil_index_set(PointerRNA *ptr, int value)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
|
|
|
|
CustomData_set_layer_stencil(fdata, CD_MTFACE, value);
|
2009-11-24 00:56:52 +00:00
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static void rna_Mesh_active_uv_texture_index_range(PointerRNA *ptr, int *min, int *max)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
|
|
|
|
*min= 0;
|
|
|
|
*max= CustomData_number_of_layers(fdata, CD_MTFACE)-1;
|
|
|
|
*max= MAX2(0, *max);
|
|
|
|
}
|
|
|
|
|
2010-04-12 03:06:49 +00:00
|
|
|
static PointerRNA rna_Mesh_active_mtface_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
EditMesh *em= BKE_mesh_get_editmesh(me);
|
|
|
|
MTFace *tf;
|
|
|
|
|
|
|
|
if (em && EM_texFaceCheck(em))
|
|
|
|
{
|
|
|
|
tf = EM_get_active_mtface(em, NULL, NULL, 1);
|
|
|
|
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_MeshTextureFace, tf);
|
|
|
|
}
|
|
|
|
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_MeshTextureFace, NULL);
|
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshTextureFace_uv1_get(PointerRNA *ptr, float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
|
|
|
values[0]= mtface->uv[0][0];
|
|
|
|
values[1]= mtface->uv[0][1];
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshTextureFace_uv1_set(PointerRNA *ptr, const float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
|
|
|
mtface->uv[0][0]= values[0];
|
|
|
|
mtface->uv[0][1]= values[1];
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshTextureFace_uv2_get(PointerRNA *ptr, float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
|
|
|
values[0]= mtface->uv[1][0];
|
|
|
|
values[1]= mtface->uv[1][1];
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshTextureFace_uv2_set(PointerRNA *ptr, const float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
|
|
|
mtface->uv[1][0]= values[0];
|
|
|
|
mtface->uv[1][1]= values[1];
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshTextureFace_uv3_get(PointerRNA *ptr, float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
|
|
|
values[0]= mtface->uv[2][0];
|
|
|
|
values[1]= mtface->uv[2][1];
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshTextureFace_uv3_set(PointerRNA *ptr, const float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
|
|
|
mtface->uv[2][0]= values[0];
|
|
|
|
mtface->uv[2][1]= values[1];
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshTextureFace_uv4_get(PointerRNA *ptr, float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
|
|
|
values[0]= mtface->uv[3][0];
|
|
|
|
values[1]= mtface->uv[3][1];
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_MeshTextureFace_uv4_set(PointerRNA *ptr, const float *values)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
2009-02-02 19:57:57 +00:00
|
|
|
|
|
|
|
mtface->uv[3][0]= values[0];
|
|
|
|
mtface->uv[3][1]= values[1];
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
static int rna_CustomDataData_numverts(PointerRNA *ptr, int type)
|
|
|
|
{
|
2010-03-22 09:30:00 +00:00
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
CustomDataLayer *cdl;
|
2010-08-03 05:14:59 +00:00
|
|
|
int a, b;
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
|
2010-03-22 09:30:00 +00:00
|
|
|
for(cdl=fdata->layers, a=0; a<fdata->totlayer; cdl++, a++) {
|
|
|
|
if(cdl->type == type) {
|
|
|
|
b= ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
|
|
|
|
if(b >= 0 && b < me->totface)
|
|
|
|
return (me->mface[b].v4? 4: 3);
|
|
|
|
}
|
|
|
|
}
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
|
2010-03-22 09:30:00 +00:00
|
|
|
return 0;
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
}
|
|
|
|
|
2009-09-09 19:40:46 +00:00
|
|
|
static int rna_MeshTextureFace_uv_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
{
|
2009-09-09 19:40:46 +00:00
|
|
|
length[0]= rna_CustomDataData_numverts(ptr, CD_MTFACE);
|
|
|
|
length[1]= 2;
|
2010-03-22 09:30:00 +00:00
|
|
|
return length[0]*length[1];
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_MeshTextureFace_uv_get(PointerRNA *ptr, float *values)
|
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
|
|
|
int totvert= rna_CustomDataData_numverts(ptr, CD_MTFACE);
|
|
|
|
|
|
|
|
memcpy(values, mtface->uv, totvert * 2 * sizeof(float));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_MeshTextureFace_uv_set(PointerRNA *ptr, const float *values)
|
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
|
|
|
int totvert= rna_CustomDataData_numverts(ptr, CD_MTFACE);
|
|
|
|
|
|
|
|
memcpy(mtface->uv, values, totvert * 2 * sizeof(float));
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static void rna_MeshTextureFaceLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
|
2010-03-05 15:16:37 +00:00
|
|
|
rna_iterator_array_begin(iter, layer->data, sizeof(MTFace), (me->edit_mesh)? 0: me->totface, 0, NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static int rna_MeshTextureFaceLayer_data_length(PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
2010-03-05 15:16:37 +00:00
|
|
|
return (me->edit_mesh)? 0: me->totface;
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static int rna_MeshTextureFaceLayer_active_render_get(PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_active_get(ptr, CD_MTFACE, 1);
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static int rna_MeshTextureFaceLayer_active_get(PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_active_get(ptr, CD_MTFACE, 0);
|
|
|
|
}
|
|
|
|
|
2009-11-24 00:56:52 +00:00
|
|
|
static int rna_MeshTextureFaceLayer_clone_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_clone_get(ptr, CD_MTFACE, 0);
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static void rna_MeshTextureFaceLayer_active_render_set(PointerRNA *ptr, int value)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
rna_CustomDataLayer_active_set(ptr, value, CD_MTFACE, 1);
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static void rna_MeshTextureFaceLayer_active_set(PointerRNA *ptr, int value)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
rna_CustomDataLayer_active_set(ptr, value, CD_MTFACE, 0);
|
|
|
|
}
|
|
|
|
|
2009-11-24 00:56:52 +00:00
|
|
|
static void rna_MeshTextureFaceLayer_clone_set(PointerRNA *ptr, int value)
|
|
|
|
{
|
|
|
|
rna_CustomDataLayer_clone_set(ptr, value, CD_MTFACE, 0);
|
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static void rna_MeshTextureFaceLayer_name_set(PointerRNA *ptr, const char *value)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
2009-11-05 16:40:12 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomDataLayer *cdl= (CustomDataLayer*)ptr->data;
|
2011-09-15 12:26:48 +00:00
|
|
|
BLI_strncpy_utf8(cdl->name, value, sizeof(cdl->name));
|
2009-11-05 16:40:12 +00:00
|
|
|
CustomData_set_layer_unique_name(fdata, cdl - fdata->layers);
|
2009-07-01 22:25:49 +00:00
|
|
|
}
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static int rna_vertex_color_check(CollectionPropertyIterator *UNUSED(iter), void *data)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
CustomDataLayer *layer= (CustomDataLayer*)data;
|
|
|
|
return (layer->type != CD_MCOL);
|
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static void rna_Mesh_vertex_colors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
2011-01-11 14:39:14 +00:00
|
|
|
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_vertex_color_check);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static int rna_Mesh_vertex_colors_length(PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_length(ptr, CD_MCOL);
|
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static PointerRNA rna_Mesh_active_vertex_color_get(PointerRNA *ptr)
|
2009-06-27 01:10:39 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
int index= CustomData_get_active_layer_index(fdata, CD_MCOL);
|
|
|
|
CustomDataLayer *cdl= (index == -1)? NULL: &fdata->layers[index];
|
2009-06-27 01:10:39 +00:00
|
|
|
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_MeshColorLayer, cdl);
|
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static void rna_Mesh_active_vertex_color_set(PointerRNA *ptr, PointerRNA value)
|
2009-06-27 01:10:39 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
2009-06-27 01:10:39 +00:00
|
|
|
CustomDataLayer *cdl;
|
|
|
|
int a;
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
for(cdl=fdata->layers, a=0; a<fdata->totlayer; cdl++, a++) {
|
2009-06-27 01:10:39 +00:00
|
|
|
if(value.data == cdl) {
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData_set_layer_active_index(fdata, CD_MCOL, a);
|
|
|
|
mesh_update_customdata_pointers(me);
|
2009-06-27 01:10:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static int rna_Mesh_active_vertex_color_index_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
return CustomData_get_active_layer(fdata, CD_MCOL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_Mesh_active_vertex_color_index_set(PointerRNA *ptr, int value)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
|
|
|
|
CustomData_set_layer_active(fdata, CD_MCOL, value);
|
|
|
|
mesh_update_customdata_pointers(me);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_Mesh_active_vertex_color_index_range(PointerRNA *ptr, int *min, int *max)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
|
|
|
|
|
|
|
*min= 0;
|
|
|
|
*max= CustomData_number_of_layers(fdata, CD_MCOL)-1;
|
|
|
|
*max= MAX2(0, *max);
|
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_MeshColorLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
|
2010-03-05 15:16:37 +00:00
|
|
|
rna_iterator_array_begin(iter, layer->data, sizeof(MCol)*4, (me->edit_mesh)? 0: me->totface, 0, NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static int rna_MeshColorLayer_data_length(PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
2010-03-05 15:16:37 +00:00
|
|
|
return (me->edit_mesh)? 0: me->totface;
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static int rna_MeshColorLayer_active_render_get(PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_active_get(ptr, CD_MCOL, 1);
|
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static int rna_MeshColorLayer_active_get(PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_active_get(ptr, CD_MCOL, 0);
|
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_MeshColorLayer_active_render_set(PointerRNA *ptr, int value)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
rna_CustomDataLayer_active_set(ptr, value, CD_MCOL, 1);
|
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_MeshColorLayer_active_set(PointerRNA *ptr, int value)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
rna_CustomDataLayer_active_set(ptr, value, CD_MCOL, 0);
|
|
|
|
}
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
static void rna_MeshColorLayer_name_set(PointerRNA *ptr, const char *value)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
2009-11-05 16:40:12 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomDataLayer *cdl= (CustomDataLayer*)ptr->data;
|
2011-09-15 12:26:48 +00:00
|
|
|
BLI_strncpy_utf8(cdl->name, value, sizeof(cdl->name));
|
2009-11-05 16:40:12 +00:00
|
|
|
CustomData_set_layer_unique_name(fdata, cdl - fdata->layers);
|
2009-07-01 22:25:49 +00:00
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_MeshFloatPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
|
2010-03-05 15:16:37 +00:00
|
|
|
rna_iterator_array_begin(iter, layer->data, sizeof(MFloatProperty), (me->edit_mesh)? 0: me->totface, 0, NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static int rna_MeshFloatPropertyLayer_data_length(PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
2010-03-05 15:16:37 +00:00
|
|
|
return (me->edit_mesh)? 0: me->totface;
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static int rna_float_layer_check(CollectionPropertyIterator *UNUSED(iter), void *data)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
CustomDataLayer *layer= (CustomDataLayer*)data;
|
|
|
|
return (layer->type != CD_PROP_FLT);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_Mesh_float_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
2011-01-11 14:39:14 +00:00
|
|
|
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_float_layer_check);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_Mesh_float_layers_length(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_length(ptr, CD_PROP_FLT);
|
|
|
|
}
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static int rna_int_layer_check(CollectionPropertyIterator *UNUSED(iter), void *data)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
CustomDataLayer *layer= (CustomDataLayer*)data;
|
|
|
|
return (layer->type != CD_PROP_INT);
|
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_MeshIntPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
|
2010-03-05 15:16:37 +00:00
|
|
|
rna_iterator_array_begin(iter, layer->data, sizeof(MIntProperty), (me->edit_mesh)? 0: me->totface, 0, NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static int rna_MeshIntPropertyLayer_data_length(PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
2010-03-05 15:16:37 +00:00
|
|
|
return (me->edit_mesh)? 0: me->totface;
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_Mesh_int_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
2011-01-11 14:39:14 +00:00
|
|
|
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_int_layer_check);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_Mesh_int_layers_length(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_length(ptr, CD_PROP_INT);
|
|
|
|
}
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static int rna_string_layer_check(CollectionPropertyIterator *UNUSED(iter), void *data)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
CustomDataLayer *layer= (CustomDataLayer*)data;
|
|
|
|
return (layer->type != CD_PROP_STR);
|
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_MeshStringPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
|
2010-03-05 15:16:37 +00:00
|
|
|
rna_iterator_array_begin(iter, layer->data, sizeof(MStringProperty), (me->edit_mesh)? 0: me->totface, 0, NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static int rna_MeshStringPropertyLayer_data_length(PointerRNA *ptr)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
2010-03-05 15:16:37 +00:00
|
|
|
return (me->edit_mesh)? 0: me->totface;
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_Mesh_string_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
2011-01-11 14:39:14 +00:00
|
|
|
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_string_layer_check);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_Mesh_string_layers_length(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_length(ptr, CD_PROP_STR);
|
|
|
|
}
|
|
|
|
|
2009-05-29 15:12:31 +00:00
|
|
|
static void rna_TextureFace_image_set(PointerRNA *ptr, PointerRNA value)
|
|
|
|
{
|
|
|
|
MTFace *tf= (MTFace*)ptr->data;
|
|
|
|
ID *id= value.data;
|
|
|
|
|
|
|
|
if(id) {
|
|
|
|
/* special exception here, individual faces don't count
|
|
|
|
* as reference, but we do ensure the refcount is not zero */
|
|
|
|
if(id->us == 0)
|
|
|
|
id_us_plus(id);
|
|
|
|
else
|
|
|
|
id_lib_extern(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
tf->tpage= (struct Image*)id;
|
|
|
|
}
|
|
|
|
|
2011-06-09 08:58:27 +00:00
|
|
|
static void rna_Mesh_auto_smooth_angle_set(PointerRNA *ptr, float value)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
value= RAD2DEGF(value);
|
|
|
|
CLAMP(value, 1.0f, 80.0f);
|
|
|
|
me->smoothresh= (int)value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static float rna_Mesh_auto_smooth_angle_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
return DEG2RADF((float)me->smoothresh);
|
|
|
|
}
|
|
|
|
|
2009-09-09 19:40:46 +00:00
|
|
|
static int rna_MeshFace_verts_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
{
|
|
|
|
MFace *face= (MFace*)ptr->data;
|
2009-09-09 19:40:46 +00:00
|
|
|
|
2009-08-29 23:05:46 +00:00
|
|
|
if(face)
|
2009-09-09 19:40:46 +00:00
|
|
|
length[0]= (face->v4)? 4: 3;
|
2009-08-29 23:05:46 +00:00
|
|
|
else
|
2009-09-09 19:40:46 +00:00
|
|
|
length[0]= 4; // XXX rna_raw_access wants the length of a dummy face. this needs fixing. - Campbell
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
|
2009-09-09 19:40:46 +00:00
|
|
|
return length[0];
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_MeshFace_verts_get(PointerRNA *ptr, int *values)
|
|
|
|
{
|
|
|
|
MFace *face= (MFace*)ptr->data;
|
2009-09-09 19:40:46 +00:00
|
|
|
memcpy(values, &face->v1, (face->v4 ? 4 : 3) * sizeof(int));
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_MeshFace_verts_set(PointerRNA *ptr, const int *values)
|
|
|
|
{
|
|
|
|
MFace *face= (MFace*)ptr->data;
|
|
|
|
memcpy(&face->v1, values, (face->v4 ? 4 : 3) * sizeof(int));
|
|
|
|
}
|
|
|
|
|
2009-10-12 19:34:58 +00:00
|
|
|
static int rna_MeshVertex_index_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
MVert *vert= (MVert*)ptr->data;
|
|
|
|
return (int)(vert - me->mvert);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_MeshEdge_index_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
MEdge *edge= (MEdge*)ptr->data;
|
|
|
|
return (int)(edge - me->medge);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_MeshFace_index_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
MFace *face= (MFace*)ptr->data;
|
|
|
|
return (int)(face - me->mface);
|
|
|
|
}
|
|
|
|
|
2009-03-25 20:29:01 +00:00
|
|
|
/* path construction */
|
|
|
|
|
|
|
|
static char *rna_VertexGroupElement_path(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data; /* XXX not always! */
|
|
|
|
MDeformWeight *dw= (MDeformWeight*)ptr->data;
|
|
|
|
MDeformVert *dvert;
|
|
|
|
int a, b;
|
|
|
|
|
2011-01-26 22:31:14 +00:00
|
|
|
/* sanity check: make sure that mesh pointer is valid */
|
|
|
|
if (me == NULL)
|
|
|
|
return NULL;
|
|
|
|
else if (GS(me->id.name) != ID_ME) {
|
|
|
|
/* if object pointer, try to resolve the object's data to mesh pointer */
|
|
|
|
if (GS(me->id.name) == ID_OB) {
|
|
|
|
Object *ob = (Object *)me;
|
|
|
|
|
|
|
|
if (ob->type == OB_MESH)
|
|
|
|
me = (Mesh *)ob->data;
|
|
|
|
else
|
|
|
|
return NULL; /* nothing can be done */
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return NULL; /* nothing can be done */
|
|
|
|
}
|
|
|
|
|
|
|
|
for(a=0, dvert=me->dvert; a<me->totvert; a++, dvert++) {
|
|
|
|
for(b=0; b<dvert->totweight; b++) {
|
2009-03-25 20:29:01 +00:00
|
|
|
if(dw == &dvert->dw[b])
|
2010-10-06 20:39:50 +00:00
|
|
|
return BLI_sprintfN("vertices[%d].groups[%d]", a, b);
|
2011-01-26 22:31:14 +00:00
|
|
|
}
|
|
|
|
}
|
2009-03-25 20:29:01 +00:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_MeshFace_path(PointerRNA *ptr)
|
|
|
|
{
|
2010-12-04 11:44:56 +00:00
|
|
|
return BLI_sprintfN("faces[%d]", (int)((MFace*)ptr->data - ((Mesh*)ptr->id.data)->mface));
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_MeshEdge_path(PointerRNA *ptr)
|
|
|
|
{
|
2010-12-04 11:44:56 +00:00
|
|
|
return BLI_sprintfN("edges[%d]", (int)((MEdge*)ptr->data - ((Mesh*)ptr->id.data)->medge));
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_MeshVertex_path(PointerRNA *ptr)
|
|
|
|
{
|
2010-12-04 11:44:56 +00:00
|
|
|
return BLI_sprintfN("vertices[%d]", (int)((MVert*)ptr->data - ((Mesh*)ptr->id.data)->mvert));
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_MeshTextureFaceLayer_path(PointerRNA *ptr)
|
|
|
|
{
|
2009-11-03 22:07:15 +00:00
|
|
|
return BLI_sprintfN("uv_textures[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_CustomDataData_path(PointerRNA *ptr, char *collection, int type)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
2009-07-01 22:25:49 +00:00
|
|
|
CustomData *fdata= rna_mesh_fdata(me);
|
2009-03-25 20:29:01 +00:00
|
|
|
CustomDataLayer *cdl;
|
2010-08-03 05:14:59 +00:00
|
|
|
int a, b;
|
2009-03-25 20:29:01 +00:00
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
for(cdl=fdata->layers, a=0; a<fdata->totlayer; cdl++, a++) {
|
2009-03-25 20:29:01 +00:00
|
|
|
if(cdl->type == type) {
|
|
|
|
b= ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
|
|
|
|
if(b >= 0 && b < me->totface)
|
2009-11-03 22:07:15 +00:00
|
|
|
return BLI_sprintfN("%s[\"%s\"].data[%d]", collection, cdl->name, b);
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_MeshTextureFace_path(PointerRNA *ptr)
|
|
|
|
{
|
2009-07-01 22:25:49 +00:00
|
|
|
return rna_CustomDataData_path(ptr, "uv_textures", CD_MTFACE);
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_MeshColorLayer_path(PointerRNA *ptr)
|
|
|
|
{
|
2009-11-03 22:07:15 +00:00
|
|
|
return BLI_sprintfN("vertex_colors[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_MeshColor_path(PointerRNA *ptr)
|
|
|
|
{
|
2009-07-01 22:25:49 +00:00
|
|
|
return rna_CustomDataData_path(ptr, "vertex_colors", CD_MCOL);
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_MeshSticky_path(PointerRNA *ptr)
|
|
|
|
{
|
2010-12-04 11:44:56 +00:00
|
|
|
return BLI_sprintfN("sticky[%d]", (int)((MSticky*)ptr->data - ((Mesh*)ptr->id.data)->msticky));
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_MeshIntPropertyLayer_path(PointerRNA *ptr)
|
|
|
|
{
|
2009-11-03 22:07:15 +00:00
|
|
|
return BLI_sprintfN("int_layers[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_MeshIntProperty_path(PointerRNA *ptr)
|
|
|
|
{
|
2010-08-18 08:26:18 +00:00
|
|
|
return rna_CustomDataData_path(ptr, "layers_int", CD_MCOL);
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_MeshFloatPropertyLayer_path(PointerRNA *ptr)
|
|
|
|
{
|
2009-11-03 22:07:15 +00:00
|
|
|
return BLI_sprintfN("float_layers[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_MeshFloatProperty_path(PointerRNA *ptr)
|
|
|
|
{
|
2010-08-18 08:26:18 +00:00
|
|
|
return rna_CustomDataData_path(ptr, "layers_float", CD_MCOL);
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_MeshStringPropertyLayer_path(PointerRNA *ptr)
|
|
|
|
{
|
2009-11-03 22:07:15 +00:00
|
|
|
return BLI_sprintfN("string_layers[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_MeshStringProperty_path(PointerRNA *ptr)
|
|
|
|
{
|
2010-08-18 08:26:18 +00:00
|
|
|
return rna_CustomDataData_path(ptr, "layers_string", CD_MCOL);
|
2009-03-25 20:29:01 +00:00
|
|
|
}
|
|
|
|
|
2010-02-12 22:03:23 +00:00
|
|
|
static int rna_Mesh_tot_vert_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
return me->edit_mesh ? me->edit_mesh->totvertsel : 0;
|
|
|
|
}
|
|
|
|
static int rna_Mesh_tot_edge_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
return me->edit_mesh ? me->edit_mesh->totedgesel: 0;
|
|
|
|
}
|
|
|
|
static int rna_Mesh_tot_face_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
return me->edit_mesh ? me->edit_mesh->totfacesel : 0;
|
|
|
|
}
|
|
|
|
|
2010-11-17 09:45:45 +00:00
|
|
|
static CustomDataLayer *rna_Mesh_vertex_color_new(struct Mesh *me, struct bContext *C, const char *name)
|
2010-08-23 22:16:45 +00:00
|
|
|
{
|
|
|
|
CustomData *fdata;
|
2010-08-27 00:35:59 +00:00
|
|
|
CustomDataLayer *cdl= NULL;
|
2010-08-23 22:16:45 +00:00
|
|
|
int index;
|
|
|
|
|
2010-08-27 00:35:59 +00:00
|
|
|
if(ED_mesh_color_add(C, NULL, NULL, me, name, FALSE)) {
|
|
|
|
fdata= rna_mesh_fdata(me);
|
|
|
|
index= CustomData_get_named_layer_index(fdata, CD_MCOL, name);
|
|
|
|
cdl= (index == -1)? NULL: &fdata->layers[index];
|
|
|
|
}
|
2010-08-23 22:16:45 +00:00
|
|
|
return cdl;
|
|
|
|
}
|
|
|
|
|
2010-11-17 09:45:45 +00:00
|
|
|
static CustomDataLayer *rna_Mesh_uv_texture_new(struct Mesh *me, struct bContext *C, const char *name)
|
2010-08-23 22:16:45 +00:00
|
|
|
{
|
|
|
|
CustomData *fdata;
|
2010-08-27 00:35:59 +00:00
|
|
|
CustomDataLayer *cdl= NULL;
|
2010-08-23 22:16:45 +00:00
|
|
|
int index;
|
|
|
|
|
2010-10-16 14:32:17 +00:00
|
|
|
if(ED_mesh_uv_texture_add(C, me, name, FALSE)) {
|
2010-08-27 00:35:59 +00:00
|
|
|
fdata= rna_mesh_fdata(me);
|
|
|
|
index= CustomData_get_named_layer_index(fdata, CD_MTFACE, name);
|
|
|
|
cdl= (index == -1)? NULL: &fdata->layers[index];
|
|
|
|
}
|
2010-08-23 22:16:45 +00:00
|
|
|
return cdl;
|
|
|
|
}
|
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
#else
|
|
|
|
|
2008-11-24 12:12:24 +00:00
|
|
|
static void rna_def_mvert_group(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
srna= RNA_def_struct(brna, "VertexGroupElement", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_struct_sdna(srna, "MDeformWeight");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_VertexGroupElement_path");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Vertex Group Element", "Weight value of a vertex in a vertex group");
|
2009-06-03 23:16:51 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_GROUP_VERTEX);
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2008-11-29 14:35:50 +00:00
|
|
|
/* we can't point to actual group, it is in the object and so
|
|
|
|
* there is no unique group to point to, hence the index */
|
2008-11-24 12:12:24 +00:00
|
|
|
prop= RNA_def_property(srna, "group", PROP_INT, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "def_nr");
|
2009-03-23 13:24:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Group Index", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
|
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
|
|
|
RNA_def_property_ui_text(prop, "Weight", "Vertex Weight");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_mvert(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
srna= RNA_def_struct(brna, "MeshVertex", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "MVert");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Vertex", "Vertex in a Mesh datablock");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_MeshVertex_path");
|
2009-06-03 23:16:51 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_VERTEXSEL);
|
2008-11-24 12:12:24 +00:00
|
|
|
|
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
|
|
|
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Location", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
|
|
|
prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
|
2010-12-31 04:12:20 +00:00
|
|
|
// RNA_def_property_float_sdna(prop, NULL, "no");
|
|
|
|
RNA_def_property_array(prop, 3);
|
|
|
|
RNA_def_property_range(prop, -1.0f, 1.0f);
|
2010-01-04 15:25:21 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_MeshVertex_normal_get", "rna_MeshVertex_normal_set", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Normal", "Vertex Normal");
|
|
|
|
|
2010-07-15 16:56:04 +00:00
|
|
|
prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
|
2010-07-15 16:56:04 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Select", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2010-07-15 16:56:04 +00:00
|
|
|
prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
|
2010-07-15 16:56:04 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Hide", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "bevel_weight", PROP_FLOAT, PROP_NONE);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_MeshVertex_bevel_weight_get", "rna_MeshVertex_bevel_weight_set", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Bevel Weight", "Weight used by the Bevel modifier 'Only Vertices' option");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
|
2011-10-04 07:48:56 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_MeshVertex_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 vertex is member of");
|
2009-10-12 19:34:58 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_int_funcs(prop, "rna_MeshVertex_index_get", NULL, NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Index", "Index number of the vertex");
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_medge(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
srna= RNA_def_struct(brna, "MeshEdge", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "MEdge");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Edge", "Edge in a Mesh datablock");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_MeshEdge_path");
|
2009-06-03 23:16:51 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_EDGESEL);
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2010-08-18 03:42:26 +00:00
|
|
|
prop= RNA_def_property(srna, "vertices", PROP_INT, PROP_UNSIGNED);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "v1");
|
|
|
|
RNA_def_property_array(prop, 2);
|
|
|
|
RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
|
RNA
* Mesh.add_geometry, Mesh.update and make indices editable. This
is without checking if they are valid still, no time now to
implement this.
* Also fix warnings in rna_ui.c, and a bug in CDDM_calc_edges.
Example code:
co = [0.0, 0.0, 0.0] + [1.0, 0.0, 0.0] + [0.0, 1.0, 0.0] + [1.0, 1.0, 0.0]
faces = [0, 1, 2, 0] + [1, 3, 2, 0]
mesh.add_geometry(4, 0, 2)
mesh.verts.foreach_set("co", co)
mesh.faces.foreach_set("verts", faces)
mesh.update()
2009-07-01 12:19:00 +00:00
|
|
|
// XXX allows creating invalid meshes
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "crease", PROP_FLOAT, PROP_NONE);
|
|
|
|
RNA_def_property_float_funcs(prop, "rna_MEdge_crease_get", "rna_MEdge_crease_set", NULL);
|
|
|
|
RNA_def_property_ui_text(prop, "Crease", "Weight used by the Subsurf modifier for creasing");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "bevel_weight", PROP_FLOAT, PROP_NONE);
|
|
|
|
RNA_def_property_float_funcs(prop, "rna_MEdge_bevel_weight_get", "rna_MEdge_bevel_weight_set", NULL);
|
|
|
|
RNA_def_property_ui_text(prop, "Bevel Weight", "Weight used by the Bevel modifier");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2010-07-15 16:56:04 +00:00
|
|
|
prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
|
2010-07-15 16:56:04 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Select", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2010-07-15 16:56:04 +00:00
|
|
|
prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
|
2010-07-15 16:56:04 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Hide", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2010-08-18 07:14:10 +00:00
|
|
|
prop= RNA_def_property(srna, "use_seam", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SEAM);
|
|
|
|
RNA_def_property_ui_text(prop, "Seam", "Seam edge for UV unwrapping");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2010-08-20 06:09:58 +00:00
|
|
|
prop= RNA_def_property(srna, "use_edge_sharp", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SHARP);
|
|
|
|
RNA_def_property_ui_text(prop, "Sharp", "Sharp edge for the EdgeSplit modifier");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2009-06-26 12:33:07 +00:00
|
|
|
|
2010-08-18 07:14:10 +00:00
|
|
|
prop= RNA_def_property(srna, "is_loose", PROP_BOOLEAN, PROP_NONE);
|
2009-06-26 12:33:07 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_LOOSEEDGE);
|
|
|
|
RNA_def_property_ui_text(prop, "Loose", "Loose edge");
|
2009-08-06 12:22:50 +00:00
|
|
|
|
2010-08-18 07:14:10 +00:00
|
|
|
prop= RNA_def_property(srna, "is_fgon", PROP_BOOLEAN, PROP_NONE);
|
2009-08-06 12:22:50 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FGON);
|
|
|
|
RNA_def_property_ui_text(prop, "Fgon", "Fgon edge");
|
2009-10-12 19:34:58 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_int_funcs(prop, "rna_MeshEdge_index_get", NULL, NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Index", "Index number of the vertex");
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_mface(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
srna= RNA_def_struct(brna, "MeshFace", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "MFace");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Face", "Face in a Mesh datablock");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_MeshFace_path");
|
2009-06-03 23:16:51 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_FACESEL);
|
2008-11-24 12:12:24 +00:00
|
|
|
|
RNA
* Mesh.add_geometry, Mesh.update and make indices editable. This
is without checking if they are valid still, no time now to
implement this.
* Also fix warnings in rna_ui.c, and a bug in CDDM_calc_edges.
Example code:
co = [0.0, 0.0, 0.0] + [1.0, 0.0, 0.0] + [0.0, 1.0, 0.0] + [1.0, 1.0, 0.0]
faces = [0, 1, 2, 0] + [1, 3, 2, 0]
mesh.add_geometry(4, 0, 2)
mesh.verts.foreach_set("co", co)
mesh.faces.foreach_set("verts", faces)
mesh.update()
2009-07-01 12:19:00 +00:00
|
|
|
// XXX allows creating invalid meshes
|
2010-08-18 03:42:26 +00:00
|
|
|
prop= RNA_def_property(srna, "vertices", PROP_INT, PROP_UNSIGNED);
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
RNA_def_property_array(prop, 4);
|
|
|
|
RNA_def_property_flag(prop, PROP_DYNAMIC);
|
2009-09-09 19:40:46 +00:00
|
|
|
RNA_def_property_dynamic_array_funcs(prop, "rna_MeshFace_verts_get_length");
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
RNA_def_property_int_funcs(prop, "rna_MeshFace_verts_get", "rna_MeshFace_verts_set", NULL);
|
|
|
|
RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2009-09-29 12:34:05 +00:00
|
|
|
/* leaving this fixed size array for foreach_set used in import scripts */
|
2010-08-18 03:42:26 +00:00
|
|
|
prop= RNA_def_property(srna, "vertices_raw", PROP_INT, PROP_UNSIGNED);
|
2009-09-29 12:34:05 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "v1");
|
|
|
|
RNA_def_property_array(prop, 4);
|
|
|
|
RNA_def_property_ui_text(prop, "Vertices", "Fixed size vertex indices array");
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "mat_nr");
|
|
|
|
RNA_def_property_ui_text(prop, "Material Index", "");
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshFace_material_index_range");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2010-07-15 16:56:04 +00:00
|
|
|
prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FACE_SEL);
|
2010-07-15 16:56:04 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Select", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2010-07-15 16:56:04 +00:00
|
|
|
prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
|
2010-07-15 16:56:04 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Hide", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2010-08-18 07:14:10 +00:00
|
|
|
prop= RNA_def_property(srna, "use_smooth", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SMOOTH);
|
|
|
|
RNA_def_property_ui_text(prop, "Smooth", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2009-07-27 18:17:21 +00:00
|
|
|
|
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
|
|
|
prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
|
2009-07-27 18:17:21 +00:00
|
|
|
RNA_def_property_array(prop, 3);
|
|
|
|
RNA_def_property_range(prop, -1.0f, 1.0f);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_float_funcs(prop, "rna_MeshFace_normal_get", NULL, NULL);
|
2011-10-04 07:48:56 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Face normal", "Local space unit length normal vector for this face");
|
2009-10-12 19:34:58 +00:00
|
|
|
|
2009-11-03 17:51:22 +00:00
|
|
|
prop= RNA_def_property(srna, "area", PROP_FLOAT, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_float_funcs(prop, "rna_MeshFace_area_get", NULL, NULL);
|
2011-10-04 07:48:56 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Face area", "Read only area of the face");
|
2009-11-03 17:51:22 +00:00
|
|
|
|
2009-10-12 19:34:58 +00:00
|
|
|
prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_int_funcs(prop, "rna_MeshFace_index_get", NULL, NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Index", "Index number of the vertex");
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_mtface(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
2010-11-15 06:38:07 +00:00
|
|
|
const int uv_dim[]= {4, 2};
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
srna= RNA_def_struct(brna, "MeshTextureFaceLayer", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Texture Face Layer", "Layer of texture faces in a Mesh datablock");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_sdna(srna, "CustomDataLayer");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_MeshTextureFaceLayer_path");
|
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
|
|
|
RNA_def_struct_ui_icon(srna, ICON_GROUP_UVS);
|
2009-01-10 22:57:33 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
|
|
|
RNA_def_struct_name_property(srna, prop);
|
2009-07-01 22:25:49 +00:00
|
|
|
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshTextureFaceLayer_name_set");
|
2011-05-15 17:59:48 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Name", "Name of UV unwrapping layer");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_get", "rna_MeshTextureFaceLayer_active_set");
|
|
|
|
RNA_def_property_ui_text(prop, "Active", "Sets the layer as active for display and editing");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_render_get",
|
|
|
|
"rna_MeshTextureFaceLayer_active_render_set");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2009-11-24 00:56:52 +00:00
|
|
|
prop= RNA_def_property(srna, "active_clone", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "active_clone", 0);
|
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_clone_get", "rna_MeshTextureFaceLayer_clone_set");
|
|
|
|
RNA_def_property_ui_text(prop, "Active Clone", "Sets the layer as active for cloning");
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_struct_type(prop, "MeshTextureFace");
|
|
|
|
RNA_def_property_ui_text(prop, "Data", "");
|
2011-10-04 07:48:56 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next",
|
|
|
|
"rna_iterator_array_end", "rna_iterator_array_get",
|
|
|
|
"rna_MeshTextureFaceLayer_data_length", NULL, NULL, NULL);
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
srna= RNA_def_struct(brna, "MeshTextureFace", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "MTFace");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Texture Face", "UV mapping, texturing and game engine data for a face");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_MeshTextureFace_path");
|
2009-06-03 23:16:51 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_FACESEL_HLT);
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2009-05-29 15:12:31 +00:00
|
|
|
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "tpage");
|
2010-08-03 05:14:59 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, NULL, "rna_TextureFace_image_set", NULL, NULL);
|
2009-05-29 15:12:31 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Image", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2010-07-15 16:56:04 +00:00
|
|
|
prop= RNA_def_property(srna, "select_uv", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TF_SEL1);
|
|
|
|
RNA_def_property_array(prop, 4);
|
|
|
|
RNA_def_property_ui_text(prop, "UV Selected", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2010-08-19 12:51:31 +00:00
|
|
|
prop= RNA_def_property(srna, "pin_uv", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "unwrap", TF_PIN1);
|
|
|
|
RNA_def_property_array(prop, 4);
|
|
|
|
RNA_def_property_ui_text(prop, "UV Pinned", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
|
|
|
prop= RNA_def_property(srna, "uv1", PROP_FLOAT, PROP_XYZ);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_array(prop, 2);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv1_get", "rna_MeshTextureFace_uv1_set", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "UV 1", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
|
|
|
prop= RNA_def_property(srna, "uv2", PROP_FLOAT, PROP_XYZ);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_array(prop, 2);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv2_get", "rna_MeshTextureFace_uv2_set", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "UV 2", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
|
|
|
prop= RNA_def_property(srna, "uv3", PROP_FLOAT, PROP_XYZ);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_array(prop, 2);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv3_get", "rna_MeshTextureFace_uv3_set", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "UV 3", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
|
|
|
prop= RNA_def_property(srna, "uv4", PROP_FLOAT, PROP_XYZ);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_array(prop, 2);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv4_get", "rna_MeshTextureFace_uv4_set", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "UV 4", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
|
2009-09-06 15:13:57 +00:00
|
|
|
prop= RNA_def_property(srna, "uv", PROP_FLOAT, PROP_NONE);
|
2009-09-09 19:40:46 +00:00
|
|
|
RNA_def_property_multi_array(prop, 2, uv_dim);
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_DYNAMIC);
|
2009-09-09 19:40:46 +00:00
|
|
|
RNA_def_property_dynamic_array_funcs(prop, "rna_MeshTextureFace_uv_get_length");
|
Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
2009-08-25 17:06:36 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv_get", "rna_MeshTextureFace_uv_set", NULL);
|
|
|
|
RNA_def_property_ui_text(prop, "UV", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2010-01-04 22:30:09 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "uv_raw", PROP_FLOAT, PROP_NONE);
|
|
|
|
RNA_def_property_multi_array(prop, 2, uv_dim);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "uv");
|
|
|
|
RNA_def_property_ui_text(prop, "UV", "Fixed size UV coordinates array");
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_def_msticky(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
srna= RNA_def_struct(brna, "MeshSticky", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "MSticky");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Vertex Sticky Texture Coordinate", "Stricky texture coordinate");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_MeshSticky_path");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
|
|
|
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Location", "Sticky texture coordinate location");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_mcol(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
srna= RNA_def_struct(brna, "MeshColorLayer", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Vertex Color Layer", "Layer of vertex colors in a Mesh datablock");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_struct_sdna(srna, "CustomDataLayer");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_MeshColorLayer_path");
|
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
|
|
|
RNA_def_struct_ui_icon(srna, ICON_GROUP_VCOL);
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
|
|
|
RNA_def_struct_name_property(srna, prop);
|
2009-07-01 22:25:49 +00:00
|
|
|
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshColorLayer_name_set");
|
2011-05-15 17:59:48 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Name", "Name of Vertex color layer");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_MeshColorLayer_active_get", "rna_MeshColorLayer_active_set");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Active", "Sets the layer as active for display and editing");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_MeshColorLayer_active_render_get", "rna_MeshColorLayer_active_render_set");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshColor");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Data", "");
|
2011-10-04 07:48:56 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next",
|
|
|
|
"rna_iterator_array_end", "rna_iterator_array_get",
|
|
|
|
"rna_MeshColorLayer_data_length", NULL, NULL, NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
srna= RNA_def_struct(brna, "MeshColor", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "MCol");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Vertex Color", "Vertex colors for a face in a Mesh");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_MeshColor_path");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "color1", PROP_FLOAT, PROP_COLOR);
|
|
|
|
RNA_def_property_array(prop, 3);
|
2009-06-20 13:53:14 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_MeshColor_color1_get", "rna_MeshColor_color1_set", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Color 1", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "color2", PROP_FLOAT, PROP_COLOR);
|
|
|
|
RNA_def_property_array(prop, 3);
|
2009-06-20 13:53:14 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_MeshColor_color2_get", "rna_MeshColor_color2_set", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Color 2", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "color3", PROP_FLOAT, PROP_COLOR);
|
|
|
|
RNA_def_property_array(prop, 3);
|
2009-06-20 13:53:14 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_MeshColor_color3_get", "rna_MeshColor_color3_set", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Color 3", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "color4", PROP_FLOAT, PROP_COLOR);
|
|
|
|
RNA_def_property_array(prop, 3);
|
2009-06-20 13:53:14 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_MeshColor_color4_get", "rna_MeshColor_color4_set", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Color 4", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_def_mproperties(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
/* Float */
|
|
|
|
srna= RNA_def_struct(brna, "MeshFloatPropertyLayer", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_struct_sdna(srna, "CustomDataLayer");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Float Property Layer", "User defined layer of floating pointer number values");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_MeshFloatPropertyLayer_path");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
|
|
|
RNA_def_struct_name_property(srna, prop);
|
|
|
|
RNA_def_property_ui_text(prop, "Name", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshFloatProperty");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Data", "");
|
2011-10-04 07:48:56 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next",
|
|
|
|
"rna_iterator_array_end", "rna_iterator_array_get",
|
|
|
|
"rna_MeshFloatPropertyLayer_data_length", NULL, NULL, NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
srna= RNA_def_struct(brna, "MeshFloatProperty", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "MFloatProperty");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Float Property", "User defined floating point number value in a float properties layer");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_MeshFloatProperty_path");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "f");
|
|
|
|
RNA_def_property_ui_text(prop, "Value", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
/* Int */
|
|
|
|
srna= RNA_def_struct(brna, "MeshIntPropertyLayer", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_struct_sdna(srna, "CustomDataLayer");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Int Property Layer", "User defined layer of integer number values");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_MeshIntPropertyLayer_path");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
|
|
|
RNA_def_struct_name_property(srna, prop);
|
|
|
|
RNA_def_property_ui_text(prop, "Name", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshIntProperty");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Data", "");
|
2011-10-04 07:48:56 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next",
|
|
|
|
"rna_iterator_array_end", "rna_iterator_array_get",
|
|
|
|
"rna_MeshIntPropertyLayer_data_length", NULL, NULL, NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
srna= RNA_def_struct(brna, "MeshIntProperty", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "MIntProperty");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Int Property", "User defined integer number value in an integer properties layer");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_MeshIntProperty_path");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "value", PROP_INT, PROP_NONE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "i");
|
|
|
|
RNA_def_property_ui_text(prop, "Value", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
/* String */
|
|
|
|
srna= RNA_def_struct(brna, "MeshStringPropertyLayer", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_struct_sdna(srna, "CustomDataLayer");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh String Property Layer", "User defined layer of string text values");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_MeshStringPropertyLayer_path");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
|
|
|
RNA_def_struct_name_property(srna, prop);
|
|
|
|
RNA_def_property_ui_text(prop, "Name", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshStringProperty");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Data", "");
|
2011-10-04 07:48:56 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next",
|
|
|
|
"rna_iterator_array_end", "rna_iterator_array_get",
|
|
|
|
"rna_MeshStringPropertyLayer_data_length", NULL, NULL, NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
srna= RNA_def_struct(brna, "MeshStringProperty", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "MStringProperty");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh String Property", "User defined string text value in a string properties layer");
|
2009-03-25 20:29:01 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_MeshStringProperty_path");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
|
|
|
|
RNA_def_property_string_sdna(prop, NULL, "s");
|
|
|
|
RNA_def_property_ui_text(prop, "Value", "");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2010-08-26 22:44:05 +00:00
|
|
|
/* mesh.vertices */
|
|
|
|
static void rna_def_mesh_vertices(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
// PropertyRNA *prop;
|
|
|
|
|
|
|
|
FunctionRNA *func;
|
2011-01-13 04:53:55 +00:00
|
|
|
// PropertyRNA *parm;
|
2010-08-26 22:44:05 +00:00
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MeshVertices");
|
|
|
|
srna= RNA_def_struct(brna, "MeshVertices", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "Mesh");
|
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Vertices", "Collection of mesh vertices");
|
|
|
|
|
|
|
|
func= RNA_def_function(srna, "add", "ED_mesh_vertices_add");
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add", 0, INT_MAX);
|
2010-08-26 22:44:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* mesh.edges */
|
|
|
|
static void rna_def_mesh_edges(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
// PropertyRNA *prop;
|
|
|
|
|
|
|
|
FunctionRNA *func;
|
2011-01-10 03:58:07 +00:00
|
|
|
// PropertyRNA *parm;
|
2010-08-26 22:44:05 +00:00
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MeshEdges");
|
|
|
|
srna= RNA_def_struct(brna, "MeshEdges", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "Mesh");
|
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Edges", "Collection of mesh edges");
|
|
|
|
|
|
|
|
func= RNA_def_function(srna, "add", "ED_mesh_edges_add");
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add", 0, INT_MAX);
|
2010-08-26 22:44:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* mesh.faces */
|
2009-12-13 14:13:25 +00:00
|
|
|
static void rna_def_mesh_faces(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2010-08-26 22:44:05 +00:00
|
|
|
FunctionRNA *func;
|
2011-01-13 04:53:55 +00:00
|
|
|
/*PropertyRNA *parm;*/
|
2009-12-13 14:13:25 +00:00
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MeshFaces");
|
|
|
|
srna= RNA_def_struct(brna, "MeshFaces", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "Mesh");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Faces", "Collection of mesh faces");
|
2009-12-13 14:13:25 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "active", PROP_INT, PROP_NONE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "act_face");
|
|
|
|
RNA_def_property_ui_text(prop, "Active Face", "The active face for this mesh");
|
2010-04-12 03:06:49 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "active_tface", PROP_POINTER, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_struct_type(prop, "MeshTextureFace");
|
2010-08-03 05:14:59 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_mtface_get", NULL, NULL, NULL);
|
2010-04-12 03:06:49 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Active Texture Face", "Active Texture Face");
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2009-12-13 14:13:25 +00:00
|
|
|
|
2010-08-26 22:44:05 +00:00
|
|
|
func= RNA_def_function(srna, "add", "ED_mesh_faces_add");
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add", 0, INT_MAX);
|
2010-08-26 22:44:05 +00:00
|
|
|
}
|
2009-12-13 14:13:25 +00:00
|
|
|
|
2010-08-23 22:16:45 +00:00
|
|
|
/* mesh.vertex_colors */
|
|
|
|
static void rna_def_vertex_colors(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "VertexColors");
|
|
|
|
srna= RNA_def_struct(brna, "VertexColors", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "Mesh");
|
|
|
|
RNA_def_struct_ui_text(srna, "Vertex Colors", "Collection of vertex colors");
|
|
|
|
|
|
|
|
func= RNA_def_function(srna, "new", "rna_Mesh_vertex_color_new");
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a vertex color layer to Mesh");
|
|
|
|
RNA_def_string(func, "name", "Col", 0, "", "Vertex color name");
|
|
|
|
parm= RNA_def_pointer(func, "layer", "MeshColorLayer", "", "The newly created layer");
|
2010-08-23 22:16:45 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
|
|
|
/*
|
|
|
|
func= RNA_def_function(srna, "remove", "rna_Mesh_vertex_color_remove");
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a vertex color layer");
|
2010-08-23 22:16:45 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
parm= RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove");
|
2010-08-24 06:40:28 +00:00
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
|
2010-08-23 22:16:45 +00:00
|
|
|
*/
|
|
|
|
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_struct_type(prop, "MeshColorLayer");
|
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_vertex_color_get", "rna_Mesh_active_vertex_color_set", NULL, NULL);
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Active Vertex Color Layer", "Active vertex color layer");
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2010-08-24 04:02:50 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_int_funcs(prop, "rna_Mesh_active_vertex_color_index_get", "rna_Mesh_active_vertex_color_index_set", "rna_Mesh_active_vertex_color_index_range");
|
|
|
|
RNA_def_property_ui_text(prop, "Active Vertex Color Index", "Active vertex color index");
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2010-08-23 22:16:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* mesh.uv_layers */
|
|
|
|
static void rna_def_uv_textures(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "UVTextures");
|
|
|
|
srna= RNA_def_struct(brna, "UVTextures", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "Mesh");
|
|
|
|
RNA_def_struct_ui_text(srna, "UV Textures", "Collection of uv textures");
|
|
|
|
|
|
|
|
func= RNA_def_function(srna, "new", "rna_Mesh_uv_texture_new");
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a UV texture layer to Mesh");
|
|
|
|
RNA_def_string(func, "name", "UVTex", 0, "", "UV Texture name");
|
|
|
|
parm= RNA_def_pointer(func, "layer", "MeshTextureFaceLayer", "", "The newly created layer");
|
2010-08-23 22:16:45 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
|
|
|
/*
|
|
|
|
func= RNA_def_function(srna, "remove", "rna_Mesh_uv_layers_remove");
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a vertex color layer");
|
2010-08-23 22:16:45 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
parm= RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove");
|
2010-08-24 06:40:28 +00:00
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
|
2010-08-23 22:16:45 +00:00
|
|
|
*/
|
|
|
|
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
|
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_uv_texture_get", "rna_Mesh_active_uv_texture_set", NULL, NULL);
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Active UV Texture", "Active UV texture");
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2010-08-24 04:02:50 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_int_funcs(prop, "rna_Mesh_active_uv_texture_index_get",
|
|
|
|
"rna_Mesh_active_uv_texture_index_set", "rna_Mesh_active_uv_texture_index_range");
|
2010-08-24 04:02:50 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Active UV Texture Index", "Active UV texture index");
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2010-08-23 22:16:45 +00:00
|
|
|
}
|
|
|
|
|
2008-11-24 12:12:24 +00:00
|
|
|
static void rna_def_mesh(BlenderRNA *brna)
|
2008-11-07 02:58:25 +00:00
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2008-12-19 04:06:24 +00:00
|
|
|
srna= RNA_def_struct(brna, "Mesh", "ID");
|
2010-02-21 20:27:13 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh", "Mesh datablock defining geometric surfaces");
|
2009-06-03 23:16:51 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_MESH_DATA);
|
2008-11-07 02:58:25 +00:00
|
|
|
|
2010-08-18 03:42:26 +00:00
|
|
|
prop= RNA_def_property(srna, "vertices", PROP_COLLECTION, PROP_NONE);
|
2008-11-07 02:58:25 +00:00
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "mvert", "totvert");
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshVertex");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Vertices", "Vertices of the mesh");
|
2010-08-26 22:44:05 +00:00
|
|
|
rna_def_mesh_vertices(brna, prop);
|
2008-11-07 02:58:25 +00:00
|
|
|
|
2008-11-24 12:12:24 +00:00
|
|
|
prop= RNA_def_property(srna, "edges", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "medge", "totedge");
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshEdge");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Edges", "Edges of the mesh");
|
2010-08-26 22:44:05 +00:00
|
|
|
rna_def_mesh_edges(brna, prop);
|
2008-11-07 02:58:25 +00:00
|
|
|
|
2008-11-24 12:12:24 +00:00
|
|
|
prop= RNA_def_property(srna, "faces", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "mface", "totface");
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshFace");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Faces", "Faces of the mesh");
|
2009-12-13 14:13:25 +00:00
|
|
|
rna_def_mesh_faces(brna, prop);
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "sticky", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "msticky", "totvert");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshSticky");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Sticky", "Sticky texture coordinates");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2009-10-07 09:23:29 +00:00
|
|
|
/* TODO, should this be allowed to be its self? */
|
|
|
|
prop= RNA_def_property(srna, "texture_mesh", PROP_POINTER, PROP_NONE);
|
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "texcomesh");
|
2009-10-14 13:20:20 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
|
2010-05-04 05:15:53 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Texture Mesh", "Use another mesh for texture indices (vertex indices must be aligned)");
|
2009-06-27 01:10:39 +00:00
|
|
|
|
2009-10-07 09:23:29 +00:00
|
|
|
/* UV textures */
|
2009-07-01 22:25:49 +00:00
|
|
|
prop= RNA_def_property(srna, "uv_textures", PROP_COLLECTION, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
|
2011-10-01 15:40:32 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", NULL, NULL, NULL, "rna_Mesh_uv_textures_length", NULL, NULL, NULL);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
|
2009-07-01 22:25:49 +00:00
|
|
|
RNA_def_property_ui_text(prop, "UV Textures", "");
|
2010-08-23 22:16:45 +00:00
|
|
|
rna_def_uv_textures(brna, prop);
|
2009-07-01 22:25:49 +00:00
|
|
|
|
2009-12-22 10:48:13 +00:00
|
|
|
prop= RNA_def_property(srna, "uv_texture_clone", PROP_POINTER, PROP_UNSIGNED);
|
2009-11-24 00:56:52 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
|
2010-08-03 05:14:59 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_clone_get", "rna_Mesh_uv_texture_clone_set", NULL, NULL);
|
2009-11-24 00:56:52 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Clone UV Texture", "UV texture to be used as cloning source");
|
2009-11-24 00:56:52 +00:00
|
|
|
|
2009-12-22 10:48:13 +00:00
|
|
|
prop= RNA_def_property(srna, "uv_texture_clone_index", PROP_INT, PROP_UNSIGNED);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_int_funcs(prop, "rna_Mesh_uv_texture_clone_index_get",
|
|
|
|
"rna_Mesh_uv_texture_clone_index_set", "rna_Mesh_active_uv_texture_index_range");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Clone UV Texture Index", "Clone UV texture index");
|
2009-12-22 10:48:13 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "uv_texture_stencil", PROP_POINTER, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
|
2010-08-03 05:14:59 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_stencil_get", "rna_Mesh_uv_texture_stencil_set", NULL, NULL);
|
2009-12-22 10:48:13 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Mask UV Texture", "UV texture to mask the painted area");
|
2009-12-22 10:48:13 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "uv_texture_stencil_index", PROP_INT, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_int_funcs(prop, "rna_Mesh_uv_texture_stencil_index_get", "rna_Mesh_uv_texture_stencil_index_set", "rna_Mesh_active_uv_texture_index_range");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Mask UV Texture Index", "Mask UV texture index");
|
2009-11-24 00:56:52 +00:00
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
/* Vertex colors */
|
2009-06-27 01:10:39 +00:00
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
prop= RNA_def_property(srna, "vertex_colors", PROP_COLLECTION, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
|
2011-10-01 15:40:32 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", NULL, NULL, NULL, "rna_Mesh_vertex_colors_length", NULL, NULL, NULL);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshColorLayer");
|
2009-07-01 22:25:49 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Vertex Colors", "");
|
2010-08-23 22:16:45 +00:00
|
|
|
rna_def_vertex_colors(brna, prop);
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2010-08-18 08:26:18 +00:00
|
|
|
prop= RNA_def_property(srna, "layers_float", PROP_COLLECTION, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
|
2011-10-01 15:40:32 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", NULL, NULL, NULL, "rna_Mesh_float_layers_length", NULL, NULL, NULL);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshFloatPropertyLayer");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Float Property Layers", "");
|
|
|
|
|
2010-08-18 08:26:18 +00:00
|
|
|
prop= RNA_def_property(srna, "layers_int", PROP_COLLECTION, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
|
2011-10-01 15:40:32 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", NULL, NULL, NULL, "rna_Mesh_int_layers_length", NULL, NULL, NULL);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshIntPropertyLayer");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Int Property Layers", "");
|
|
|
|
|
2010-08-18 08:26:18 +00:00
|
|
|
prop= RNA_def_property(srna, "layers_string", PROP_COLLECTION, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
|
2011-10-01 15:40:32 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", NULL, NULL, NULL, "rna_Mesh_string_layers_length", NULL, NULL, NULL);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshStringPropertyLayer");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "String Property Layers", "");
|
|
|
|
|
2010-08-20 06:09:58 +00:00
|
|
|
prop= RNA_def_property(srna, "use_auto_smooth", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_AUTOSMOOTH);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Auto Smooth",
|
|
|
|
"Treat all set-smoothed faces with angles less than the "
|
|
|
|
"specified angle as 'smooth' during render");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2011-06-09 08:58:27 +00:00
|
|
|
#if 1 /* expose as radians */
|
|
|
|
prop= RNA_def_property(srna, "auto_smooth_angle", PROP_FLOAT, PROP_ANGLE);
|
|
|
|
RNA_def_property_float_funcs(prop, "rna_Mesh_auto_smooth_angle_get", "rna_Mesh_auto_smooth_angle_set", NULL);
|
|
|
|
RNA_def_property_ui_range(prop, DEG2RAD(1.0), DEG2RAD(80), 1.0, 1);
|
|
|
|
#else
|
2010-08-20 06:09:58 +00:00
|
|
|
prop= RNA_def_property(srna, "auto_smooth_angle", PROP_INT, PROP_NONE);
|
2008-12-26 02:02:06 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "smoothresh");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_range(prop, 1, 80);
|
2011-06-09 08:58:27 +00:00
|
|
|
#endif
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Auto Smooth Angle",
|
|
|
|
"Maximum angle between face normals that 'Auto Smooth' will operate on");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2010-08-17 17:03:52 +00:00
|
|
|
prop= RNA_def_property(srna, "show_double_sided", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_TWOSIDED);
|
|
|
|
RNA_def_property_ui_text(prop, "Double Sided", "Render/display the mesh with double or single sided lighting");
|
2009-07-01 22:25:49 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "texco_mesh", PROP_POINTER, PROP_NONE);
|
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "texcomesh");
|
2009-05-28 23:23:47 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Texture Space Mesh", "Derive texture coordinates from another mesh");
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
|
|
|
|
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-08-06 23:34:14 +00:00
|
|
|
|
2010-04-12 05:04:49 +00:00
|
|
|
/* texture space */
|
2010-08-19 17:31:10 +00:00
|
|
|
prop= RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE);
|
2010-04-12 05:04:49 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "texflag", AUTOSPACE);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Auto Texture Space",
|
|
|
|
"Adjust active object's texture space automatically when transforming object");
|
2011-01-06 11:16:35 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Mesh_texspace_set");
|
2010-04-12 05:04:49 +00:00
|
|
|
|
2010-08-19 17:31:10 +00:00
|
|
|
prop= RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
|
2010-04-12 05:04:49 +00:00
|
|
|
RNA_def_property_array(prop, 3);
|
2010-05-04 05:15:53 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Texture Space Location", "Texture space location");
|
2010-04-12 05:04:49 +00:00
|
|
|
RNA_def_property_editable_func(prop, "rna_Mesh_texspace_editable");
|
|
|
|
RNA_def_property_float_funcs(prop, "rna_Mesh_texspace_loc_get", "rna_Mesh_texspace_loc_set", NULL);
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
|
|
|
|
RNA_def_property_array(prop, 3);
|
|
|
|
RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size");
|
|
|
|
RNA_def_property_editable_func(prop, "rna_Mesh_texspace_editable");
|
|
|
|
RNA_def_property_float_funcs(prop, "rna_Mesh_texspace_size_get", "rna_Mesh_texspace_size_set", NULL);
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
|
|
|
|
|
|
|
/* not supported yet
|
|
|
|
prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
|
|
|
|
RNA_def_property_float(prop, NULL, "rot");
|
|
|
|
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
|
|
|
|
RNA_def_property_editable_func(prop, texspace_editable);
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");*/
|
|
|
|
|
|
|
|
/* materials */
|
|
|
|
prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
|
|
|
|
RNA_def_property_struct_type(prop, "Material");
|
|
|
|
RNA_def_property_ui_text(prop, "Materials", "");
|
2010-09-03 07:25:37 +00:00
|
|
|
RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */
|
2011-10-01 17:54:33 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, 0, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int");
|
2010-08-26 22:44:05 +00:00
|
|
|
|
2009-08-06 23:34:14 +00:00
|
|
|
/* Mesh Draw Options for Edit Mode*/
|
|
|
|
|
2010-08-17 17:03:52 +00:00
|
|
|
prop= RNA_def_property(srna, "show_edges", PROP_BOOLEAN, PROP_NONE);
|
2009-08-06 23:34:14 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEDGES);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Draw Edges", "Display selected edges using highlights in the 3D view and UV editor");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
2009-08-06 23:34:14 +00:00
|
|
|
|
2010-08-17 17:03:52 +00:00
|
|
|
prop= RNA_def_property(srna, "show_all_edges", PROP_BOOLEAN, PROP_NONE);
|
2009-10-13 17:49:05 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_ALLEDGES);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "All Edges", "Display all edges for wireframe in all view modes in the 3D view");
|
2010-06-13 02:54:55 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
2009-10-13 17:49:05 +00:00
|
|
|
|
2010-08-17 17:03:52 +00:00
|
|
|
prop= RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
|
2009-08-06 23:34:14 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWFACES);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Draw Faces", "Display all faces as shades in the 3D view and UV editor");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
2009-08-06 23:34:14 +00:00
|
|
|
|
2010-08-17 17:03:52 +00:00
|
|
|
prop= RNA_def_property(srna, "show_normal_face", PROP_BOOLEAN, PROP_NONE);
|
2009-08-06 23:34:14 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWNORMALS);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Draw Normals", "Display face normals as lines");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
2009-08-06 23:34:14 +00:00
|
|
|
|
2010-08-17 17:03:52 +00:00
|
|
|
prop= RNA_def_property(srna, "show_normal_vertex", PROP_BOOLEAN, PROP_NONE);
|
2009-08-06 23:34:14 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_VNORMALS);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Draw Vertex Normals", "Display vertex normals as lines");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
2009-08-06 23:34:14 +00:00
|
|
|
|
2010-08-17 17:03:52 +00:00
|
|
|
prop= RNA_def_property(srna, "show_edge_crease", PROP_BOOLEAN, PROP_NONE);
|
2009-08-06 23:34:14 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWCREASES);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Draw Creases", "Display creases created for subsurf weighting");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
2009-08-06 23:34:14 +00:00
|
|
|
|
2010-08-17 17:03:52 +00:00
|
|
|
prop= RNA_def_property(srna, "show_edge_bevel_weight", PROP_BOOLEAN, PROP_NONE);
|
2009-08-06 23:34:14 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWBWEIGHTS);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Draw Bevel Weights", "Display weights created for the Bevel modifier");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
2009-08-06 23:34:14 +00:00
|
|
|
|
2010-08-17 17:03:52 +00:00
|
|
|
prop= RNA_def_property(srna, "show_edge_seams", PROP_BOOLEAN, PROP_NONE);
|
2009-08-06 23:34:14 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSEAMS);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Draw Seams", "Display UV unwrapping seams");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
2009-08-06 23:34:14 +00:00
|
|
|
|
2010-08-17 17:03:52 +00:00
|
|
|
prop= RNA_def_property(srna, "show_edge_sharp", PROP_BOOLEAN, PROP_NONE);
|
2009-08-06 23:34:14 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSHARP);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Draw Sharp", "Display sharp edges, used with the EdgeSplit modifier");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
2009-10-13 17:49:05 +00:00
|
|
|
|
2010-08-17 17:03:52 +00:00
|
|
|
prop= RNA_def_property(srna, "show_extra_edge_length", PROP_BOOLEAN, PROP_NONE);
|
2010-12-20 03:59:22 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_EDGELEN);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Edge Length",
|
|
|
|
"Display selected edge lengths, using global values when set in the transform panel");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
2009-08-06 23:34:14 +00:00
|
|
|
|
2011-01-11 07:40:31 +00:00
|
|
|
prop= RNA_def_property(srna, "show_extra_face_angle", PROP_BOOLEAN, PROP_NONE);
|
2010-12-20 03:59:22 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_FACEANG);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Faces Angles",
|
|
|
|
"Display the angles between the selected edges in degrees, using "
|
|
|
|
"global values when set in the transform panel");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
2009-08-06 23:34:14 +00:00
|
|
|
|
2010-08-17 17:03:52 +00:00
|
|
|
prop= RNA_def_property(srna, "show_extra_face_area", PROP_BOOLEAN, PROP_NONE);
|
2010-12-20 03:59:22 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_FACEAREA);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Face Area",
|
|
|
|
"Display the area of selected faces, using global values when set in the transform panel");
|
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
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
2008-12-02 23:45:11 +00:00
|
|
|
|
2009-10-14 14:28:05 +00:00
|
|
|
/* editflag */
|
|
|
|
prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_X);
|
|
|
|
RNA_def_property_ui_text(prop, "X Mirror", "X Axis mirror editing");
|
|
|
|
|
|
|
|
/*
|
|
|
|
prop= RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Y);
|
|
|
|
RNA_def_property_ui_text(prop, "Y Mirror", "Y Axis mirror editing");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Z);
|
|
|
|
RNA_def_property_ui_text(prop, "Z Mirror", "Z Axis mirror editing");
|
|
|
|
*/
|
|
|
|
|
2010-02-17 19:50:42 +00:00
|
|
|
prop= RNA_def_property(srna, "use_mirror_topology", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_TOPO);
|
2011-09-24 09:57:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Topology Mirror",
|
|
|
|
"Use topology based mirroring (for when both sides of mesh have matching, unique topology)");
|
2010-02-17 19:50:42 +00:00
|
|
|
|
2009-10-20 19:27:27 +00:00
|
|
|
prop= RNA_def_property(srna, "use_paint_mask", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_PAINT_MASK);
|
|
|
|
RNA_def_property_ui_text(prop, "Paint Mask", "Face selection masking for painting");
|
2009-11-28 21:27:28 +00:00
|
|
|
RNA_def_property_ui_icon(prop, ICON_FACESEL_HLT, 0);
|
2011-07-20 15:56:35 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_facemask");
|
2009-10-20 19:27:27 +00:00
|
|
|
|
2011-09-18 17:10:28 +00:00
|
|
|
|
2011-09-14 08:45:12 +00:00
|
|
|
prop= RNA_def_property(srna, "use_paint_mask_vertex", PROP_BOOLEAN, PROP_NONE);
|
2011-07-12 19:06:06 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_VERT_SEL);
|
2011-09-14 08:45:12 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Vertex Selection", "Vertex selection masking for painting (weight paint only)");
|
2011-07-13 20:45:09 +00:00
|
|
|
RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0);
|
2011-07-20 15:56:35 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Mesh_update_vertmask");
|
2010-02-12 22:03:23 +00:00
|
|
|
|
|
|
|
/* readonly editmesh info - use for extrude menu */
|
|
|
|
prop= RNA_def_property(srna, "total_vert_sel", PROP_INT, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_int_funcs(prop, "rna_Mesh_tot_vert_get", NULL, NULL);
|
|
|
|
RNA_def_property_ui_text(prop, "Selected Vert Total", "Selected vertex count in editmode");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "total_edge_sel", PROP_INT, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_int_funcs(prop, "rna_Mesh_tot_edge_get", NULL, NULL);
|
|
|
|
RNA_def_property_ui_text(prop, "Selected Edge Total", "Selected edge count in editmode");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "total_face_sel", PROP_INT, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_int_funcs(prop, "rna_Mesh_tot_face_get", NULL, NULL);
|
|
|
|
RNA_def_property_ui_text(prop, "Selected Face Total", "Selected face count in editmode");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
2009-12-28 00:52:31 +00:00
|
|
|
/* pointers */
|
|
|
|
rna_def_animdata_common(srna);
|
2009-06-18 19:48:55 +00:00
|
|
|
|
|
|
|
RNA_api_mesh(srna);
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void RNA_def_mesh(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
rna_def_mesh(brna);
|
|
|
|
rna_def_mvert(brna);
|
|
|
|
rna_def_mvert_group(brna);
|
|
|
|
rna_def_medge(brna);
|
|
|
|
rna_def_mface(brna);
|
|
|
|
rna_def_mtface(brna);
|
|
|
|
rna_def_msticky(brna);
|
|
|
|
rna_def_mcol(brna);
|
|
|
|
rna_def_mproperties(brna);
|
2008-11-07 02:58:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|