[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23136] branches/bmesh/blender/source/ blender/blenkernel: finished edgesplit, from face angle option now works
Revision: 23136 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23136 Author: joeedh Date: 2009-09-12 08:47:59 +0200 (Sat, 12 Sep 2009) Log Message: --- finished edgesplit, from face angle option now works Modified Paths: -- branches/bmesh/blender/source/blender/blenkernel/BKE_mesh.h branches/bmesh/blender/source/blender/blenkernel/intern/mesh.c branches/bmesh/blender/source/blender/blenkernel/intern/modifier.c Modified: branches/bmesh/blender/source/blender/blenkernel/BKE_mesh.h === --- branches/bmesh/blender/source/blender/blenkernel/BKE_mesh.h 2009-09-12 05:06:28 UTC (rev 23135) +++ branches/bmesh/blender/source/blender/blenkernel/BKE_mesh.h 2009-09-12 06:47:59 UTC (rev 23136) @@ -65,6 +65,10 @@ struct CustomData *pdata, struct MVert *mvert, int totface, int totloop, int totpoly); +/*calculates a face normal.*/ +void mesh_calc_poly_normal(struct MPoly *mpoly, struct MLoop *loopstart, + struct MVert *mvarray, float *no); + void unlink_mesh(struct Mesh *me); void free_mesh(struct Mesh *me, int unlink); struct Mesh *add_mesh(char *name); Modified: branches/bmesh/blender/source/blender/blenkernel/intern/mesh.c === --- branches/bmesh/blender/source/blender/blenkernel/intern/mesh.c 2009-09-12 05:06:28 UTC (rev 23135) +++ branches/bmesh/blender/source/blender/blenkernel/intern/mesh.c 2009-09-12 06:47:59 UTC (rev 23136) @@ -71,6 +71,7 @@ #include "BLI_blenlib.h" #include "BLI_editVert.h" #include "BLI_arithb.h" +#include "BLI_cellalloc.h" #include "bmesh.h" @@ -79,6 +80,7 @@ return bmesh_to_editmesh(me->edit_btmesh->bm); } +void free_editMesh(EditMesh *em); void BKE_mesh_end_editmesh(Mesh *me, EditMesh *em) { BM_Free_Mesh(me->edit_btmesh->bm); @@ -1569,3 +1571,104 @@ return totface; } + +/* + * COMPUTE POLY NORMAL + * + * Computes the normal of a planar + * polygon See Graphics Gems for + * computing newell normal. + * +*/ +static void mesh_calc_ngon_normal(MPoly *mpoly, MLoop *loopstart, + MVert *mvert, float *normal) +{ + + MVert *v1, *v2, *v3; + double u[3], v[3], w[3]; + double n[3] = {0.0, 0.0, 0.0}, l; + int i, s=0; + + for(i = 0; i < mpoly->totloop; i++){ + v1 = mvert + loopstart[i].v; + v2 = mvert + loopstart[(i+1)%mpoly->totloop].v; + v3 = mvert + loopstart[(i+2)%mpoly->totloop].v; + + VECCOPY(u, v1->co); + VECCOPY(v, v2->co); + VECCOPY(w, v3->co); + + /*this fixes some weird numerical error*/ + if (i==0) { + u[0] += 0.0001f; + u[1] += 0.0001f; + u[2] += 0.0001f; + } + + /* newell's method + + so thats?: + (a[1] - b[1]) * (a[2] + b[2]); + a[1]*b[2] - b[1]*a[2] - b[1]*b[2] + a[1]*a[2] + + odd. half of that is the cross product. . .what's the + other half? + + also could be like a[1]*(b[2] + a[2]) - b[1]*(a[2] - b[2]) + */ + + n[0] += (u[1] - v[1]) * (u[2] + v[2]); + n[1] += (u[2] - v[2]) * (u[0] + v[0]); + n[2] += (u[0] - v[0]) * (u[1] + v[1]); + } + + l = n[0]*n[0]+n[1]*n[1]+n[2]*n[2]; + l = sqrt(l); + + if (l == 0.0) { + normal[0] = 0.0f; + normal[1] = 0.0f; + normal[2] = 1.0f; + + return; + } else l = 1.0f / l; + + n[0] *= l; + n[1] *= l; + n[2] *= l; + + normal[0] = (float) n[0]; + normal[1] = (float) n[1]; + normal[2] = (float) n[2]; + +} + +void mesh_calc_poly_normal(MPoly *mpoly, MLoop *loopstart, + MVert *mvarray, float *no) +{ + if(mpoly->totloop > 4) { + mesh_calc_ngon_normal(mpoly, loopstart, mvarray, no); + } + else if(mpoly->totloop == 3){ + MVert *v1, *v2, *v3; + + v1 = mvarray + (loopstart++)->v; + v2 = mvarray + (loopstart++)->v; + v3 = mvarray + loopstart->v; + CalcNormFloat(v1->co, v2->co, v3->co, no); + } + else if(mpoly->totloop == 4){ + MVert *v1, *v2, *v3, *v4; + + v1 = mvarray + (loopstart++)->v; + v2 = mvarray + (loopstart++)->v; + v3 = mvarray + (loopstart++)->v; + v4 = mvarray + loopstart->v; + CalcNormFloat4(v1->co, v2->co, v3->co, v4->co, no); + } + else{ /*horrible, two sided face!*/ + no[0] = 0.0; + no[1] = 0.0;
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23135] branches/blender2.5/blender/source /blender: 2.5 - More work on Axis-Angle Rotations
Revision: 23135 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23135 Author: aligorith Date: 2009-09-12 07:06:28 +0200 (Sat, 12 Sep 2009) Log Message: --- 2.5 - More work on Axis-Angle Rotations * Added a few new methods for axis-angle conversions, and used these instead of manually performing those steps elsewhere * Axis-angles to other representations now get their axes normalised to make sure that odd scaling doesn't occur. * Made a few more tools work with axis-angles properly Modified Paths: -- branches/blender2.5/blender/source/blender/blenkernel/intern/armature.c 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/animation/keyingsets.c branches/blender2.5/blender/source/blender/editors/armature/editarmature.c branches/blender2.5/blender/source/blender/editors/armature/poseobject.c branches/blender2.5/blender/source/blender/editors/transform/transform.c branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c branches/blender2.5/blender/source/blender/makesrna/intern/rna_pose.c Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/armature.c === --- branches/blender2.5/blender/source/blender/blenkernel/intern/armature.c 2009-09-12 04:03:26 UTC (rev 23134) +++ branches/blender2.5/blender/source/blender/blenkernel/intern/armature.c 2009-09-12 05:06:28 UTC (rev 23135) @@ -1993,7 +1993,7 @@ } else if (chan->rotmode == PCHAN_ROT_AXISANGLE) { /* axis-angle - stored in quaternion data, but not really that great for 3D-changing orientations */ - VecRotToMat3(&chan->quat[1], chan->quat[0], rmat); + AxisAngleToMat3(&chan->quat[1], chan->quat[0], rmat); } else { /* quats are normalised before use to eliminate scaling issues */ Modified: branches/blender2.5/blender/source/blender/blenlib/BLI_arithb.h === --- branches/blender2.5/blender/source/blender/blenlib/BLI_arithb.h 2009-09-12 04:03:26 UTC (rev 23134) +++ branches/blender2.5/blender/source/blender/blenlib/BLI_arithb.h 2009-09-12 05:06:28 UTC (rev 23135) @@ -342,8 +342,6 @@ void VecUpMat3old(float *vec, float mat[][3], short axis); void VecUpMat3(float *vec, float mat[][3], short axis); -void VecRotToMat3(float *vec, float phi, float mat[][3]); -void VecRotToMat4(float *vec, float phi, float mat[][4]); void VecCopyf(float *v1, float *v2); int VecLen(int *v1, int *v2); @@ -376,10 +374,23 @@ void Vec2Copyf(float *v1, float *v2); void Vec2Lerpf(float *target, float *a, float *b, float t); -void AxisAngleToQuat(float *q, float *axis, float angle); -void QuatToAxisAngle(float *q, float *axis, float *angle); +void AxisAngleToQuat(float q[4], float axis[3], float angle); +void QuatToAxisAngle(float q[4], float axis[3], float *angle); +void AxisAngleToEulO(float axis[3], float angle, float eul[3], short order); +void EulOToAxisAngle(float eul[3], short order, float axis[3], float *angle); +void AxisAngleToMat3(float axis[3], float angle, float mat[3][3]); +void AxisAngleToMat4(float axis[3], float angle, float mat[4][4]); +void Mat3ToAxisAngle(float mat[3][3], float axis[3], float *angle); +void Mat4ToAxisAngle(float mat[4][4], float axis[3], float *angle); + +void Mat3ToVecRot(float mat[3][3], float axis[3], float *angle); +void Mat4ToVecRot(float mat[4][4], float axis[3], float *angle); +void VecRotToMat3(float *vec, float phi, float mat[][3]); +void VecRotToMat4(float *vec, float phi, float mat[][4]); + void RotationBetweenVectorsToQuat(float *q, float v1[3], float v2[3]); void vectoquat(float *vec, short axis, short upflag, float *q); +void Mat3ToQuat_is_ok(float wmat[][3], float *q); void VecReflect(float *out, float *v1, float *v2); void VecBisect3(float *v, float *v1, float *v2, float *v3); @@ -460,8 +471,6 @@ short EenheidsMat(float mat[][3]); -void Mat3ToQuat_is_ok(float wmat[][3], float *q); - void i_ortho(float left, float right, float bottom, float top, float nearClip, float farClip, float matrix[][4]); void i_polarview(float dist, float azimuth, float incidence, float twist, float Vm[][4]); void i_translate(float Tx, float Ty, float Tz, float mat[][4]); Modified: branches/blender2.5/blender/source/blender/blenlib/intern/arithb.c === --- branches/blender2.5/blender/source/blender/blenlib/intern/arithb.c 2009-09-12 04:03:26 UTC (rev 23134) +++ branches/blender2.5/blender/source/blender/blenlib/intern/arithb.c 2009-09-12 05:06:28 UTC (rev 23135) @@ -3278,7 +3278,7 @@ /* AXIS ANGLE *** */ /* Axis angle
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23134] branches/bmesh/blender/source/ blender: some bugfixes, merge to cursor didn't work
Revision: 23134 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23134 Author: joeedh Date: 2009-09-12 06:03:26 +0200 (Sat, 12 Sep 2009) Log Message: --- some bugfixes, merge to cursor didn't work Modified Paths: -- branches/bmesh/blender/source/blender/blenkernel/intern/modifier.c branches/bmesh/blender/source/blender/editors/mesh/bmesh_tools.c branches/bmesh/blender/source/blender/makesrna/intern/rna_mesh.c Modified: branches/bmesh/blender/source/blender/blenkernel/intern/modifier.c === --- branches/bmesh/blender/source/blender/blenkernel/intern/modifier.c 2009-09-11 21:02:31 UTC (rev 23133) +++ branches/bmesh/blender/source/blender/blenkernel/intern/modifier.c 2009-09-12 04:03:26 UTC (rev 23134) @@ -2203,20 +2203,20 @@ BLI_mempool *vertuserpool; } MemBase; -static EdgeData *edge_get_next(EdgeData *e, int ov) { +BM_INLINE EdgeData *edge_get_next(EdgeData *e, int ov) { if (ov == e->v1) return e->v1node.next ? e->v1node.next->edge : NULL; else return e->v2node.next ? e->v2node.next->edge : NULL; } -static EdgeNode *edge_get_node(EdgeData *e, int ov) +BM_INLINE EdgeNode *edge_get_node(EdgeData *e, int ov) { if (ov == e->v1) return &e->v1node; else return &e->v2node; } -static VertUser *edge_get_vuser(MemBase *b, EdgeData *edge, int ov) +BM_INLINE VertUser *edge_get_vuser(MemBase *b, EdgeData *edge, int ov) { if (ov == edge->v1) return edge->v1user; @@ -2228,7 +2228,7 @@ } } -static void edge_set_vuser(MemBase *b, EdgeData *e, int ov, VertUser *vu) +BM_INLINE void edge_set_vuser(MemBase *b, EdgeData *e, int ov, VertUser *vu) { VertUser *olduser = edge_get_vuser(b, e, ov); @@ -2245,14 +2245,14 @@ else e->v2user = vu; } -static VertUser *new_vuser(MemBase *base) +BM_INLINE VertUser *new_vuser(MemBase *base) { VertUser *vusr = BLI_mempool_calloc(base->vertuserpool); return vusr; } -static MemBase *new_membase(void) +BM_INLINE MemBase *new_membase(void) { MemBase *b = MEM_callocN(sizeof(MemBase), "MemBase for edgesplit in modifier.c"); b->vertuserpool = BLI_mempool_create(sizeof(VertUser), 1, 2048); @@ -2260,13 +2260,13 @@ return b; } -static void free_membase(MemBase *b) +BM_INLINE void free_membase(MemBase *b) { BLI_mempool_destroy(b->vertuserpool); MEM_freeN(b); } -static EdgeData *edge_get_first(VertUser *vu) +BM_INLINE EdgeData *edge_get_first(VertUser *vu) { return vu->users.first ? ((EdgeNode*)vu->users.first)->edge : NULL; } Modified: branches/bmesh/blender/source/blender/editors/mesh/bmesh_tools.c === --- branches/bmesh/blender/source/blender/editors/mesh/bmesh_tools.c 2009-09-11 21:02:31 UTC (rev 23133) +++ branches/bmesh/blender/source/blender/editors/mesh/bmesh_tools.c 2009-09-12 04:03:26 UTC (rev 23134) @@ -2598,16 +2598,18 @@ return OPERATOR_FINISHED; } -static int merge_target(BMEditMesh *em, Scene *scene, View3D *v3d, +static int merge_target(BMEditMesh *em, Scene *scene, View3D *v3d, Object *ob, int target, int uvmerge, wmOperator *wmop) { BMIter iter; BMVert *v; - float *co, cent[3] = {0.0f, 0.0f, 0.0f}, fac; + float *vco, co[3], cent[3] = {0.0f, 0.0f, 0.0f}, fac; int i; if (target) { - co = give_cursor(scene, v3d); + vco = give_cursor(scene, v3d); + VECCOPY(co, vco); + Mat4MulVecfl(ob->imat, co); } else { i = 0; BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { @@ -2622,7 +2624,7 @@ fac = 1.0f / (float)i; VECMUL(cent, fac); - co = cent; + VECCOPY(co, cent); } if (!co) @@ -2649,10 +2651,10 @@ switch(RNA_enum_get(op->ptr, "type")) { case 3: - status = merge_target(em, scene, v3d, 0, uvs, op); + status = merge_target(em, scene, v3d, obedit, 0, uvs, op); break; case 4: - status = merge_target(em, scene, v3d, 1, uvs, op); + status = merge_target(em, scene, v3d, obedit, 1, uvs, op); break; case 1: status = merge_firstlast(em, 0, uvs, op); Modified: branches/bmesh/blender/source/blender/makesrna/intern/rna_mesh.c === --- branches/bmesh/blender/source/blender/makesrna/intern/rna_mesh.c 2009-09-11 21:02:31 UTC (rev 23133) +++ branches/bmesh/blender/source/blender/makesrna/intern/rna_mesh.c 2009-09-12 04:03:26 UT
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23133] branches/blender2.5/blender/source /blender/windowmanager/intern/wm_operators.c: 2.5
Revision: 23133 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23133 Author: dingto Date: 2009-09-11 23:02:31 +0200 (Fri, 11 Sep 2009) Log Message: --- 2.5 Revert some changes from commit 23090. Make sure you update SVN before you commit!! Modified Paths: -- branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c Modified: branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c === --- branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c 2009-09-11 20:06:09 UTC (rev 23132) +++ branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c 2009-09-11 21:02:31 UTC (rev 23133) @@ -803,7 +803,7 @@ WM_read_file(C, G.sce, op->reports); } else { - struct RecentFile *recent = BLI_findlink(&(G.recent_files), event-2); + struct RecentFile *recent = BLI_findlink(&(G.recent_files), event-1); if(recent) { WM_event_add_notifier(C, NC_WINDOW, NULL); WM_read_file(C, recent->filename, op->reports); @@ -831,11 +831,11 @@ EnumPropertyItem tmp = {0, "", 0, "", ""}; EnumPropertyItem *item= NULL; struct RecentFile *recent; - int totitem= 0, i, ofs= 0; + int totitem= 0, i; /* dynamically construct enum */ for(recent = G.recent_files.first, i=0; (inext, i++) { - tmp.value= i+ofs+1; + tmp.value= i+1; tmp.identifier= recent->filename; tmp.name= BLI_short_filename(recent->filename); RNA_enum_item_add(&item, &totitem, &tmp); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23132] branches/blender2.5/blender/source /blender/editors/screen/area.c: 2.5, Fix for bug #19296:
Revision: 23132 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23132 Author: blendix Date: 2009-09-11 22:06:09 +0200 (Fri, 11 Sep 2009) Log Message: --- 2.5, Fix for bug #19296: render window escape incorrectly opens file browser. Modified Paths: -- branches/blender2.5/blender/source/blender/editors/screen/area.c Modified: branches/blender2.5/blender/source/blender/editors/screen/area.c === --- branches/blender2.5/blender/source/blender/editors/screen/area.c 2009-09-11 18:31:51 UTC (rev 23131) +++ branches/blender2.5/blender/source/blender/editors/screen/area.c 2009-09-11 20:06:09 UTC (rev 23132) @@ -1034,7 +1034,12 @@ } #endif - ED_area_newspace(C, sa, sl->next->spacetype); + /* workaround for case of double prevspace, render window + with a file browser on top of it */ + if(sl->next->spacetype == SPACE_FILE && sl->next->next) + ED_area_newspace(C, sa, sl->next->next->spacetype); + else + ED_area_newspace(C, sa, sl->next->spacetype); } else { ED_area_newspace(C, sa, SPACE_INFO); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23131] branches/blender2.5/blender/ release/io/netrender/client.py: client code wasn' t modified to follow changes in the model
Revision: 23131 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23131 Author: theeth Date: 2009-09-11 20:31:51 +0200 (Fri, 11 Sep 2009) Log Message: --- client code wasn't modified to follow changes in the model Modified Paths: -- branches/blender2.5/blender/release/io/netrender/client.py Modified: branches/blender2.5/blender/release/io/netrender/client.py === --- branches/blender2.5/blender/release/io/netrender/client.py 2009-09-11 18:09:58 UTC (rev 23130) +++ branches/blender2.5/blender/release/io/netrender/client.py 2009-09-11 18:31:51 UTC (rev 23131) @@ -110,7 +110,7 @@ # if not ACCEPTED (but not processed), send files if response.status == http.client.ACCEPTED: - for filepath in job.files: + for filepath, start, end in job.files: f = open(filepath, "rb") conn.request("PUT", "file", f, headers={"job-id": job_id, "job-file": filepath}) f.close() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23129] branches/blender2.5/blender: curve twist
Revision: 23129 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23129 Author: campbellbarton Date: 2009-09-11 17:35:30 +0200 (Fri, 11 Sep 2009) Log Message: --- curve twist * added new twist method - "Tangent", suggested by Martin. the nice thing about this is its stable no matter how you rotate the data, rotation is local to each segment. * added smooth option that smooths the twisting (before applying user twist), to workaround Z-Up and Tangent's ugly curve twisting. Id prefer not to have this however it makes tangent much nicer. Possibly tangent can be improved some other way and this can be removed. A smooth value of 1.0 will iterate over and smooth the twisting by the resolution value of the spline. * Minimum-Twist method now corrects for cyclic twist by taking the roll difference between first and last, then increasingly counter rotate each segment over the entire curve. Previously it calculated from both directions and blended them. details * BevPoints use quats rather then 3x3 matrix. * added BevPoint direction "dir" and tangent "tan" used only for 3D curves. * don't calculate BevPoint->cosa, BevPoint->sina for 3D curves. * split bevel tilt calculation into functions. * nurbs curves currently don't generate tangents and wont work with tangent twist method. * some of the use of quats should be optimized. * smoothing is not animation safe, the higher the smoothing the higher the likelyhood of flipping. Modified Paths: -- branches/blender2.5/blender/release/ui/buttons_data_curve.py branches/blender2.5/blender/source/blender/blenkernel/BKE_utildefines.h branches/blender2.5/blender/source/blender/blenkernel/intern/curve.c branches/blender2.5/blender/source/blender/blenkernel/intern/displist.c branches/blender2.5/blender/source/blender/editors/space_view3d/drawobject.c branches/blender2.5/blender/source/blender/makesdna/DNA_curve_types.h branches/blender2.5/blender/source/blender/makesrna/intern/rna_curve.c Modified: branches/blender2.5/blender/release/ui/buttons_data_curve.py === --- branches/blender2.5/blender/release/ui/buttons_data_curve.py 2009-09-11 14:56:54 UTC (rev 23128) +++ branches/blender2.5/blender/release/ui/buttons_data_curve.py 2009-09-11 15:35:30 UTC (rev 23129) @@ -56,8 +56,7 @@ if not is_surf: row = layout.row() - row.itemR(curve, "curve_2d") - row.itemR(curve, "use_twist_correction") + row.itemR(curve, "curve_2d") split = layout.split() @@ -86,7 +85,12 @@ sub.itemR(curve, "resolution_v", text="Preview V") sub.itemR(curve, "render_resolution_v", text="Render V") + # XXX - put somewhere nicer. + row= layout.row() + row.itemR(curve, "twist_mode") + row.itemR(curve, "twist_smooth") # XXX - may not be kept + # col.itemL(text="Display:") # col.itemL(text="HANDLES") # col.itemL(text="NORMALS") Modified: branches/blender2.5/blender/source/blender/blenkernel/BKE_utildefines.h === --- branches/blender2.5/blender/source/blender/blenkernel/BKE_utildefines.h 2009-09-11 14:56:54 UTC (rev 23128) +++ branches/blender2.5/blender/source/blender/blenkernel/BKE_utildefines.h 2009-09-11 15:35:30 UTC (rev 23129) @@ -107,6 +107,7 @@ #define VECSUB(v1,v2,v3) {*(v1)= *(v2) - *(v3); *(v1+1)= *(v2+1) - *(v3+1); *(v1+2)= *(v2+2) - *(v3+2);} #define VECSUB2D(v1,v2,v3) {*(v1)= *(v2) - *(v3); *(v1+1)= *(v2+1) - *(v3+1);} #define VECADDFAC(v1,v2,v3,fac) {*(v1)= *(v2) + *(v3)*(fac); *(v1+1)= *(v2+1) + *(v3+1)*(fac); *(v1+2)= *(v2+2) + *(v3+2)*(fac);} +#define VECSUBFAC(v1,v2,v3,fac) {*(v1)= *(v2) - *(v3)*(fac); *(v1+1)= *(v2+1) - *(v3+1)*(fac); *(v1+2)= *(v2+2) - *(v3+2)*(fac);} #define QUATADDFAC(v1,v2,v3,fac) {*(v1)= *(v2) + *(v3)*(fac); *(v1+1)= *(v2+1) + *(v3+1)*(fac); *(v1+2)= *(v2+2) + *(v3+2)*(fac); *(v1+3)= *(v2+3) + *(v3+3)*(fac);} #define INPR(v1, v2) ( (v1)[0]*(v2)[0] + (v1)[1]*(v2)[1] + (v1)[2]*(v2)[2] ) Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/curve.c === --- branches/blender2.5/blender/source/blender/blenkernel/intern/curve.c 2009-09-11 14:56:54 UTC (rev 23128) +++ branches/blender2.5/blender/source/blender/blenkernel/intern/curve.c 2009-09-11 15:35:30 UTC (rev 23129) @@ -975,8 +975,27 @@ q1+= q2; q2+= q3; } -} +} +void forward_diff_bezier_cotangent(float *p0, float *p1, float *p2, float *p3, float *p,
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23128] branches/blender2.5/blender/source /blender: 2.5: fix for merge, forward_diff_bezier needed to be updated.
Revision: 23128 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23128 Author: blendix Date: 2009-09-11 16:56:54 +0200 (Fri, 11 Sep 2009) Log Message: --- 2.5: fix for merge, forward_diff_bezier needed to be updated. Modified Paths: -- branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c branches/blender2.5/blender/source/blender/editors/space_node/drawnode.c branches/blender2.5/blender/source/blender/python/generic/Geometry.c Modified: branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c === --- branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c 2009-09-11 14:31:05 UTC (rev 23127) +++ branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c 2009-09-11 14:56:54 UTC (rev 23128) @@ -1647,8 +1647,8 @@ vec[2][0]= vec[3][0]-dist; vec[2][1]= vec[3][1]; - forward_diff_bezier(vec[0][0], vec[1][0], vec[2][0], vec[3][0], coord_array[0], resol, 2); - forward_diff_bezier(vec[0][1], vec[1][1], vec[2][1], vec[3][1], coord_array[0]+1, resol, 2); + forward_diff_bezier(vec[0][0], vec[1][0], vec[2][0], vec[3][0], coord_array[0], resol, sizeof(float)*2); + forward_diff_bezier(vec[0][1], vec[1][1], vec[2][1], vec[3][1], coord_array[0]+1, resol, sizeof(float)*2); return 1; } Modified: branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c === --- branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c 2009-09-11 14:31:05 UTC (rev 23127) +++ branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c 2009-09-11 14:56:54 UTC (rev 23128) @@ -675,8 +675,8 @@ correct_bezpart(v1, v2, v3, v4); - forward_diff_bezier(v1[0], v2[0], v3[0], v4[0], data, resol, 3); - forward_diff_bezier(v1[1], v2[1], v3[1], v4[1], data+1, resol, 3); + forward_diff_bezier(v1[0], v2[0], v3[0], v4[0], data, resol, sizeof(float)*3); + forward_diff_bezier(v1[1], v2[1], v3[1], v4[1], data+1, resol, sizeof(float)*3); for (fp= data; resol; resol--, fp+= 3) glVertex2fv(fp); Modified: branches/blender2.5/blender/source/blender/editors/space_node/drawnode.c === --- branches/blender2.5/blender/source/blender/editors/space_node/drawnode.c 2009-09-11 14:31:05 UTC (rev 23127) +++ branches/blender2.5/blender/source/blender/editors/space_node/drawnode.c 2009-09-11 14:56:54 UTC (rev 23128) @@ -2598,8 +2598,8 @@ else { /* always do all three, to prevent data hanging around */ - forward_diff_bezier(vec[0][0], vec[1][0], vec[2][0], vec[3][0], coord_array[0], resol, 2); - forward_diff_bezier(vec[0][1], vec[1][1], vec[2][1], vec[3][1], coord_array[0]+1, resol, 2); + forward_diff_bezier(vec[0][0], vec[1][0], vec[2][0], vec[3][0], coord_array[0], resol, sizeof(float)*2); + forward_diff_bezier(vec[0][1], vec[1][1], vec[2][1], vec[3][1], coord_array[0]+1, resol, sizeof(float)*2); return 1; } Modified: branches/blender2.5/blender/source/blender/python/generic/Geometry.c === --- branches/blender2.5/blender/source/blender/python/generic/Geometry.c 2009-09-11 14:31:05 UTC (rev 23127) +++ branches/blender2.5/blender/source/blender/python/generic/Geometry.c 2009-09-11 14:56:54 UTC (rev 23128) @@ -523,7 +523,7 @@ coord_array = MEM_callocN(dims * (resolu) * sizeof(float), "BezierInterp"); for(i=0; ihttp://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23127] branches/blender2.5/blender/source /nan_link.mk: Added in runtime path for python since were using a dynamic lib.
Revision: 23127 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23127 Author: sirdude Date: 2009-09-11 16:31:05 +0200 (Fri, 11 Sep 2009) Log Message: --- Added in runtime path for python since were using a dynamic lib. (for Makefiles on linux) Kent Modified Paths: -- branches/blender2.5/blender/source/nan_link.mk Modified: branches/blender2.5/blender/source/nan_link.mk === --- branches/blender2.5/blender/source/nan_link.mk 2009-09-11 12:44:09 UTC (rev 23126) +++ branches/blender2.5/blender/source/nan_link.mk 2009-09-11 14:31:05 UTC (rev 23127) @@ -97,7 +97,7 @@ COMMENT = "MESA 3.1" LLIBS = -L$(NAN_MESA)/lib -L/usr/X11R6/lib -lXmu -lXext -lX11 -lXi LLIBS += -lutil -lc -lm -ldl -lpthread -LLIBS += -lpython$(NAN_PYTHON_VERSION) +LLIBS += -L$(NAN_PYTHON)/lib -Wl,-rpath -Wl,$(NAN_PYTHON)/lib -lpython$(NAN_PYTHON_VERSION) LOPTS = -export-dynamic DADD = -lGL -lGLU SADD = $(NAN_MESA)/lib/libGL.a $(NAN_MESA)/lib/libGLU.a ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23126] branches/blender2.5/blender/source /blender/editors: 2.5 - Rotation work (axis angle bugfixes + cleanups)
Revision: 23126 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23126 Author: aligorith Date: 2009-09-11 14:44:09 +0200 (Fri, 11 Sep 2009) Log Message: --- 2.5 - Rotation work (axis angle bugfixes + cleanups) * Made transform work better with axis-angle * Corrected the rotation-type handling code in a few places Modified Paths: -- branches/blender2.5/blender/source/blender/editors/armature/editarmature.c branches/blender2.5/blender/source/blender/editors/armature/poselib.c branches/blender2.5/blender/source/blender/editors/armature/poseobject.c branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_buttons.c branches/blender2.5/blender/source/blender/editors/transform/transform.c branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c Modified: branches/blender2.5/blender/source/blender/editors/armature/editarmature.c === --- branches/blender2.5/blender/source/blender/editors/armature/editarmature.c 2009-09-11 12:05:09 UTC (rev 23125) +++ branches/blender2.5/blender/source/blender/editors/armature/editarmature.c 2009-09-11 12:44:09 UTC (rev 23126) @@ -4856,9 +4856,13 @@ QUATCOPY(quat1, pchan->quat); QuatToEul(pchan->quat, oldeul); } + else if (pchan->rotmode == PCHAN_ROT_AXISANGLE) { + continue; // XXX + } else { VECCOPY(oldeul, pchan->eul); } + eul[0]= eul[1]= eul[2]= 0.0f; if (pchan->protectflag & OB_LOCK_ROTX) @@ -4875,6 +4879,9 @@ QuatMulf(pchan->quat, -1.0f); } } + else if (pchan->rotmode == PCHAN_ROT_AXISANGLE) { + // TODO... + } else { VECCOPY(pchan->eul, eul); } @@ -4884,6 +4891,11 @@ pchan->quat[1]=pchan->quat[2]=pchan->quat[3]= 0.0f; pchan->quat[0]= 1.0f; } + else if (pchan->rotmode == PCHAN_ROT_AXISANGLE) { + /* by default, make rotation of 0 radians around y-axis (roll) */ + pchan->quat[0]=pchan->quat[1]=pchan->quat[3]= 0.0f; + pchan->quat[2]= 1.0f; + } else { pchan->eul[0]= pchan->eul[1]= pchan->eul[2]= 0.0f; } Modified: branches/blender2.5/blender/source/blender/editors/armature/poselib.c === --- branches/blender2.5/blender/source/blender/editors/armature/poselib.c 2009-09-11 12:05:09 UTC (rev 23125) +++ branches/blender2.5/blender/source/blender/editors/armature/poselib.c 2009-09-11 12:44:09 UTC (rev 23126) @@ -278,8 +278,7 @@ /* * */ /* Pointers to the builtin KeyingSets that we want to use */ -static KeyingSet *poselib_ks_locrotscale = NULL; /* quaternion rotations */ -static KeyingSet *poselib_ks_locrotscale2 = NULL; /* euler rotations */ // XXX FIXME... +static KeyingSet *poselib_ks_locrotscale = NULL; /* the only keyingset we'll need*/ static short poselib_ks_need_init= 1; /* have the above been obtained yet? */ /* Make sure the builtin KeyingSets are initialised properly @@ -290,13 +289,9 @@ /* only if we haven't got these yet */ // FIXME: this assumes that we will always get the builtin sets... if (poselib_ks_need_init) { - /* LocRotScale (quaternions) */ + /* LocRotScale (quaternions or eulers depending on context) */ poselib_ks_locrotscale= ANIM_builtin_keyingset_get_named(NULL, "LocRotScale"); - /* LocRotScale (euler) */ - //ks_locrotscale2= ANIM_builtin_keyingset_get_named(ks_locrotscale, "LocRotScale"); - poselib_ks_locrotscale2= poselib_ks_locrotscale; // FIXME: for now, just use the same one... - /* clear flag requesting init */ poselib_ks_need_init= 0; } @@ -410,11 +405,8 @@ /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */ cks.pchan= pchan;
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23125] branches/blender2.5/blender: 2. 5 Rotations: As a experiment, enabling Axis-Angle for Bones
Revision: 23125 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23125 Author: aligorith Date: 2009-09-11 14:05:09 +0200 (Fri, 11 Sep 2009) Log Message: --- 2.5 Rotations: As a experiment, enabling Axis-Angle for Bones The support for this is really quite hacky, and I might disable this later if we cannot get some parts to work nicely. Some notes: * This is currently stored in the same variable that quaternions are stored in, since they both have 4 components. However, in RNA, I've added 2 properties specially for this. * There are some shearing issues using certain axes - i.e. (1,1,0) - that will need to be checked on. * Transform code is really quite temporary for this. Just a quick demo of what can be done... Modified Paths: -- branches/blender2.5/blender/release/ui/buttons_data_bone.py branches/blender2.5/blender/source/blender/blenkernel/intern/armature.c branches/blender2.5/blender/source/blender/editors/transform/transform.c branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c branches/blender2.5/blender/source/blender/makesrna/intern/rna_pose.c branches/blender2.5/blender/source/blender/windowmanager/intern/wm_files.c Modified: branches/blender2.5/blender/release/ui/buttons_data_bone.py === --- branches/blender2.5/blender/release/ui/buttons_data_bone.py 2009-09-11 11:52:56 UTC (rev 23124) +++ branches/blender2.5/blender/release/ui/buttons_data_bone.py 2009-09-11 12:05:09 UTC (rev 23125) @@ -58,6 +58,10 @@ col = row.column() if pchan.rotation_mode == 'QUATERNION': col.itemR(pchan, "rotation", text="Rotation") + elif pchan.rotation_mode == 'AXIS_ANGLE': + col.itemL(text="Rotation") + col.itemR(pchan, "rotation_angle", text="Angle") + col.itemR(pchan, "rotation_axis", text="Axis") else: col.itemR(pchan, "euler_rotation", text="Rotation") Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/armature.c === --- branches/blender2.5/blender/source/blender/blenkernel/intern/armature.c 2009-09-11 11:52:56 UTC (rev 23124) +++ branches/blender2.5/blender/source/blender/blenkernel/intern/armature.c 2009-09-11 12:05:09 UTC (rev 23125) @@ -1986,11 +1986,15 @@ /* get scaling matrix */ SizeToMat3(chan->size, smat); - /* rotations may either be quats or eulers (no rotation modes for now...) */ + /* rotations may either be quats, eulers (with various rotation orders), or axis-angle */ if (chan->rotmode > 0) { - /* euler rotations (will cause gimble lock... no rotation order to solve that yet) */ + /* euler rotations (will cause gimble lock, but this can be alleviated a bit with rotation orders) */ EulOToMat3(chan->eul, chan->rotmode, rmat); } + else if (chan->rotmode == PCHAN_ROT_AXISANGLE) { + /* axis-angle - stored in quaternion data, but not really that great for 3D-changing orientations */ + VecRotToMat3(&chan->quat[1], chan->quat[0], rmat); + } else { /* quats are normalised before use to eliminate scaling issues */ NormalQuat(chan->quat); Modified: branches/blender2.5/blender/source/blender/editors/transform/transform.c === --- branches/blender2.5/blender/source/blender/editors/transform/transform.c 2009-09-11 11:52:56 UTC (rev 23124) +++ branches/blender2.5/blender/source/blender/editors/transform/transform.c 2009-09-11 12:05:09 UTC (rev 23125) @@ -2663,7 +2663,7 @@ /* rotation */ if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't rotate objects itself - /* euler or quaternion? */ + /* euler or quaternion/axis-angle? */ if (td->flag & TD_USEQUAT) { Mat3MulSerie(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0); @@ -2672,6 +2672,15 @@ QuatMul(td->ext->quat, quat, td->ext->iquat); /* this function works on end result */ protectedQuaternionBits(td->protectflag, td->ext->quat, td->ext->iquat); + + /* if axis-angle, we now convert the quat representation to axis-angle again +* - this means that the math above is not totally correct, but it works well enough so far... +
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23124] branches/itasc/source/blender/ blenkernel/CMakeLists.txt: fix CMake
Revision: 23124 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23124 Author: ben2610 Date: 2009-09-11 13:52:56 +0200 (Fri, 11 Sep 2009) Log Message: --- fix CMake Modified Paths: -- branches/itasc/source/blender/blenkernel/CMakeLists.txt Modified: branches/itasc/source/blender/blenkernel/CMakeLists.txt === --- branches/itasc/source/blender/blenkernel/CMakeLists.txt 2009-09-11 10:21:54 UTC (rev 23123) +++ branches/itasc/source/blender/blenkernel/CMakeLists.txt 2009-09-11 11:52:56 UTC (rev 23124) @@ -30,7 +30,7 @@ . ../../../intern/guardedalloc ../../../intern/memutil ../editors/include ../blenlib ../makesdna ../render/extern/include ../../../intern/decimation/extern ../imbuf ../avi ../../../intern/elbeem/extern ../../../intern/opennl/extern - ../../../intern/iksolver/extern ../blenloader + ../../../intern/iksolver/extern ../blenloader ../ikplugin ../nodes ../../../extern/glew/include ../gpu ../makesrna ../../../intern/smoke/extern ../../../intern/bsp/extern ../blenfont ../../../intern/audaspace/intern ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23123] branches/bmesh/blender/source/ blender: rewrote edge split modifier to be simpler and hopefully faster.
Revision: 23123 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23123 Author: joeedh Date: 2009-09-11 12:21:54 +0200 (Fri, 11 Sep 2009) Log Message: --- rewrote edge split modifier to be simpler and hopefully faster. and of course it handles ngons properly now. Modified Paths: -- branches/bmesh/blender/source/blender/blenkernel/BKE_cdderivedmesh.h branches/bmesh/blender/source/blender/blenkernel/BKE_utildefines.h branches/bmesh/blender/source/blender/blenkernel/intern/cdderivedmesh.c branches/bmesh/blender/source/blender/blenkernel/intern/modifier.c branches/bmesh/blender/source/blender/bmesh/operators/mesh_conv.c Modified: branches/bmesh/blender/source/blender/blenkernel/BKE_cdderivedmesh.h === --- branches/bmesh/blender/source/blender/blenkernel/BKE_cdderivedmesh.h 2009-09-11 09:13:25 UTC (rev 23122) +++ branches/bmesh/blender/source/blender/blenkernel/BKE_cdderivedmesh.h 2009-09-11 10:21:54 UTC (rev 23123) @@ -93,9 +93,14 @@ /* calculates edges for a CDDerivedMesh (from face data) * this completely replaces the current edge data in the DerivedMesh + * builds edges from the tesselated face data. */ void CDDM_calc_edges(struct DerivedMesh *dm); +/* same as CDDM_calc_edges only makes edges from ngon faces instead of tesselation + faces*/ +void CDDM_calc_edges_poly(struct DerivedMesh *dm); + /* lowers the number of vertices/edges/faces in a CDDerivedMesh * the layer data stays the same size */ @@ -124,5 +129,14 @@ struct MLoop *CDDM_get_loops(struct DerivedMesh *dm); struct MPoly *CDDM_get_faces(struct DerivedMesh *dm); +/*Assigns news m*** layers to the cddm. Note that you must handle + freeing the old ones yourself. Also you must ensure dm->numData + is correct.*/ +void CDDM_set_mvert(struct DerivedMesh *dm, struct MVert *mvert); +void CDDM_set_medge(struct DerivedMesh *dm, struct MEdge *medge); +void CDDM_set_mface(struct DerivedMesh *dm, struct MFace *mface); +void CDDM_set_mloop(struct DerivedMesh *dm, struct MLoop *mloop); +void CDDM_set_mpoly(struct DerivedMesh *dm, struct MPoly *mpoly); + #endif Modified: branches/bmesh/blender/source/blender/blenkernel/BKE_utildefines.h === --- branches/bmesh/blender/source/blender/blenkernel/BKE_utildefines.h 2009-09-11 09:13:25 UTC (rev 23122) +++ branches/bmesh/blender/source/blender/blenkernel/BKE_utildefines.h 2009-09-11 10:21:54 UTC (rev 23123) @@ -235,10 +235,14 @@ _##vec##_count++) #define V_FREE(vec) if (vec) MEM_freeN(vec); + /*resets the logical size of an array to zero, but doesn't free the memory.*/ #define V_RESET(vec) _##vec##_count=0 +/*set the count of the array*/ +#define V_SETCOUNT(vec, count) _##vec##_count = (count) + /*little macro so inline keyword works*/ #if defined(_MSC_VER) #define BM_INLINE static __forceinline Modified: branches/bmesh/blender/source/blender/blenkernel/intern/cdderivedmesh.c === --- branches/bmesh/blender/source/blender/blenkernel/intern/cdderivedmesh.c 2009-09-11 09:13:25 UTC (rev 23122) +++ branches/bmesh/blender/source/blender/blenkernel/intern/cdderivedmesh.c 2009-09-11 10:21:54 UTC (rev 23123) @@ -1620,6 +1620,83 @@ BLI_edgehash_free(eh, NULL); } + +void CDDM_calc_edges_poly(DerivedMesh *dm) +{ + CDDerivedMesh *cddm = (CDDerivedMesh*)dm; + CustomData edgeData; + EdgeHashIterator *ehi; + MPoly *mp = cddm->mpoly; + MLoop *ml; + MEdge *med; + EdgeHash *eh = BLI_edgehash_new(); + int v1, v2; + int *eindex; + int i, j, k, *index, numEdges = cddm->dm.numEdgeData, maxFaces = dm->numPolyData; + + eindex = DM_get_edge_data_layer(dm, CD_ORIGINDEX); + + med = cddm->medge; + if (med) { + for (i=0; i < numEdges; i++, med++) { + BLI_edgehash_insert(eh, med->v1, med->v2, SET_INT_IN_POINTER(i+1)); + } + } + + for (i=0; i < maxFaces; i++, mp++) { + ml = cddm->mloop + mp->loopstart; + for (j=0; jtotloop; j++, ml++) { + v1 = ml->v; + v2 = (cddm->mloop + mp->loopstart + ((j+1)%mp->totloop))->v; + if (!BLI_edgehash_haskey(eh, v1, v2)) { + BLI_edgehash_insert(eh, v1, v2, NULL); + } + } + } + + k = numEdges; + numEdges = BLI_edgehash_size(eh); + + /* write new edges into a temporary CustomData */ + memset(&edgeData, 0, sizeof(edgeData)); + CustomData_add_layer(&edgeData, CD_MEDGE, CD_CALLOC, NULL, numEdges); + CustomData_add_layer(&edgeData, CD_ORIGINDEX, CD_CALLOC, NULL, numEdges); + + ehi = BLI_edgehashIte
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23122] branches/itasc/source/blender: BGE : don't use fixed number of substep.
Revision: 23122 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23122 Author: ben2610 Date: 2009-09-11 11:13:25 +0200 (Fri, 11 Sep 2009) Log Message: --- BGE: don't use fixed number of substep. It doesn't make sense since the duration of frame is variable. Instead, convert the number of substeps into a target substep duration when creating the iTaSC scene. Modified Paths: -- branches/itasc/source/blender/ikplugin/intern/itasc_plugin.cpp branches/itasc/source/blender/makesdna/DNA_action_types.h Modified: branches/itasc/source/blender/ikplugin/intern/itasc_plugin.cpp === --- branches/itasc/source/blender/ikplugin/intern/itasc_plugin.cpp 2009-09-11 09:09:54 UTC (rev 23121) +++ branches/itasc/source/blender/ikplugin/intern/itasc_plugin.cpp 2009-09-11 09:13:25 UTC (rev 23122) @@ -675,7 +675,7 @@ iktarget->blenderConstraint->lin_error = (float)(values->values[0].y - values->values[0].yd); } -static IK_Scene* convert_tree(Object *ob, bPoseChannel *pchan) +static IK_Scene* convert_tree(Scene *blscene, Object *ob, bPoseChannel *pchan) { PoseTree *tree = (PoseTree*)pchan->iktree.first; PoseTarget *target; @@ -709,8 +709,23 @@ if (!ingame) ikscene->cache = new iTaSC::Cache(); ikparam = (bItasc*)ob->pose->ikparam; - if (!ikparam) + if (!ikparam) { + // you must have our own copy ikparam = &DefIKParam; + } else if (ingame) { + // tweak the param when in game to have efficient stepping + // using fixed substep is not effecient since frames in the GE are often + // shorter than in animation => move to auto step automatically and set + // the target substep duration via min/max + if (!(ikparam->flag & ITASC_AUTO_STEP)) { + float timestep = blscene->r.frs_sec_base/blscene->r.frs_sec; + if (ikparam->numstep > 0) + timestep /= ikparam->numstep; + // with equal min and max, the algorythm will take this step and the indicative substep most of the time + ikparam->minstep = ikparam->maxstep = timestep; + ikparam->flag |= ITASC_AUTO_STEP; + } + } switch (ikparam->solver) { case ITASC_SOLVER_SDLS: ikscene->solver = new iTaSC::WSDLSSolver(); @@ -1160,21 +1175,21 @@ return ikscene; } -static void create_scene(Object *ob) +static void create_scene(Scene *scene, Object *ob) { bPoseChannel *pchan; - // create the scene + // create the IK scene for(pchan= (bPoseChannel *)ob->pose->chanbase.first; pchan; pchan= (bPoseChannel *)pchan->next) { // by construction there is only one tree PoseTree *tree = (PoseTree*)pchan->iktree.first; if (tree) { // convert tree in iTaSC::Scene - IK_Scene* scene = convert_tree(ob, pchan); - if (scene) { + IK_Scene* ikscene = convert_tree(scene, ob, pchan); + if (ikscene) { IK_Data* ikdata = get_ikdata(ob->pose); - scene->next = ikdata->first; - ikdata->first = scene; + ikscene->next = ikdata->first; + ikdata->first = ikscene; } // delete the trees once we are done while(tree) { @@ -1350,7 +1365,7 @@ } // if at least one tree, create the scenes from the PoseTree stored in the channels if (count) - create_scene(ob); + create_scene(scene, ob); itasc_update_param(ob->pose); // make sure we don't rebuilt until the user changes something important ob->pose->flag &= ~POSE_WAS_REBUILT; Modified: branches/itasc/source/blender/makesdna/DNA_action_types.h === --- branches/itasc/source/blender/makesdna/DNA_action_types.h 2009-09-11 09:09:54 UTC (rev 23121) +++ branches/itasc/source/blender/makesdna/DNA_action_types.h 2009-09-11 09:13:25 UTC (rev 23122) @@ -210,7 +210,7 @@ /* NOTE: space is reserved here for 18 other possible * euler rotation orders not implemented */ - PCHAN_ROT_MAX, /* sentinel */ + PCHAN_ROT_MAX, /* sentinel for Py API*/ /* axis angle rotations */ PCHAN_ROT_AXISANGLE = -1 } ePchan_RotMode; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-bl
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23121] branches/blender2.5/blender: 2.5: Two Bugfixes
Revision: 23121 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23121 Author: aligorith Date: 2009-09-11 11:09:54 +0200 (Fri, 11 Sep 2009) Log Message: --- 2.5: Two Bugfixes * Mesh Deform modifier now correctly shows Bind/Unbind buttons. Previously, only Bind got shown... * Selecting keyframes in the Graph Editor using Border Select now allows the keyframes to be editable afterwards. Previously, the curves weren't getting selected afterwards, therefore, the poll operators would skip those curves. Modified Paths: -- branches/blender2.5/blender/release/ui/buttons_data_modifier.py branches/blender2.5/blender/source/blender/editors/space_graph/graph_select.c branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c Modified: branches/blender2.5/blender/release/ui/buttons_data_modifier.py === --- branches/blender2.5/blender/release/ui/buttons_data_modifier.py 2009-09-11 03:00:09 UTC (rev 23120) +++ branches/blender2.5/blender/release/ui/buttons_data_modifier.py 2009-09-11 09:09:54 UTC (rev 23121) @@ -242,10 +242,13 @@ layout.itemS() - layout.itemO("object.meshdeform_bind", text="Bind") - row = layout.row() - row.itemR(md, "precision") - row.itemR(md, "dynamic") + if md.is_bound: + layout.itemO("object.meshdeform_bind", text="Unbind") + else: + layout.itemO("object.meshdeform_bind", text="Bind") + row = layout.row() + row.itemR(md, "precision") + row.itemR(md, "dynamic") def MIRROR(self, layout, ob, md): layout.itemR(md, "merge_limit") Modified: branches/blender2.5/blender/source/blender/editors/space_graph/graph_select.c === --- branches/blender2.5/blender/source/blender/editors/space_graph/graph_select.c 2009-09-11 03:00:09 UTC (rev 23120) +++ branches/blender2.5/blender/source/blender/editors/space_graph/graph_select.c 2009-09-11 09:09:54 UTC (rev 23121) @@ -234,6 +234,7 @@ /* loop over data, doing border select */ for (ale= anim_data.first; ale; ale= ale->next) { AnimData *adt= ANIM_nla_mapping_get(ac, ale); + FCurve *fcu= (FCurve *)ale->key_data; /* set horizontal range (if applicable) */ if (mode != BEZT_OK_VALUERANGE) { @@ -253,7 +254,13 @@ } /* select keyframes that are in the appropriate places */ - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keys_bezier_loop(&bed, fcu, ok_cb, select_cb, NULL); + + /* select the curve too +* NOTE: this should really only happen if the curve got touched... +*/ + if (selectmode == SELECT_ADD) + fcu->flag |= FCURVE_SELECTED; } /* cleanup */ Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c === --- branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c 2009-09-11 03:00:09 UTC (rev 23120) +++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c 2009-09-11 09:09:54 UTC (rev 23121) @@ -384,6 +384,11 @@ modifier_object_set(&((ArrayModifierData*)ptr->data)->curve_ob, OB_CURVE, value); } +static int rna_MeshDeformModifier_is_bound_get(PointerRNA *ptr) +{ + return (((MeshDeformModifierData*)ptr->data)->bindcos != NULL); +} + static PointerRNA rna_SoftBodyModifier_settings_get(PointerRNA *ptr) { Object *ob= (Object*)ptr->id.data; @@ -1368,7 +1373,12 @@ RNA_def_property_pointer_funcs(prop, NULL, "rna_MeshDeformModifier_object_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); - + + prop= RNA_def_property(srna, "is_bound", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_MeshDeformModifier_is_bound_get", NULL); + RNA_def_property_ui_text(prop, "Bound", "Whether geometry has been bound to control cage."); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence."); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blen