diff options
author | Martin Poirier <theeth@yahoo.com> | 2007-11-07 03:28:45 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2007-11-07 03:28:45 +0300 |
commit | ec13425eab373e23ced76df7de732446ae363519 (patch) | |
tree | 3846cd91308d4bef60f4747d80e85ef8c1acfc4f /source/blender/include | |
parent | 0de103c1cdf1e4c40cfad4e233a42a6d1165953d (diff) |
Initial commit for Harmonic Skeleton generation.
This is very much a work in progress commit to allow me to work outside of home.
While it does somewhat work, I wouldn't recommend anyone to use it.
Diffstat (limited to 'source/blender/include')
-rw-r--r-- | source/blender/include/BIF_editarmature.h | 8 | ||||
-rw-r--r-- | source/blender/include/BSE_edit.h | 3 | ||||
-rw-r--r-- | source/blender/include/butspace.h | 3 | ||||
-rw-r--r-- | source/blender/include/reeb.h | 84 |
4 files changed, 96 insertions, 2 deletions
diff --git a/source/blender/include/BIF_editarmature.h b/source/blender/include/BIF_editarmature.h index 903c663e5f3..e836b98585e 100644 --- a/source/blender/include/BIF_editarmature.h +++ b/source/blender/include/BIF_editarmature.h @@ -37,6 +37,7 @@ struct Base; struct Bone; struct bArmature; struct ListBase; +struct ReebGraph; typedef struct EditBone { @@ -78,6 +79,8 @@ void add_primitiveArmature(int type); void apply_rot_armature (struct Object *ob, float mat[3][3]); void docenter_armature (struct Object *ob, int centermode); +void generateSkeletonFromReebGraph(struct ReebGraph *rg); + void clear_armature(struct Object *ob, char mode); void delete_armature(void); @@ -117,8 +120,8 @@ void hide_selected_pose_bones(void); void hide_unselected_pose_bones(void); void show_all_pose_bones(void); -int bone_looper(Object *ob, struct Bone *bone, void *data, - int (*bone_func)(Object *, struct Bone *, void *)); +int bone_looper(struct Object *ob, struct Bone *bone, void *data, + int (*bone_func)(struct Object *, struct Bone *, void *)); void undo_push_armature(char *name); void armature_bone_rename(struct bArmature *arm, char *oldname, char *newname); @@ -140,3 +143,4 @@ void show_all_armature_bones(void); #endif + diff --git a/source/blender/include/BSE_edit.h b/source/blender/include/BSE_edit.h index 048d4d012b2..25ca4cc1065 100644 --- a/source/blender/include/BSE_edit.h +++ b/source/blender/include/BSE_edit.h @@ -51,5 +51,8 @@ void snap_curs_to_grid(void); void snap_curs_to_sel(void); void snap_to_center(void); +void generateSkeleton(void); + #endif /* BSE_EDIT_H */ + diff --git a/source/blender/include/butspace.h b/source/blender/include/butspace.h index fec85c03b77..41360470772 100644 --- a/source/blender/include/butspace.h +++ b/source/blender/include/butspace.h @@ -413,6 +413,8 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la #define B_SETTFACE_RND 2082 #define B_SETMCOL_RND 2083 +#define B_GEN_SKELETON 2090 + /* *********************** */ #define B_VGROUPBUTS 2100 @@ -721,3 +723,4 @@ enum { #endif + diff --git a/source/blender/include/reeb.h b/source/blender/include/reeb.h new file mode 100644 index 00000000000..f3d569422c6 --- /dev/null +++ b/source/blender/include/reeb.h @@ -0,0 +1,84 @@ +/** + * $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. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * 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): Martin Poirier + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef REEB_H_ +#define REEB_H_ + +#include "DNA_listBase.h" + +struct EdgeHash; +struct ReebArc; +struct ReebEdge; +struct ReebNode; + +typedef struct ReebGraph { + ListBase arcs; + ListBase nodes; + int totnodes; + struct EdgeHash *emap; +} ReebGraph; + +typedef struct EmbedBucket { + float val; + int nv; + float p[3]; +} EmbedBucket; + +typedef struct ReebNode { + struct ReebNode *next, *prev; + struct ReebArc **arcs; + int index; + int degree; + float weight; + float p[3]; +} ReebNode; + +typedef struct ReebEdge { + struct ReebEdge *next, *prev; + struct ReebArc *arc; + struct ReebNode *v1, *v2; + struct ReebEdge *nextEdge; +} ReebEdge; + +typedef struct ReebArc { + struct ReebArc *next, *prev; + ListBase edges; + struct ReebNode *v1, *v2; + int bcount; + struct EmbedBucket *buckets; +} ReebArc; + +struct EditMesh; + +void weightToHarmonic(struct EditMesh *em); +void weightFromDistance(struct EditMesh *em); +void weightFromLoc(struct EditMesh *me, int axis); +void renormalizeWeight(struct EditMesh *em, float newmax); +void filterReebGraph(ReebGraph *rg, float threshold); +struct ReebGraph * generateReebGraph(struct EditMesh *me, int subdivisions); + +#endif /*REEB_H_*/ |