From b9e04c67dce1e808c06f67ec3ae43e763f67d46b Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 9 Dec 2008 11:29:40 +0000 Subject: [PATCH] RNA: Start of RNA wrapping for Armatures Wrapped most of Armature settings, but bones are not yet complete. --- source/blender/makesrna/RNA_access.h | 2 + source/blender/makesrna/intern/makesrna.c | 1 + source/blender/makesrna/intern/rna_ID.c | 1 + source/blender/makesrna/intern/rna_armature.c | 195 ++++++++++++++++++ source/blender/makesrna/intern/rna_internal.h | 1 + source/blender/makesrna/intern/rna_ipo.c | 7 - source/blender/makesrna/intern/rna_main.c | 2 +- 7 files changed, 201 insertions(+), 8 deletions(-) create mode 100644 source/blender/makesrna/intern/rna_armature.c diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index cd3c32edf50..efe458837fd 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -39,7 +39,9 @@ extern StructRNA RNA_Actuator; extern StructRNA RNA_ActuatorSensor; extern StructRNA RNA_AlwaysSensor; extern StructRNA RNA_AndController; +extern StructRNA RNA_Armature; extern StructRNA RNA_BooleanProperty; +extern StructRNA RNA_Bone; extern StructRNA RNA_Brush; extern StructRNA RNA_Camera; extern StructRNA RNA_CharInfo; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 20993c3ee52..c3b01cb50d9 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -894,6 +894,7 @@ typedef struct RNAProcessItem { RNAProcessItem PROCESS_ITEMS[]= { {"rna_ID.c", RNA_def_ID}, {"rna_actuator.c", RNA_def_actuator}, + {"rna_armature.c", RNA_def_armature}, {"rna_brush.c", RNA_def_brush}, {"rna_camera.c", RNA_def_camera}, {"rna_color.c", RNA_def_color}, diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 57622200ee6..35d59bad826 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -58,6 +58,7 @@ static StructRNA *rna_ID_refine(PointerRNA *ptr) ID *id= (ID*)ptr->data; switch(GS(id->name)) { + case ID_AR: return &RNA_Armature; case ID_BR: return &RNA_Brush; case ID_CA: return &RNA_Camera; case ID_CU: return &RNA_Curve; diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c new file mode 100644 index 00000000000..564c356ce31 --- /dev/null +++ b/source/blender/makesrna/intern/rna_armature.c @@ -0,0 +1,195 @@ +/** + * $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), Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include + +#include "RNA_define.h" +#include "RNA_types.h" + +#include "rna_internal.h" + +#include "DNA_armature_types.h" + +#ifdef RNA_RUNTIME + +static void rna_Armature_layer_set(PointerRNA *ptr, int index, int value) +{ + bArmature *arm= (bArmature*)ptr->data; + + if(value) arm->layer |= (1<layer &= ~(1<layer == 0) + arm->layer |= (1<