2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2009-06-18 19:48:55 +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.
|
2009-06-18 19:48:55 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2009 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2011-02-27 20:20:01 +00:00
|
|
|
/** \file blender/makesrna/intern/rna_mesh_api.c
|
|
|
|
* \ingroup RNA
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2009-06-18 19:48:55 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "RNA_define.h"
|
|
|
|
|
2009-09-28 14:28:45 +00:00
|
|
|
#include "BLO_sys_types.h"
|
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
|
|
|
|
2011-02-09 02:28:11 +00:00
|
|
|
#include "BKE_mesh.h"
|
2009-09-28 14:28:45 +00:00
|
|
|
#include "ED_mesh.h"
|
2009-06-28 13:29:03 +00:00
|
|
|
|
2009-09-28 14:28:45 +00:00
|
|
|
#ifdef RNA_RUNTIME
|
2009-07-02 20:46:35 +00:00
|
|
|
|
2010-01-04 22:30:09 +00:00
|
|
|
|
2009-06-18 19:48:55 +00:00
|
|
|
#else
|
|
|
|
|
|
|
|
void RNA_api_mesh(StructRNA *srna)
|
|
|
|
{
|
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
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
2009-09-28 14:28:45 +00:00
|
|
|
func= RNA_def_function(srna, "transform", "ED_mesh_transform");
|
2009-06-23 17:52:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Transform mesh vertices by a matrix.");
|
2009-09-22 16:35:07 +00:00
|
|
|
parm= RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix.", 0.0f, 0.0f);
|
2009-06-23 17:52:58 +00:00
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
2009-06-18 19:48:55 +00:00
|
|
|
|
2009-09-28 14:28:45 +00:00
|
|
|
func= RNA_def_function(srna, "calc_normals", "ED_mesh_calc_normals");
|
2009-07-02 20:46:35 +00:00
|
|
|
RNA_def_function_ui_description(func, "Calculate vertex normals.");
|
|
|
|
|
2009-09-28 14:28:45 +00:00
|
|
|
func= RNA_def_function(srna, "update", "ED_mesh_update");
|
2009-10-12 19:34:58 +00:00
|
|
|
RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges.");
|
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
|
|
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
2011-02-09 01:27:46 +00:00
|
|
|
|
2011-02-09 02:28:11 +00:00
|
|
|
func= RNA_def_function(srna, "validate", "BKE_mesh_validate");
|
2011-02-10 09:29:31 +00:00
|
|
|
RNA_def_function_ui_description(func, "validate geometry, return True when the mesh has had invalid geometry corrected/removed.");
|
2011-05-08 10:29:40 +00:00
|
|
|
RNA_def_boolean(func, "verbose", 0, "Verbose", "Output information about the errors found");
|
2011-02-10 09:29:31 +00:00
|
|
|
parm= RNA_def_boolean(func, "result", 0, "Result", "");
|
|
|
|
RNA_def_function_return(func, parm);
|
2009-06-18 19:48:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|