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,
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation (2008).
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "RNA_define.h"
|
|
|
|
#include "RNA_types.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"
|
|
|
|
|
|
|
|
#include "BKE_customdata.h"
|
2008-11-07 02:58:25 +00:00
|
|
|
|
|
|
|
#ifdef RNA_RUNTIME
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
/*static float rna_MeshVertex_no_get(PointerRNA *ptr, int index)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MVert *mvert= (MVert*)ptr->data;
|
|
|
|
return mvert->no[index]/32767.0f;
|
|
|
|
}*/
|
|
|
|
|
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-01-10 22:57:33 +00:00
|
|
|
static float rna_MeshColor_color1_get(PointerRNA *ptr, int index)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
|
|
|
return (&mcol[0].r)[index]/255.0f;
|
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_MeshColor_color1_set(PointerRNA *ptr, int index, float value)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
|
|
|
(&mcol[0].r)[index]= (char)(CLAMPIS(value*255.0f, 0, 255));
|
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static float rna_MeshColor_color2_get(PointerRNA *ptr, int index)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
|
|
|
return (&mcol[1].r)[index]/255.0f;
|
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_MeshColor_color2_set(PointerRNA *ptr, int index, float value)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
|
|
|
(&mcol[1].r)[index]= (char)(CLAMPIS(value*255.0f, 0, 255));
|
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static float rna_MeshColor_color3_get(PointerRNA *ptr, int index)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
|
|
|
return (&mcol[2].r)[index]/255.0f;
|
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_MeshColor_color3_set(PointerRNA *ptr, int index, float value)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
|
|
|
(&mcol[2].r)[index]= (char)(CLAMPIS(value*255.0f, 0, 255));
|
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static float rna_MeshColor_color4_get(PointerRNA *ptr, int index)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
|
|
|
return (&mcol[2].r)[index]/255.0f;
|
|
|
|
}
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_MeshColor_color4_set(PointerRNA *ptr, int index, float value)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MCol *mcol= (MCol*)ptr->data;
|
|
|
|
(&mcol[3].r)[index]= (char)(CLAMPIS(value*255.0f, 0, 255));
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_Mesh_texspace_editable(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
return (me->texflag & AUTOSPACE)? PROP_NOT_EDITABLE: 0;
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
rna_iterator_array_begin(iter, (void*)dvert->dw, sizeof(MDeformWeight), dvert->totweight, NULL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rna_iterator_array_begin(iter, NULL, 0, 0, NULL);
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static void rna_MeshMultires_level_range(PointerRNA *ptr, int *min, int *max)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
Multires *mr= (Multires*)ptr->data;
|
|
|
|
*min= 1;
|
|
|
|
*max= mr->level_count;
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_CustomDataLayer_length(PointerRNA *ptr, int type)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
CustomDataLayer *layer;
|
|
|
|
int i, length= 0;
|
|
|
|
|
|
|
|
for(layer=me->fdata.layers, i=0; i<me->fdata.totlayer; layer++, i++)
|
|
|
|
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;
|
|
|
|
int n= ((CustomDataLayer*)ptr->data) - me->fdata.layers;
|
|
|
|
|
|
|
|
if(render) return (n == CustomData_get_render_layer_index(&me->fdata, type));
|
|
|
|
else return (n == CustomData_get_active_layer_index(&me->fdata, type));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_CustomDataLayer_active_set(PointerRNA *ptr, int value, int type, int render)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->id.data;
|
|
|
|
int n= ((CustomDataLayer*)ptr->data) - me->fdata.layers;
|
|
|
|
|
|
|
|
if(value == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if(render) CustomData_set_layer_render_index(&me->fdata, type, n);
|
|
|
|
else CustomData_set_layer_active_index(&me->fdata, type, n);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_uv_layer_check(CollectionPropertyIterator *iter, void *data)
|
|
|
|
{
|
|
|
|
CustomDataLayer *layer= (CustomDataLayer*)data;
|
|
|
|
return (layer->type != CD_MTFACE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_Mesh_uv_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_uv_layer_check);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_Mesh_uv_layers_length(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_length(ptr, CD_MTFACE);
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static float rna_MeshTextureFace_uv1_get(PointerRNA *ptr, int index)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
|
|
|
return mtface->uv[0][index];
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static void rna_MeshTextureFace_uv1_set(PointerRNA *ptr, int index, float value)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
|
|
|
mtface->uv[0][index]= value;
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static float rna_MeshTextureFace_uv2_get(PointerRNA *ptr, int index)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
|
|
|
return mtface->uv[1][index];
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static void rna_MeshTextureFace_uv2_set(PointerRNA *ptr, int index, float value)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
|
|
|
mtface->uv[1][index]= value;
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static float rna_MeshTextureFace_uv3_get(PointerRNA *ptr, int index)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
|
|
|
return mtface->uv[2][index];
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static void rna_MeshTextureFace_uv3_set(PointerRNA *ptr, int index, float value)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
|
|
|
mtface->uv[2][index]= value;
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static float rna_MeshTextureFace_uv4_get(PointerRNA *ptr, int index)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
|
|
|
return mtface->uv[3][index];
|
|
|
|
}
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
static void rna_MeshTextureFace_uv4_set(PointerRNA *ptr, int index, float value)
|
2008-11-24 12:12:24 +00:00
|
|
|
{
|
|
|
|
MTFace *mtface= (MTFace*)ptr->data;
|
|
|
|
mtface->uv[3][index]= value;
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
rna_iterator_array_begin(iter, layer->data, sizeof(MTFace), me->totface, NULL);
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
return me->totface;
|
|
|
|
}
|
|
|
|
|
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-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);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_vcol_layer_check(CollectionPropertyIterator *iter, void *data)
|
|
|
|
{
|
|
|
|
CustomDataLayer *layer= (CustomDataLayer*)data;
|
|
|
|
return (layer->type != CD_MCOL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_Mesh_vcol_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_vcol_layer_check);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_Mesh_vcol_layers_length(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_length(ptr, CD_MCOL);
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
rna_iterator_array_begin(iter, layer->data, sizeof(MCol)*4, me->totface, NULL);
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
return me->totface;
|
|
|
|
}
|
|
|
|
|
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-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;
|
|
|
|
rna_iterator_array_begin(iter, layer->data, sizeof(MFloatProperty), me->totface, NULL);
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
return me->totface;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_float_layer_check(CollectionPropertyIterator *iter, void *data)
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_float_layer_check);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_Mesh_float_layers_length(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_length(ptr, CD_PROP_FLT);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_int_layer_check(CollectionPropertyIterator *iter, void *data)
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
rna_iterator_array_begin(iter, layer->data, sizeof(MIntProperty), me->totface, NULL);
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
return me->totface;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_Mesh_int_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_int_layer_check);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_Mesh_int_layers_length(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_length(ptr, CD_PROP_INT);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_string_layer_check(CollectionPropertyIterator *iter, void *data)
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
rna_iterator_array_begin(iter, layer->data, sizeof(MStringProperty), me->totface, NULL);
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
return me->totface;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_Mesh_string_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
Mesh *me= (Mesh*)ptr->data;
|
|
|
|
rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_string_layer_check);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_Mesh_string_layers_length(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
return rna_CustomDataLayer_length(ptr, CD_PROP_STR);
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
RNA_def_struct_ui_text(srna, "Vertex Group Element", "Weight value of a vertex in a vertex group.");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_struct_sdna(srna, "MDeformWeight");
|
|
|
|
|
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");
|
|
|
|
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Group Index", "");
|
|
|
|
|
|
|
|
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");
|
|
|
|
}
|
|
|
|
|
|
|
|
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");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Vertex", "Vertex in a Mesh datablock.");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Location", "");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
/*prop= RNA_def_property(srna, "no", PROP_FLOAT, PROP_VECTOR);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_MeshVertex_no_get", NULL, NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Normal", "Vertex Normal");
|
|
|
|
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);*/
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
|
|
|
|
RNA_def_property_ui_text(prop, "Selected", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
|
|
|
|
RNA_def_property_ui_text(prop, "Hidden", "");
|
|
|
|
|
|
|
|
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");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0, 0);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_struct_type(prop, "VertexGroupElement");
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this vertex is member of.");
|
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");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Edge", "Edge in a Mesh datablock.");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "v1");
|
|
|
|
RNA_def_property_array(prop, 2);
|
|
|
|
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
|
|
|
|
|
|
|
|
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");
|
|
|
|
|
|
|
|
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");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
|
|
|
|
RNA_def_property_ui_text(prop, "Selected", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
|
|
|
|
RNA_def_property_ui_text(prop, "Hidden", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "seam", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SEAM);
|
|
|
|
RNA_def_property_ui_text(prop, "Seam", "Seam edge for UV unwrapping");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "sharp", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SHARP);
|
|
|
|
RNA_def_property_ui_text(prop, "Sharp", "Sharp edge for the EdgeSplit modifier");
|
|
|
|
}
|
|
|
|
|
|
|
|
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");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Face", "Face in a Mesh datablock.");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "v1");
|
|
|
|
RNA_def_property_array(prop, 4);
|
|
|
|
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
|
|
|
|
|
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", "");
|
|
|
|
RNA_def_property_range(prop, 0, MAXMAT-1);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshFace_material_index_range");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FACE_SEL);
|
|
|
|
RNA_def_property_ui_text(prop, "Selected", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
|
|
|
|
RNA_def_property_ui_text(prop, "Hidden", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "smooth", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SMOOTH);
|
|
|
|
RNA_def_property_ui_text(prop, "Smooth", "");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_mtface(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
static const EnumPropertyItem transp_items[]= {
|
|
|
|
{TF_SOLID, "OPAQUE", "Opaque", "Render color of textured face as color"},
|
|
|
|
{TF_ADD, "ADD", "Add", "Render face transparent and add color of face"},
|
|
|
|
{TF_ALPHA, "ALPHA", "Alpha", "Render polygon transparent, depending on alpha channel of the texture"},
|
|
|
|
{TF_CLIP, "CLIPALPHA", "Clip Alpha", "Use the images alpha values clipped with no blending (binary alpha)"},
|
|
|
|
{0, NULL, NULL, NULL}};
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
srna= RNA_def_struct(brna, "MeshTextureFaceLayer", NULL);
|
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Texture Face Layer", "Layer of texture faces in a Mesh datablock.");
|
|
|
|
RNA_def_struct_sdna(srna, "CustomDataLayer");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
|
|
|
RNA_def_struct_name_property(srna, prop);
|
|
|
|
RNA_def_property_ui_text(prop, "Name", "");
|
|
|
|
|
|
|
|
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");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0);
|
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_render_get", "rna_MeshTextureFaceLayer_active_render_set");
|
|
|
|
RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_struct_type(prop, "MeshTextureFace");
|
|
|
|
RNA_def_property_ui_text(prop, "Data", "");
|
|
|
|
RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, "rna_MeshTextureFaceLayer_data_length", 0, 0);
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
srna= RNA_def_struct(brna, "MeshTextureFace", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "MTFace");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Texture Face", "UV mapping, texturing and game engine data for a face.");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
/* prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
|
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "tpage");
|
|
|
|
RNA_def_property_ui_text(prop, "Image", ""); */
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "tex", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TEX);
|
|
|
|
RNA_def_property_ui_text(prop, "Tex", "Render face with texture");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "tiles", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TILES);
|
|
|
|
RNA_def_property_ui_text(prop, "Tiles", "Use tilemode for face");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "light", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_LIGHT);
|
|
|
|
RNA_def_property_ui_text(prop, "Light", "Use light for face");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "invisible", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_INVISIBLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Invisible", "Make face invisible");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "collision", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_DYNAMIC);
|
|
|
|
RNA_def_property_ui_text(prop, "Collision", "Use face for collision and ray-sensor detection");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "shared", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_SHAREDCOL);
|
|
|
|
RNA_def_property_ui_text(prop, "Shared", "Blend vertex colors across face when vertices are shared");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "twoside", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TWOSIDE);
|
|
|
|
RNA_def_property_ui_text(prop, "Twoside", "Render face twosided");
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
prop= RNA_def_property(srna, "object_color", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_OBCOL);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Object Color", "Use ObColor instead of vertex colors");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BILLBOARD);
|
|
|
|
RNA_def_property_ui_text(prop, "Halo", "Screen aligned billboard");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "billboard", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BILLBOARD2);
|
|
|
|
RNA_def_property_ui_text(prop, "Billboard", "Billboard with Z-axis constraint");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "shadow", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_SHADOW);
|
|
|
|
RNA_def_property_ui_text(prop, "Shadow", "Face is used for shadow");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "text", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BMFONT);
|
|
|
|
RNA_def_property_ui_text(prop, "Text", "Enable bitmap text on face");
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
prop= RNA_def_property(srna, "alpha_sort", PROP_BOOLEAN, PROP_NONE);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_ALPHASORT);
|
|
|
|
RNA_def_property_ui_text(prop, "Alpha Sort", "Enable sorting of faces for correct alpha drawing (slow, use Clip Alpha instead when possible)");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "transp", PROP_ENUM, PROP_NONE);
|
|
|
|
RNA_def_property_enum_items(prop, transp_items);
|
|
|
|
RNA_def_property_ui_text(prop, "Transparency", "Transparency blending mode");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "uv_selected", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TF_SEL1);
|
|
|
|
RNA_def_property_array(prop, 4);
|
|
|
|
RNA_def_property_ui_text(prop, "UV Selected", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "uv_pinned", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "unwrap", TF_PIN1);
|
|
|
|
RNA_def_property_array(prop, 4);
|
|
|
|
RNA_def_property_ui_text(prop, "UV Pinned", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "uv1", PROP_FLOAT, PROP_VECTOR);
|
|
|
|
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", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "uv2", PROP_FLOAT, PROP_VECTOR);
|
|
|
|
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", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "uv3", PROP_FLOAT, PROP_VECTOR);
|
|
|
|
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", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "uv4", PROP_FLOAT, PROP_VECTOR);
|
|
|
|
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", "");
|
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");
|
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Vertex Sticky Texture Coordinate", "Stricky texture coordinate.");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
|
|
|
|
RNA_def_property_ui_text(prop, "Location", "Sticky texture coordinate location.");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_mcol(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
srna= RNA_def_struct(brna, "MeshColorLayer", NULL);
|
|
|
|
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");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
|
|
|
RNA_def_struct_name_property(srna, prop);
|
|
|
|
RNA_def_property_ui_text(prop, "Name", "");
|
|
|
|
|
|
|
|
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");
|
|
|
|
|
|
|
|
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");
|
|
|
|
|
|
|
|
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", "");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, "rna_MeshColorLayer_data_length", 0, 0);
|
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");
|
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Vertex Color", "Vertex colors for a face in a Mesh.");
|
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-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", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "color2", PROP_FLOAT, PROP_COLOR);
|
|
|
|
RNA_def_property_array(prop, 3);
|
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", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "color3", PROP_FLOAT, PROP_COLOR);
|
|
|
|
RNA_def_property_array(prop, 3);
|
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", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "color4", PROP_FLOAT, PROP_COLOR);
|
|
|
|
RNA_def_property_array(prop, 3);
|
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", "");
|
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");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Float Property Layer", "User defined layer of floating pointer number values.");
|
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", "");
|
|
|
|
|
|
|
|
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", "");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, "rna_MeshFloatPropertyLayer_data_length", 0, 0);
|
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");
|
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Float Property", "User defined floating point number value in a float properties layer.");
|
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", "");
|
|
|
|
|
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");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Int Property Layer", "User defined layer of integer number values.");
|
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", "");
|
|
|
|
|
|
|
|
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", "");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, "rna_MeshIntPropertyLayer_data_length", 0, 0);
|
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");
|
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Int Property", "User defined integer number value in an integer properties layer.");
|
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", "");
|
|
|
|
|
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");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh String Property Layer", "User defined layer of string text values.");
|
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", "");
|
|
|
|
|
|
|
|
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", "");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, "rna_MeshStringPropertyLayer_data_length", 0, 0);
|
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");
|
|
|
|
RNA_def_struct_ui_text(srna, "Mesh String Property", "User defined string text value in a string properties layer.");
|
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", "");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_mmultires(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2009-01-02 14:48:03 +00:00
|
|
|
srna= RNA_def_struct(brna, "MeshMultires", NULL);
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Multires");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh Multires", "Multiresolution mesh levels data in a Mesh datablock.");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "level", PROP_INT, PROP_NONE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "newlvl");
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshMultires_level_range");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Level", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "edge_level", PROP_INT, PROP_NONE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "edgelvl");
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshMultires_level_range");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Edge Level", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "pin_level", PROP_INT, PROP_NONE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "pinlvl");
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshMultires_level_range");
|
|
|
|
RNA_def_property_ui_text(prop, "Pin Level", "Set level to apply modifiers to during render.");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "render_level", PROP_INT, PROP_NONE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "renderlvl");
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshMultires_level_range");
|
|
|
|
RNA_def_property_ui_text(prop, "Render Level", "Set level to render.");
|
2008-11-24 12:12:24 +00:00
|
|
|
}
|
|
|
|
|
2008-12-02 23:45:11 +00:00
|
|
|
void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable)
|
|
|
|
{
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
/* texture space */
|
|
|
|
prop= RNA_def_property(srna, "auto_texspace", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "texflag", AUTOSPACE);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjusts active object's texture space automatically when transforming object.");
|
2008-12-02 23:45:11 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "texspace_loc", PROP_FLOAT, PROP_VECTOR);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "loc");
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Texure Space Location", "Texture space location.");
|
2009-01-01 15:52:51 +00:00
|
|
|
RNA_def_property_editable_func(prop, texspace_editable);
|
2008-12-02 23:45:11 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_VECTOR);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "size");
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size.");
|
2009-01-01 15:52:51 +00:00
|
|
|
RNA_def_property_editable_func(prop, texspace_editable);
|
2008-12-02 23:45:11 +00:00
|
|
|
|
|
|
|
/* not supported yet
|
|
|
|
prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_ROTATION);
|
|
|
|
RNA_def_property_float(prop, NULL, "rot");
|
|
|
|
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
|
2009-01-01 15:52:51 +00:00
|
|
|
RNA_def_property_editable_func(prop, texspace_editable);*/
|
2008-12-02 23:45:11 +00:00
|
|
|
|
|
|
|
/* 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", "");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Mesh", "Mesh datablock to define geometric surfaces.");
|
2008-11-07 02:58:25 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "verts", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "mvert", "totvert");
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshVertex");
|
|
|
|
RNA_def_property_ui_text(prop, "Vertices", "Vertices of the mesh.");
|
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");
|
|
|
|
RNA_def_property_ui_text(prop, "Edges", "Edges of the mesh.");
|
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");
|
|
|
|
RNA_def_property_ui_text(prop, "Faces", "Faces of the mesh.");
|
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");
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Sticky", "Sticky texture coordinates.");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "uv_layers", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
|
|
|
|
RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_layers_begin", 0, 0, 0, 0, "rna_Mesh_uv_layers_length", 0, 0);
|
2009-01-02 14:48:03 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "UV Layers", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "vcol_layers", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
|
|
|
|
RNA_def_property_collection_funcs(prop, "rna_Mesh_vcol_layers_begin", 0, 0, 0, 0, "rna_Mesh_vcol_layers_length", 0, 0);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MeshColorLayer");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Vertex Color Layers", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "float_layers", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
|
|
|
|
RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", 0, 0, 0, 0, "rna_Mesh_float_layers_length", 0, 0);
|
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", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "int_layers", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
|
|
|
|
RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", 0, 0, 0, 0, "rna_Mesh_int_layers_length", 0, 0);
|
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", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "string_layers", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
|
|
|
|
RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", 0, 0, 0, 0, "rna_Mesh_string_layers_length", 0, 0);
|
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", "");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "autosmooth", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_AUTOSMOOTH);
|
|
|
|
RNA_def_property_ui_text(prop, "Auto Smooth", "Treats all set-smoothed faces with angles less than the specified angle as 'smooth' during render");
|
|
|
|
|
2008-12-26 02:02:06 +00:00
|
|
|
prop= RNA_def_property(srna, "autosmooth_angle", PROP_INT, PROP_NONE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "smoothresh");
|
2008-11-24 12:12:24 +00:00
|
|
|
RNA_def_property_range(prop, 1, 80);
|
|
|
|
RNA_def_property_ui_text(prop, "Auto Smooth Angle", "Defines maximum angle between face normals that 'Auto Smooth' will operate on");
|
|
|
|
|
2008-12-03 20:17:12 +00:00
|
|
|
prop= RNA_def_property(srna, "vertex_normal_flip", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ME_NOPUNOFLIP);
|
|
|
|
RNA_def_property_ui_text(prop, "Vertex Normal Flip", "Flip vertex normals towards the camera during render");
|
2008-11-24 12:12:24 +00:00
|
|
|
|
2008-12-02 23:45:11 +00:00
|
|
|
prop= RNA_def_property(srna, "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");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "texco_mesh", PROP_POINTER, PROP_NONE);
|
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "texcomesh");
|
|
|
|
RNA_def_property_ui_text(prop, "Texture Space Mesh", "Derive texture coordinates from another mesh");
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "multires", PROP_POINTER, PROP_NONE);
|
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "mr");
|
|
|
|
RNA_def_property_ui_text(prop, "Multires", "");
|
|
|
|
|
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", "");
|
2008-12-02 23:45:11 +00:00
|
|
|
|
|
|
|
rna_def_texmat_common(srna, "rna_Mesh_texspace_editable");
|
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);
|
|
|
|
rna_def_mmultires(brna);
|
2008-11-07 02:58:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|