[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19337] branches/blender2.5/blender/source /blender: merge more etch-a-ton code.
Martin Poirier
theeth at yahoo.com
Fri Mar 20 19:00:51 CET 2009
Revision: 19337
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19337
Author: theeth
Date: 2009-03-20 19:00:51 +0100 (Fri, 20 Mar 2009)
Log Message:
-----------
merge more etch-a-ton code. nothing works, but it compiles. Will try to get it working this week end.
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/editors/armature/armature_intern.h
branches/blender2.5/blender/source/blender/editors/armature/editarmature.c
branches/blender2.5/blender/source/blender/editors/armature/reeb.h
branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h
branches/blender2.5/blender/source/blender/editors/include/ED_armature.h
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_buttons.c
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_draw.c
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_view.c
branches/blender2.5/blender/source/blender/editors/transform/transform_snap.c
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_init_exit.c
Added Paths:
-----------
branches/blender2.5/blender/source/blender/editors/armature/BIF_generate.h
branches/blender2.5/blender/source/blender/editors/armature/BIF_retarget.h
branches/blender2.5/blender/source/blender/editors/armature/editarmature_generate.c
branches/blender2.5/blender/source/blender/editors/armature/editarmature_retarget.c
branches/blender2.5/blender/source/blender/editors/armature/editarmature_sketch.c
branches/blender2.5/blender/source/blender/editors/armature/reeb.c
Copied: branches/blender2.5/blender/source/blender/editors/armature/BIF_generate.h (from rev 19327, trunk/blender/source/blender/include/BIF_generate.h)
===================================================================
--- branches/blender2.5/blender/source/blender/editors/armature/BIF_generate.h (rev 0)
+++ branches/blender2.5/blender/source/blender/editors/armature/BIF_generate.h 2009-03-20 18:00:51 UTC (rev 19337)
@@ -0,0 +1,45 @@
+/**
+ * $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.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef BIF_GENERATE_H
+#define BIF_GENERATE_H
+
+struct bContext;
+struct EditBone;
+struct BArcIterator;
+struct bArmature;
+struct ListBase;
+
+typedef int(NextSubdivisionFunc)(struct bContext*, struct BArcIterator*, int, int, float[3], float[3]);
+
+float calcArcCorrelation(struct BArcIterator *iter, int start, int end, float v0[3], float n[3]);
+
+int nextFixedSubdivision(struct bContext *C, struct BArcIterator *iter, int start, int end, float head[3], float p[3]);
+int nextLengthSubdivision(struct bContext *C, struct BArcIterator *iter, int start, int end, float head[3], float p[3]);
+int nextAdaptativeSubdivision(struct bContext *C, struct BArcIterator *iter, int start, int end, float head[3], float p[3]);
+
+struct EditBone * subdivideArcBy(struct bContext *C, struct bArmature *arm, ListBase *editbones, struct BArcIterator *iter, float invmat[][4], float tmat[][3], NextSubdivisionFunc next_subdividion);
+
+void setBoneRollFromNormal(struct EditBone *bone, float *no, float invmat[][4], float tmat[][3]);
+
+
+#endif /* BIF_GENERATE_H */
Copied: branches/blender2.5/blender/source/blender/editors/armature/BIF_retarget.h (from rev 19327, trunk/blender/source/blender/include/BIF_retarget.h)
===================================================================
--- branches/blender2.5/blender/source/blender/editors/armature/BIF_retarget.h (rev 0)
+++ branches/blender2.5/blender/source/blender/editors/armature/BIF_retarget.h 2009-03-20 18:00:51 UTC (rev 19337)
@@ -0,0 +1,160 @@
+/**
+ * $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.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef BIF_RETARGET_H
+#define BIF_RETARGET_H
+
+#include "DNA_listBase.h"
+
+#include "BLI_graph.h"
+#include "BLI_ghash.h"
+#include "BLI_threads.h"
+
+#include "reeb.h"
+
+struct Object;
+struct bArmature;
+struct bContext;
+
+struct EditBone;
+
+struct RigJoint;
+struct RigGraph;
+struct RigNode;
+struct RigArc;
+struct RigEdge;
+
+#define USE_THREADS
+
+typedef struct RigGraph {
+ ListBase arcs;
+ ListBase nodes;
+
+ float length;
+
+ FreeArc free_arc;
+ FreeNode free_node;
+ RadialSymmetry radial_symmetry;
+ AxialSymmetry axial_symmetry;
+ /*********************************/
+
+ int flag;
+
+ ListBase controls;
+ ListBase* editbones;
+
+ struct RigNode *head;
+ ReebGraph *link_mesh;
+
+
+ struct ThreadedWorker *worker;
+
+ GHash *bones_map; /* map of editbones by name */
+ GHash *controls_map; /* map of rigcontrols by bone pointer */
+
+ struct Object *ob;
+} RigGraph;
+
+typedef struct RigNode {
+ void *next, *prev;
+ float p[3];
+ int flag;
+
+ int degree;
+ struct BArc **arcs;
+
+ int subgraph_index;
+
+ int symmetry_level;
+ int symmetry_flag;
+ float symmetry_axis[3];
+ /*********************************/
+
+ ReebNode *link_mesh;
+} RigNode;
+
+typedef struct RigArc {
+ void *next, *prev;
+ RigNode *head, *tail;
+ int flag;
+
+ float length;
+
+ int symmetry_level;
+ int symmetry_group;
+ int symmetry_flag;
+ /*********************************/
+
+ ListBase edges;
+ int count;
+ ReebArc *link_mesh;
+} RigArc;
+
+typedef struct RigEdge {
+ struct RigEdge *next, *prev;
+ float head[3], tail[3];
+ float length;
+ float angle; /* angle to next edge */
+ float up_angle; /* angle between up_axis and the joint normal (defined as Previous edge CrossProduct Current edge */
+ struct EditBone *bone;
+ float up_axis[3];
+} RigEdge;
+
+/* Graph flags */
+#define RIG_FREE_BONELIST 1
+
+/* Control flags */
+#define RIG_CTRL_HEAD_DONE 1
+#define RIG_CTRL_TAIL_DONE 2
+#define RIG_CTRL_PARENT_DEFORM 4
+#define RIG_CTRL_FIT_ROOT 8
+#define RIG_CTRL_FIT_BONE 16
+
+#define RIG_CTRL_DONE (RIG_CTRL_HEAD_DONE|RIG_CTRL_TAIL_DONE)
+
+/* Control tail flags */
+typedef enum {
+ TL_NONE = 0,
+ TL_TAIL,
+ TL_HEAD
+} LinkTailMode;
+
+typedef struct RigControl {
+ struct RigControl *next, *prev;
+ float head[3], tail[3];
+ struct EditBone *bone;
+ struct EditBone *link;
+ struct EditBone *link_tail;
+ float up_axis[3];
+ float offset[3];
+ float qrot[4]; /* for dual linked bones, store the rotation of the linked bone for the finalization */
+ int flag;
+ LinkTailMode tail_mode;
+} RigControl;
+
+void BIF_retargetArc(struct bContext *C, ReebArc *earc, RigGraph *template_rigg);
+RigGraph *RIG_graphFromArmature(struct bContext *C, struct Object *ob, struct bArmature *arm);
+int RIG_nbJoints(RigGraph *rg);
+char *RIG_nameBone(RigGraph *rg, int arc_index, int bone_index);
+void RIG_freeRigGraph(BGraph *rg);
+
+#endif /* BIF_RETARGET_H */
Modified: branches/blender2.5/blender/source/blender/editors/armature/armature_intern.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/armature/armature_intern.h 2009-03-20 14:52:58 UTC (rev 19336)
+++ branches/blender2.5/blender/source/blender/editors/armature/armature_intern.h 2009-03-20 18:00:51 UTC (rev 19337)
@@ -64,7 +64,10 @@
/* editarmature.c */
struct bArmature;
struct EditBone;
+struct ListBase;
+void make_boneList(struct ListBase *edbo, struct ListBase *bones, struct EditBone *parent);
+
struct EditBone *addEditBone(struct bArmature *arm, char *name);
/* duplicate method */
Modified: branches/blender2.5/blender/source/blender/editors/armature/editarmature.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/armature/editarmature.c 2009-03-20 14:52:58 UTC (rev 19336)
+++ branches/blender2.5/blender/source/blender/editors/armature/editarmature.c 2009-03-20 18:00:51 UTC (rev 19337)
@@ -75,7 +75,7 @@
#include "BIF_gl.h"
#include "BIF_transform.h"
-// XXX etch-a-ton #include "BIF_generate.h"
+#include "BIF_generate.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -1762,6 +1762,8 @@
view3d_set_viewcontext(C, &vc);
+ BIF_sk_selectStroke(C, mval, extend);
+
nearBone= get_nearest_editbonepoint(&vc, mval, arm->edbo, 1, &selmask);
if (nearBone) {
@@ -1856,7 +1858,7 @@
arm->edbo= MEM_callocN(sizeof(ListBase), "edbo armature");
make_boneList(arm->edbo, &arm->bonebase,NULL);
- // XXX etch-a-ton BIF_freeTemplates(); /* force template update when entering editmode */
+// BIF_freeTemplates(); /* force template update when entering editmode */
}
Copied: branches/blender2.5/blender/source/blender/editors/armature/editarmature_generate.c (from rev 19327, trunk/blender/source/blender/src/editarmature_generate.c)
===================================================================
--- branches/blender2.5/blender/source/blender/editors/armature/editarmature_generate.c (rev 0)
+++ branches/blender2.5/blender/source/blender/editors/armature/editarmature_generate.c 2009-03-20 18:00:51 UTC (rev 19337)
@@ -0,0 +1,331 @@
+/**
+ * $Id: editarmature_generate.c $
+ *
+ * ***** 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.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ * editarmature.c: Interface for creating and posing armature objects
+ */
+
+#include <string.h>
+#include <math.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_listBase.h"
+#include "DNA_scene_types.h"
+#include "DNA_armature_types.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_graph.h"
+
+#include "BKE_utildefines.h"
+#include "BKE_global.h"
+#include "BKE_context.h"
+
+#include "ED_armature.h"
+#include "BIF_generate.h"
+
+void setBoneRollFromNormal(EditBone *bone, float *no, float invmat[][4], float tmat[][3])
+{
+ if (no != NULL && !VecIsNull(no))
+ {
+ float tangent[3], cotangent[3], normal[3];
+
+ VECCOPY(normal, no);
+ Mat3MulVecfl(tmat, normal);
+
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list