[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18136] branches/blender2.5/blender/source /blender: 2.5
Martin Poirier
theeth at yahoo.com
Mon Dec 29 02:41:30 CET 2008
Revision: 18136
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18136
Author: theeth
Date: 2008-12-29 02:41:28 +0100 (Mon, 29 Dec 2008)
Log Message:
-----------
2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/blenlib/BLI_arithb.h
branches/blender2.5/blender/source/blender/blenlib/intern/arithb.c
branches/blender2.5/blender/source/blender/editors/include/ED_view3d.h
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_intern.h
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_ops.c
branches/blender2.5/blender/source/blender/editors/transform/Makefile
branches/blender2.5/blender/source/blender/editors/transform/SConscript
Added Paths:
-----------
branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h
branches/blender2.5/blender/source/blender/editors/transform/transform.c
branches/blender2.5/blender/source/blender/editors/transform/transform.h
branches/blender2.5/blender/source/blender/editors/transform/transform_constraints.c
branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c
branches/blender2.5/blender/source/blender/editors/transform/transform_manipulator.c
branches/blender2.5/blender/source/blender/editors/transform/transform_ndofinput.c
branches/blender2.5/blender/source/blender/editors/transform/transform_numinput.c
branches/blender2.5/blender/source/blender/editors/transform/transform_orientations.c
branches/blender2.5/blender/source/blender/editors/transform/transform_snap.c
Modified: branches/blender2.5/blender/source/blender/blenlib/BLI_arithb.h
===================================================================
--- branches/blender2.5/blender/source/blender/blenlib/BLI_arithb.h 2008-12-29 01:19:25 UTC (rev 18135)
+++ branches/blender2.5/blender/source/blender/blenlib/BLI_arithb.h 2008-12-29 01:41:28 UTC (rev 18136)
@@ -123,6 +123,7 @@
* @section Quaternion arithmetic routines
*/
+int QuatIsNul(float *q);
void QuatToEul(float *quat, float *eul);
void QuatOne(float *);
void QuatMul(float *, float *, float *);
Modified: branches/blender2.5/blender/source/blender/blenlib/intern/arithb.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenlib/intern/arithb.c 2008-12-29 01:19:25 UTC (rev 18135)
+++ branches/blender2.5/blender/source/blender/blenlib/intern/arithb.c 2008-12-29 01:41:28 UTC (rev 18136)
@@ -1087,6 +1087,10 @@
/* **************** QUATERNIONS ********** */
+int QuatIsNul(float *q)
+{
+ return (q[0] == 0 && q[1] == 0 && q[2] == 0 && q[3] == 0);
+}
void QuatMul(float *q, float *q1, float *q2)
{
Copied: branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h (from rev 18080, trunk/blender/source/blender/include/BIF_transform.h)
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h (rev 0)
+++ branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h 2008-12-29 01:41:28 UTC (rev 18136)
@@ -0,0 +1,135 @@
+/**
+ * $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.
+ *
+ * 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 *****
+ */
+
+#ifndef BIF_TRANSFORM_H
+#define BIF_TRANSFORM_H
+
+/* ******************* Registration Function ********************** */
+
+struct wmWindowManager;
+struct ListBase;
+struct wmEvent;
+struct bContext;
+
+void transform_keymap_for_space(struct wmWindowManager *wm, struct ListBase *keymap, int spaceid);
+void transform_operatortypes(void);
+
+/* ******************** Macros & Prototypes *********************** */
+
+/* MODE AND NUMINPUT FLAGS */
+#define TFM_INIT -1
+#define TFM_DUMMY 0
+#define TFM_TRANSLATION 1
+#define TFM_ROTATION 2
+#define TFM_RESIZE 3
+#define TFM_TOSPHERE 4
+#define TFM_SHEAR 5
+#define TFM_WARP 7
+#define TFM_SHRINKFATTEN 8
+#define TFM_TILT 9
+#define TFM_LAMP_ENERGY 10
+#define TFM_TRACKBALL 11
+#define TFM_PUSHPULL 12
+#define TFM_CREASE 13
+#define TFM_MIRROR 14
+#define TFM_BONESIZE 15
+#define TFM_BONE_ENVELOPE 16
+#define TFM_CURVE_SHRINKFATTEN 17
+#define TFM_BONE_ROLL 18
+#define TFM_TIME_TRANSLATE 19
+#define TFM_TIME_SLIDE 20
+#define TFM_TIME_SCALE 21
+#define TFM_TIME_EXTEND 22
+#define TFM_BAKE_TIME 23
+#define TFM_BEVEL 24
+#define TFM_BWEIGHT 25
+#define TFM_ALIGN 26
+
+/* TRANSFORM CONTEXTS */
+#define CTX_NONE 0
+#define CTX_TEXTURE 1
+#define CTX_EDGE 2
+#define CTX_NO_PET 4
+#define CTX_TWEAK 8
+#define CTX_NO_MIRROR 16
+#define CTX_AUTOCONFIRM 32
+#define CTX_BMESH 64
+#define CTX_NDOF 128
+
+/* Standalone call to get the transformation center corresponding to the current situation
+ * returns 1 if successful, 0 otherwise (usually means there's no selection)
+ * (if 0 is returns, *vec is unmodified)
+ * */
+int calculateTransformCenter(struct bContext *C, struct wmEvent *event, int centerMode, float *vec);
+
+struct TransInfo;
+struct ScrArea;
+struct Base;
+struct Scene;
+
+struct TransInfo * BIF_GetTransInfo(void);
+void BIF_setSingleAxisConstraint(float vec[3], char *text);
+void BIF_setDualAxisConstraint(float vec1[3], float vec2[3], char *text);
+void BIF_setLocalAxisConstraint(char axis, char *text);
+void BIF_setLocalLockConstraint(char axis, char *text);
+
+int BIF_snappingSupported(void);
+
+struct TransformOrientation;
+
+void BIF_clearTransformOrientation(void);
+void BIF_removeTransformOrientation(struct TransformOrientation *ts);
+void BIF_manageTransformOrientation(int confirm, int set);
+int BIF_menuselectTransformOrientation(void);
+void BIF_selectTransformOrientation(struct TransformOrientation *ts);
+void BIF_selectTransformOrientationFromIndex(int index);
+
+char * BIF_menustringTransformOrientation(char *title); /* the returned value was allocated and needs to be freed after use */
+int BIF_countTransformOrientation();
+
+/* Drawing callbacks */
+void BIF_drawConstraint(void);
+void BIF_drawPropCircle(void);
+void BIF_drawSnap(void);
+
+void BIF_getPropCenter(float *center);
+
+void BIF_TransformSetUndo(char *str);
+
+void BIF_selectOrientation(void);
+
+/* view3d manipulators */
+void initManipulator(int mode);
+void ManipulatorTransform();
+
+//int BIF_do_manipulator(struct ScrArea *sa);
+//void BIF_draw_manipulator(struct ScrArea *sa);
+
+#endif
+
Modified: branches/blender2.5/blender/source/blender/editors/include/ED_view3d.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/ED_view3d.h 2008-12-29 01:19:25 UTC (rev 18135)
+++ branches/blender2.5/blender/source/blender/editors/include/ED_view3d.h 2008-12-29 01:41:28 UTC (rev 18136)
@@ -29,8 +29,28 @@
#define ED_VIEW3D_H
/* ********* exports for space_view3d/ module ********** */
+struct ARegion;
+struct View3D;
+
float *give_cursor(Scene *scene, View3D *v3d);
+void initgrabz(struct View3D *v3d, float x, float y, float z);
+void window_to_3d(struct ARegion *ar, struct View3D *v3d, float *vec, short mx, short my);
+
+/* Projection */
+
+void project_short(struct ARegion *ar, struct View3D *v3d, float *vec, short *adr);
+void project_short_noclip(struct ARegion *ar, struct View3D *v3d, float *vec, short *adr);
+
+void project_int(struct ARegion *ar, struct View3D *v3d, float *vec, int *adr);
+void project_int_noclip(struct ARegion *ar, struct View3D *v3d, float *vec, int *adr);
+
+void project_float(struct ARegion *ar, struct View3D *v3d, float *vec, float *adr);
+void project_float_noclip(struct ARegion *ar, struct View3D *v3d, float *vec, float *adr);
+
+void viewline(struct ARegion *ar, struct View3D *v3d, short mval[2], float ray_start[3], float ray_end[3]);
+void viewray(struct ARegion *ar, struct View3D *v3d, short mval[2], float ray_start[3], float ray_normal[3]);
+
#endif /* ED_VIEW3D_H */
Modified: branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_intern.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_intern.h 2008-12-29 01:19:25 UTC (rev 18135)
+++ branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_intern.h 2008-12-29 01:41:28 UTC (rev 18136)
@@ -130,11 +130,7 @@
void VIEW3D_OT_smoothview(struct wmOperatorType *ot);
void view3d_operator_needs_opengl(const struct bContext *C);
-void viewline(ARegion *ar, View3D *v3d, short mval[2], float ray_start[3], float ray_end[3]);
-void viewray(ARegion *ar, View3D *v3d, short mval[2], float ray_start[3], float ray_normal[3]);
-void initgrabz(View3D *v3d, float x, float y, float z);
-void window_to_3d(ARegion *ar, View3D *v3d, float *vec, short mx, short my);
int boundbox_clip(View3D *v3d, float obmat[][4], struct BoundBox *bb);
void view3d_project_short_clip(ARegion *ar, View3D *v3d, float *vec, short *adr, float projmat[4][4], float wmat[4][4]);
@@ -143,13 +139,6 @@
void view3d_get_object_project_mat(View3D *v3d, struct Object *ob, float pmat[4][4], float vmat[4][4]);
void view3d_project_float(ARegion *ar, float *vec, float *adr, float mat[4][4]);
-void project_short(ARegion *ar, View3D *v3d, float *vec, short *adr);
-void project_int(ARegion *ar, View3D *v3d, float *vec, int *adr);
-void project_int_noclip(ARegion *ar, View3D *v3d, float *vec, int *adr);
-void project_short_noclip(ARegion *ar, View3D *v3d, float *vec, short *adr);
-void project_float(ARegion *ar, View3D *v3d, float *vec, float *adr);
-void project_float_noclip(ARegion *ar, View3D *v3d, float *vec, float *adr);
-
int get_view3d_viewplane(View3D *v3d, int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend, float *pixsize);
void view_settings_from_ob(Object *ob, float *ofs, float *quat, float *dist, float *lens);
void obmat_to_viewmat(View3D *v3d, Object *ob, short smooth);
Modified: branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_ops.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_ops.c 2008-12-29 01:19:25 UTC (rev 18135)
+++ branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_ops.c 2008-12-29 01:41:28 UTC (rev 18136)
@@ -46,6 +46,8 @@
#include "BKE_global.h"
#include "BKE_utildefines.h"
+#include "BIF_transform.h"
+
#include "RNA_access.h"
#include "RNA_define.h"
@@ -79,6 +81,8 @@
WM_operatortype_append(VIEW3D_OT_smoothview);
WM_operatortype_append(VIEW3D_OT_render_border);
WM_operatortype_append(VIEW3D_OT_cursor3d);
+
+ transform_operatortypes();
}
void view3d_keymap(wmWindowManager *wm)
@@ -136,5 +140,7 @@
/* TODO - this is just while we have no way to load a text datablock */
RNA_string_set(WM_keymap_add_item(keymap, "SCRIPT_OT_run_pyfile", PKEY, KM_PRESS, 0, 0)->ptr, "filename", "test.py");
+ transform_keymap_for_space(wm, keymap, SPACE_VIEW3D);
+
}
Modified: branches/blender2.5/blender/source/blender/editors/transform/Makefile
===================================================================
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list