[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23578] trunk/blender/source/blender/ makesrna/intern/rna_camera.c: * Added proper update/ conversions for changing between degrees and "mm" in camera
Revision: 23578 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23578 Author: broken Date: 2009-10-01 06:14:43 +0200 (Thu, 01 Oct 2009) Log Message: --- * Added proper update/conversions for changing between degrees and "mm" in camera Modified Paths: -- trunk/blender/source/blender/makesrna/intern/rna_camera.c Modified: trunk/blender/source/blender/makesrna/intern/rna_camera.c === --- trunk/blender/source/blender/makesrna/intern/rna_camera.c 2009-09-30 23:31:10 UTC (rev 23577) +++ trunk/blender/source/blender/makesrna/intern/rna_camera.c 2009-10-01 04:14:43 UTC (rev 23578) @@ -22,7 +22,9 @@ * * END GPL LICENSE BLOCK * */ +#define _USE_MATH_DEFINES #include +#include #include "RNA_define.h" #include "RNA_types.h" @@ -35,6 +37,19 @@ #ifdef RNA_RUNTIME +static void rna_Camera_angle_update(bContext *C, PointerRNA *ptr) +{ + Camera *cam= (Camera*)ptr->id.data; + cam->lens = 16.0f / tan(M_PI*cam->angle/360.0f); +} + +static void rna_Camera_lens_update(bContext *C, PointerRNA *ptr) +{ + Camera *cam= (Camera*)ptr->id.data; + cam->angle= 360.0f * atan(16.0f/cam->lens) / M_PI; +} + + #else void RNA_def_camera(BlenderRNA *brna) @@ -72,7 +87,7 @@ RNA_def_property_float_sdna(prop, NULL, "angle"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Angle", "Perspective Camera lend field of view in degrees."); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_angle_update"); prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clipsta"); @@ -90,7 +105,7 @@ RNA_def_property_float_sdna(prop, NULL, "lens"); RNA_def_property_range(prop, 1.0f, 250.0f); RNA_def_property_ui_text(prop, "Lens", "Perspective Camera lens value in mm."); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_lens_update"); prop= RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ortho_scale"); ___ 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 [23577] trunk/blender/source/blender/ blenkernel/intern: Use curve twist for the CurveDeform modifier and bones ( anything that uses curve_deform_vert
Revision: 23577 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23577 Author: campbellbarton Date: 2009-10-01 01:31:10 +0200 (Thu, 01 Oct 2009) Log Message: --- Use curve twist for the CurveDeform modifier and bones (anything that uses curve_deform_verts() and curve_deform_vector()). So means minimum twist and twist smoothing are now used. the Z up quaternion from the path is rotated to match the up axis given. There was no logical rule for the up vector, some cases flipped the normals when used with the CurveDeform modifier. Use the default X-Up behavior and match other settings with this. (comments explain this in detail). - Interpolating quaternions didn't work in some cases, disabled for now. - 'no_rot_axis' is different from in 2.4x since it now removes rotation from the tilt whereas before it edited the axis before calculating the tilt. Modified Paths: -- trunk/blender/source/blender/blenkernel/intern/anim.c trunk/blender/source/blender/blenkernel/intern/lattice.c Modified: trunk/blender/source/blender/blenkernel/intern/anim.c === --- trunk/blender/source/blender/blenkernel/intern/anim.c 2009-09-30 22:58:34 UTC (rev 23576) +++ trunk/blender/source/blender/blenkernel/intern/anim.c 2009-09-30 23:31:10 UTC (rev 23577) @@ -280,17 +280,27 @@ if (quat) { float totfac, q1[4], q2[4]; + /* checks for totfac are needed when 'fac' is 1.0 key_curve_position_weights can assign zero +* to more then one index in data which can give divide by zero error */ +/* totfac= data[0]+data[1]; - QuatInterpol(q1, p0->quat, p1->quat, data[0] / totfac); + if(totfac>0.01) QuatInterpol(q1, p0->quat, p1->quat, data[0] / totfac); + elseQUATCOPY(q1, p1->quat); + NormalQuat(q1); totfac= data[2]+data[3]; - QuatInterpol(q2, p2->quat, p3->quat, data[2] / totfac); + if(totfac>0.01) QuatInterpol(q2, p2->quat, p3->quat, data[2] / totfac); + elseQUATCOPY(q1, p3->quat); NormalQuat(q2); totfac = data[0]+data[1]+data[2]+data[3]; - QuatInterpol(quat, q1, q2, (data[0]+data[1]) / totfac); + if(totfac>0.01) QuatInterpol(quat, q1, q2, (data[0]+data[1]) / totfac); + elseQUATCOPY(quat, q2); NormalQuat(quat); + */ + // XXX - find some way to make quat interpolation work correctly, above code fails in rare but nasty cases. + QUATCOPY(quat, p1->quat); } if(radius) Modified: trunk/blender/source/blender/blenkernel/intern/lattice.c === --- trunk/blender/source/blender/blenkernel/intern/lattice.c2009-09-30 22:58:34 UTC (rev 23576) +++ trunk/blender/source/blender/blenkernel/intern/lattice.c2009-09-30 23:31:10 UTC (rev 23577) @@ -524,30 +524,13 @@ static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, CurveDeform *cd, float *quatp) { Curve *cu= par->data; - float fac, loc[4], dir[3], cent[3], radius; - short upflag, index; - - if(axis==MOD_CURVE_POSX || axis==MOD_CURVE_NEGX) { - upflag= OB_POSZ; - cent[0]= 0.0; - cent[1]= co[1]; - cent[2]= co[2]; - index= 0; - } - else if(axis==MOD_CURVE_POSY || axis==MOD_CURVE_NEGY) { - upflag= OB_POSZ; - cent[0]= co[0]; - cent[1]= 0.0; - cent[2]= co[2]; - index= 1; - } - else { - upflag= OB_POSY; - cent[0]= co[0]; - cent[1]= co[1]; - cent[2]= 0.0; - index= 2; - } + float fac, loc[4], dir[3], new_quat[4], radius; + short /*upflag, */ index; + + index= axis-1; + if(index>2) + index -= 3; /* negative */ + /* to be sure, mostly after file load */ if(cu->path==NULL) { makeDispListCurveTypes(scene, par, 0); @@ -555,7 +538,7 @@ } /* options */ - if(ELEM3(axis, OB_NEGX, OB_NEGY, OB_NEGZ)) { + if(ELEM3(axis, OB_NEGX+1, OB_NEGY+1, OB_NEGZ+1)) { /* OB_NEG# 0-5, MOD_CURVE_POS# 1-6 */ if(cu->flag & CU_STRETCH) fac= (-co[index]-cd->dmax[index])/(cd->dmax[index] - cd->dmin[index]); else @@ -579,9 +562,10 @@ } #endif // XXX old animation system - if( where_on_path_deform(par, fac, loc, dir, NULL, &radius)) { /* returns OK */ - float q[4], mat[3][3]
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23576] trunk/blender/release/scripts/ui/ buttons_physics_common.py: SVN maintenance.
Revision: 23576 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23576 Author: gsrb3d Date: 2009-10-01 00:58:34 +0200 (Thu, 01 Oct 2009) Log Message: --- SVN maintenance. Modified Paths: -- trunk/blender/release/scripts/ui/buttons_physics_common.py Property Changed: trunk/blender/release/scripts/ui/buttons_physics_common.py Modified: trunk/blender/release/scripts/ui/buttons_physics_common.py === --- trunk/blender/release/scripts/ui/buttons_physics_common.py 2009-09-30 22:57:58 UTC (rev 23575) +++ trunk/blender/release/scripts/ui/buttons_physics_common.py 2009-09-30 22:58:34 UTC (rev 23576) @@ -1,153 +1,153 @@ -import bpy - -def point_cache_ui(self, cache, enabled, particles, smoke): - layout = self.layout - layout.set_context_pointer("PointCache", cache) - - row = layout.row() - row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2 ) - col = row.column(align=True) - col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") - col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") - - row = layout.row() - row.itemL(text="File Name:") - if particles: - row.itemR(cache, "external") - - if cache.external: - split = layout.split(percentage=0.80) - split.itemR(cache, "name", text="") - split.itemR(cache, "index", text="") - - layout.itemL(text="File Path:") - layout.itemR(cache, "filepath", text="") - - layout.itemL(text=cache.info) - else: - layout.itemR(cache, "name", text="") - - if not particles: - row = layout.row() - row.enabled = enabled - row.itemR(cache, "start_frame") - row.itemR(cache, "end_frame") - - row = layout.row() - - if cache.baked == True: - row.itemO("ptcache.free_bake", text="Free Bake") - else: - row.item_booleanO("ptcache.bake", "bake", True, text="Bake") - - sub = row.row() - sub.enabled = (cache.frames_skipped or cache.outdated) and enabled - sub.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame") - - row = layout.row() - row.enabled = enabled - row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake") - if not smoke: - row.itemR(cache, "step"); - - if not smoke: - row = layout.row() - sub = row.row() - sub.enabled = enabled - sub.itemR(cache, "quick_cache") - row.itemR(cache, "disk_cache") - - layout.itemL(text=cache.info) - - layout.itemS() - - row = layout.row() - row.item_booleanO("ptcache.bake_all", "bake", True, text="Bake All Dynamics") - row.itemO("ptcache.free_bake_all", text="Free All Bakes") - layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame") - -def effector_weights_ui(self, weights): - layout = self.layout - - layout.itemR(weights, "group") - - split = layout.split() - split.itemR(weights, "gravity", slider=True) - split.itemR(weights, "all", slider=True) - - layout.itemS() - - flow = layout.column_flow() - flow.itemR(weights, "spherical", slider=True) - flow.itemR(weights, "vortex", slider=True) - flow.itemR(weights, "magnetic", slider=True) - flow.itemR(weights, "wind", slider=True) - flow.itemR(weights, "curveguide", slider=True) - flow.itemR(weights, "texture", slider=True) - flow.itemR(weights, "harmonic", slider=True) - flow.itemR(weights, "charge", slider=True) - flow.itemR(weights, "lennardjones", slider=True) - flow.itemR(weights, "turbulence", slider=True) - flow.itemR(weights, "drag", slider=True) - flow.itemR(weights, "boid", slider=True) - -def basic_force_field_settings_ui(self, field): - layout = self.layout - split = layout.split() - - if not field or field.type == 'NONE': - return - - col = split.column() - - if field.type ==
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23575] trunk/blender/source/blender/ blenkernel: Fixing a compile error from last commit and some warnings that msvc didn' t care to let me know abou
Revision: 23575 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23575 Author: jhk Date: 2009-10-01 00:57:58 +0200 (Thu, 01 Oct 2009) Log Message: --- Fixing a compile error from last commit and some warnings that msvc didn't care to let me know about. Modified Paths: -- trunk/blender/source/blender/blenkernel/BKE_effect.h trunk/blender/source/blender/blenkernel/intern/depsgraph.c trunk/blender/source/blender/blenkernel/intern/effect.c trunk/blender/source/blender/blenkernel/intern/particle.c Modified: trunk/blender/source/blender/blenkernel/BKE_effect.h === --- trunk/blender/source/blender/blenkernel/BKE_effect.h2009-09-30 22:10:14 UTC (rev 23574) +++ trunk/blender/source/blender/blenkernel/BKE_effect.h2009-09-30 22:57:58 UTC (rev 23575) @@ -41,6 +41,9 @@ struct Particle; struct Group; struct RNG; +struct ParticleSimulationData; +struct ParticleData; +struct ParticleKey; struct EffectorWeights *BKE_add_effector_weights(struct Group *group); struct PartDeflect *object_add_collision_fields(int type); Modified: trunk/blender/source/blender/blenkernel/intern/depsgraph.c === --- trunk/blender/source/blender/blenkernel/intern/depsgraph.c 2009-09-30 22:10:14 UTC (rev 23574) +++ trunk/blender/source/blender/blenkernel/intern/depsgraph.c 2009-09-30 22:57:58 UTC (rev 23575) @@ -559,7 +559,6 @@ for(; psys; psys=psys->next) { BoidRule *rule = NULL; BoidState *state = NULL; - ParticleSimulationData sim = {scene, ob, psys, NULL, NULL}; ParticleSettings *part= psys->part; ListBase *effectors = NULL; EffectorCache *eff; Modified: trunk/blender/source/blender/blenkernel/intern/effect.c === --- trunk/blender/source/blender/blenkernel/intern/effect.c 2009-09-30 22:10:14 UTC (rev 23574) +++ trunk/blender/source/blender/blenkernel/intern/effect.c 2009-09-30 22:57:58 UTC (rev 23575) @@ -819,7 +819,7 @@ RNG *rng = pd->rng; float force[3]={0,0,0}; float temp[3]; - float noise = 0, fac; + float fac; float strength = pd->f_strength; float damp = pd->f_damp; float noise_factor = pd->f_noise; @@ -970,7 +970,7 @@ */ EffectorCache *eff; EffectorData efd; - int i=0, p=0, tot = 1; + int p=0, tot = 1; /* Cycle through collected objects, get total of (1/(gravity_strength * dist^gravity_power)) */ /* Check for min distance here? (yes would be cool to add that, ton) */ Modified: trunk/blender/source/blender/blenkernel/intern/particle.c === --- trunk/blender/source/blender/blenkernel/intern/particle.c 2009-09-30 22:10:14 UTC (rev 23574) +++ trunk/blender/source/blender/blenkernel/intern/particle.c 2009-09-30 22:57:58 UTC (rev 23575) @@ -1960,11 +1960,11 @@ if(pd->flag & PFIELD_GUIDE_PATH_ADD) { if(where_on_path(eff->ob, data->strength * guidetime, guidevec, guidedir, NULL, &radius)==0) - return; + return 0; } else { if(where_on_path(eff->ob, guidetime, guidevec, guidedir, NULL, &radius)==0) - return; + return 0; } Mat4MulVecfl(eff->ob->obmat, guidevec); ___ 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 [23574] trunk/blender: Unified effector functionality for particles, cloth and softbody
Revision: 23574 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23574 Author: jhk Date: 2009-10-01 00:10:14 +0200 (Thu, 01 Oct 2009) Log Message: --- Unified effector functionality for particles, cloth and softbody * Unified scene wide gravity (currently in scene buttons) instead of each simulation having it's own gravity. * Weight parameters for all effectors and an effector group setting. * Every effector can use noise. * Most effectors have "shapes" point, plane, surface, every point. - "Point" is most like the old effectors and uses the effector location as the effector point. - "Plane" uses the closest point on effectors local xy-plane as the effector point. - "Surface" uses the closest point on an effector object's surface as the effector point. - "Every Point" uses every point in a mesh effector object as an effector point. - The falloff is calculated from this point, so for example with "surface" shape and "use only negative z axis" it's possible to apply force only "inside" the effector object. * Spherical effector is now renamed as "force" as it's no longer just spherical. * New effector parameter "flow", which makes the effector act as surrounding air velocity, so the resulting force is proportional to the velocity difference of the point and "air velocity". For example a wind field with flow=1.0 results in proper non-accelerating wind. * New effector fields "turbulence", which creates nice random flow paths, and "drag", which slows the points down. * Much improved vortex field. * Effectors can now effect particle rotation as well as location. * Use full, or only positive/negative z-axis to apply force (note. the z-axis is the surface normal in the case of effector shape "surface") * New "force field" submenu in add menu, which adds an empty with the chosen effector (curve object for corve guides). * Other dynamics should be quite easy to add to the effector system too if wanted. * "Unified" doesn't mean that force fields give the exact same results for particles, softbody & cloth, since their final effect depends on many external factors, like for example the surface area of the effected faces. Code changes * Subversion bump for correct handling of global gravity. * Separate ui py file for common dynamics stuff. * Particle settings updating is flushed with it's id through DAG_id_flush_update(..). Known issues * Curve guides don't yet have all ui buttons in place, but they should work none the less. * Hair dynamics don't yet respect force fields. Other changes * Particle emission defaults now to frames 1-200 with life of 50 frames to fill the whole default timeline. * Many particles drawing related crashes fixed. * Sometimes particles didn't update on first frame properly. * Hair with object/group visualization didn't work properly. * Memory leaks with PointCacheID lists (Genscher, remember to free pidlists after use :). Modified Paths: -- trunk/blender/release/scripts/ui/buttons_particle.py trunk/blender/release/scripts/ui/buttons_physics_cloth.py trunk/blender/release/scripts/ui/buttons_physics_field.py trunk/blender/release/scripts/ui/buttons_physics_softbody.py trunk/blender/release/scripts/ui/buttons_scene.py trunk/blender/source/blender/blenkernel/BKE_collision.h trunk/blender/source/blender/blenkernel/BKE_effect.h trunk/blender/source/blender/blenkernel/BKE_particle.h trunk/blender/source/blender/blenkernel/intern/boids.c trunk/blender/source/blender/blenkernel/intern/cloth.c trunk/blender/source/blender/blenkernel/intern/collision.c trunk/blender/source/blender/blenkernel/intern/depsgraph.c trunk/blender/source/blender/blenkernel/intern/effect.c trunk/blender/source/blender/blenkernel/intern/implicit.c trunk/blender/source/blender/blenkernel/intern/modifier.c trunk/blender/source/blender/blenkernel/intern/object.c trunk/blender/source/blender/blenkernel/intern/particle.c trunk/blender/source/blender/blenkernel/intern/particle_system.c trunk/blender/source/blender/blenkernel/intern/pointcache.c trunk/blender/source/blender/blenkernel/intern/scene.c trunk/blender/source/blender/blenkernel/intern/smoke.c trunk/blender/source/blender/blenkernel/intern/softbody.c trunk/blender/source/blender/blenloader/intern/readfile.c trunk/blender/source/blender/blenloader/intern/writefile.c trunk/blender/source/blender/editors/object/object_add.c trunk/blender/source/blender/editors/object/object_edit.c trunk/blender/source/blender/editors/object/object_intern.h trunk/blender/source/blender/editors/object/object_modifier.c trunk/blender/source/blender/editors/object/object_ops.c trunk/blender/source/blender/editors/physics/particle_boids.c t
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23573] trunk/blender/source/blender/ blenkernel/intern/collision.c: building without bullet didnt work
Revision: 23573 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23573 Author: campbellbarton Date: 2009-09-30 23:31:08 +0200 (Wed, 30 Sep 2009) Log Message: --- building without bullet didnt work Modified Paths: -- trunk/blender/source/blender/blenkernel/intern/collision.c Modified: trunk/blender/source/blender/blenkernel/intern/collision.c === --- trunk/blender/source/blender/blenkernel/intern/collision.c 2009-09-30 19:51:12 UTC (rev 23572) +++ trunk/blender/source/blender/blenkernel/intern/collision.c 2009-09-30 21:31:08 UTC (rev 23573) @@ -45,9 +45,9 @@ #include "BKE_modifier.h" #include "BKE_utildefines.h" #include "BKE_DerivedMesh.h" - +#ifdef USE_BULLET #include "Bullet-C-Api.h" - +#endif #include "BLI_kdopbvh.h" #include "BKE_collision.h" ___ 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 [23572] trunk/blender/projectfiles_vc9/ blender: Update MSVC project files
Revision: 23572 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23572 Author: ben2610 Date: 2009-09-30 21:51:12 +0200 (Wed, 30 Sep 2009) Log Message: --- Update MSVC project files Modified Paths: -- trunk/blender/projectfiles_vc9/blender/blenpluginapi/blenpluginapi/blenpluginapi.vcproj trunk/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj trunk/blender/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj trunk/blender/projectfiles_vc9/blender/nodes/nodes.vcproj trunk/blender/projectfiles_vc9/blender/render/BRE_render.vcproj trunk/blender/projectfiles_vc9/blender/windowmanager/windowmanager.vcproj Modified: trunk/blender/projectfiles_vc9/blender/blenpluginapi/blenpluginapi/blenpluginapi.vcproj === --- trunk/blender/projectfiles_vc9/blender/blenpluginapi/blenpluginapi/blenpluginapi.vcproj 2009-09-30 18:55:59 UTC (rev 23571) +++ trunk/blender/projectfiles_vc9/blender/blenpluginapi/blenpluginapi/blenpluginapi.vcproj 2009-09-30 19:51:12 UTC (rev 23572) @@ -43,7 +43,7 @@ - - @@ -1548,6 +1544,26 @@ > + + + + + + + + + + Modified: trunk/blender/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj === --- trunk/blender/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj 2009-09-30 18:55:59 UTC (rev 23571) +++ trunk/blender/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj 2009-09-30 19:51:12 UTC (rev 23572) @@ -43,7 +43,7 @@ http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23571] branches/blender2.4/source/blender /blenkernel/intern/lattice.c: Bugfix for curve deform, would result in applying curve modifier inverting th
Revision: 23571 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23571 Author: campbellbarton Date: 2009-09-30 20:55:59 +0200 (Wed, 30 Sep 2009) Log Message: --- Bugfix for curve deform, would result in applying curve modifier inverting the normals for -Z. Incorrect comparison with the 'axis' and OB_NEG#, the axis matches MOD_CURVE_NEG# which is from 1-6, not 0-5. Modified Paths: -- branches/blender2.4/source/blender/blenkernel/intern/lattice.c Modified: branches/blender2.4/source/blender/blenkernel/intern/lattice.c === --- branches/blender2.4/source/blender/blenkernel/intern/lattice.c 2009-09-30 18:18:32 UTC (rev 23570) +++ branches/blender2.4/source/blender/blenkernel/intern/lattice.c 2009-09-30 18:55:59 UTC (rev 23571) @@ -550,7 +550,7 @@ } /* options */ - if(ELEM3(axis, OB_NEGX, OB_NEGY, OB_NEGZ)) { + if(ELEM3(axis, OB_NEGX+1, OB_NEGY+1, OB_NEGZ+1)) { /* OB_NEG# 0-5, MOD_CURVE_POS# 1-6 */ if(cu->flag & CU_STRETCH) fac= (-co[index]-cd->dmax[index])/(cd->dmax[index] - cd->dmin[index]); else ___ 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 [23570] trunk/blender: Render & Compositing Thread Fixes
Revision: 23570 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23570 Author: blendix Date: 2009-09-30 20:18:32 +0200 (Wed, 30 Sep 2009) Log Message: --- Render & Compositing Thread Fixes * Rendering twice or more could crash layer/pass buttons. * Compositing would crash while drawing the image. * Rendering animations could also crash drawing the image. * Compositing could crash * Starting to rendering while preview render / compo was still running could crash. * Exiting while rendering an animation would not abort the renderer properly, making Blender seemingly freeze. * Fixes theoretically possible issue with setting malloc lock with nested threads. * Drawing previews inside nodes could crash when those nodes were being rendered at the same time. There's more crashes, manipulating the scene data or undo can still crash, this commit only focuses on making sure the image buffer and render result access is thread safe. Implementation: * Rather than assuming the render result does not get freed during render, which seems to be quite difficult to do given that e.g. the compositor is allowed to change the size of the buffer or output different passes, the render result is now protected with a read/write mutex. * The read/write mutex allows multiple readers (and pixel writers) at the same time, but only allows one writer to manipulate the data structure. * Added BKE_image_acquire_ibuf/BKE_image_release_ibuf to access images being rendered, cases where this is not needed (most code) can still use BKE_image_get_ibuf. * The job manager now allows only one rendering job at the same time, rather than the G.rendering check which was not reliable. Modified Paths: -- trunk/blender/intern/guardedalloc/intern/mallocn.c trunk/blender/source/blender/blenkernel/BKE_image.h trunk/blender/source/blender/blenkernel/intern/image.c trunk/blender/source/blender/blenkernel/intern/node.c trunk/blender/source/blender/blenkernel/intern/sequence.c trunk/blender/source/blender/blenlib/BLI_threads.h trunk/blender/source/blender/blenlib/intern/threads.c trunk/blender/source/blender/editors/include/ED_image.h trunk/blender/source/blender/editors/render/render_preview.c trunk/blender/source/blender/editors/screen/screen_ops.c trunk/blender/source/blender/editors/screen/screendump.c trunk/blender/source/blender/editors/space_file/writeimage.c trunk/blender/source/blender/editors/space_image/image_buttons.c trunk/blender/source/blender/editors/space_image/image_draw.c trunk/blender/source/blender/editors/space_image/image_ops.c trunk/blender/source/blender/editors/space_image/space_image.c trunk/blender/source/blender/editors/space_node/node_draw.c trunk/blender/source/blender/editors/space_node/node_edit.c trunk/blender/source/blender/makesrna/intern/rna_image.c trunk/blender/source/blender/makesrna/intern/rna_space.c trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_composite.c trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_image.c trunk/blender/source/blender/nodes/intern/CMP_util.c trunk/blender/source/blender/render/extern/include/RE_pipeline.h trunk/blender/source/blender/render/intern/include/render_types.h trunk/blender/source/blender/render/intern/source/pipeline.c trunk/blender/source/blender/render/intern/source/sss.c trunk/blender/source/blender/windowmanager/WM_api.h trunk/blender/source/blender/windowmanager/intern/wm_jobs.c Modified: trunk/blender/intern/guardedalloc/intern/mallocn.c === --- trunk/blender/intern/guardedalloc/intern/mallocn.c 2009-09-30 17:13:57 UTC (rev 23569) +++ trunk/blender/intern/guardedalloc/intern/mallocn.c 2009-09-30 18:18:32 UTC (rev 23570) @@ -688,17 +688,35 @@ uintptr_t MEM_get_memory_in_use(void) { - return mem_in_use; + uintptr_t _mem_in_use; + + mem_lock_thread(); + _mem_in_use= mem_in_use; + mem_unlock_thread(); + + return _mem_in_use; } uintptr_t MEM_get_mapped_memory_in_use(void) { - return mmap_in_use; + uintptr_t _mmap_in_use; + + mem_lock_thread(); + _mmap_in_use= mmap_in_use; + mem_unlock_thread(); + + return _mmap_in_use; } int MEM_get_memory_blocks_in_use(void) { - return totblock; + int _totblock; + + mem_lock_thread(); + _totblock= totblock; + mem_unlock_thread(); + + return _totblock; } /* eof */ Modified: trunk/blender/source/blender/blenkernel/BKE_image.h === --- trunk/blender/source/blender/blenkernel/BKE_image.h 2009-09-30 17:13:57 UTC (rev 23569) +++ trunk/blender/source/blender/blenkernel/BKE_image.h 2009-09-30 18:18:32 UTC (rev 23570) @@ -107,6 +107,11 @@ /* always call to make sign
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23569] trunk/blender/intern/ghost/intern: SVN maintenance.
Revision: 23569 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23569 Author: gsrb3d Date: 2009-09-30 19:13:57 +0200 (Wed, 30 Sep 2009) Log Message: --- SVN maintenance. Modified Paths: -- trunk/blender/intern/ghost/intern/GHOST_DisplayManager.cpp trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.h trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm trunk/blender/intern/ghost/intern/GHOST_Window.cpp trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.h trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm Property Changed: trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.h trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.h trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm Modified: trunk/blender/intern/ghost/intern/GHOST_DisplayManager.cpp === --- trunk/blender/intern/ghost/intern/GHOST_DisplayManager.cpp 2009-09-30 13:58:21 UTC (rev 23568) +++ trunk/blender/intern/ghost/intern/GHOST_DisplayManager.cpp 2009-09-30 17:13:57 UTC (rev 23569) @@ -27,8 +27,6 @@ */ /** - - * $Id$ * Copyright (C) 2001 NaN Technologies B.V. * @author Maarten Gribnau * @date September 21, 2001 Modified: trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.h === --- trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.h 2009-09-30 13:58:21 UTC (rev 23568) +++ trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.h 2009-09-30 17:13:57 UTC (rev 23569) @@ -1,5 +1,5 @@ /** - * $Id: GHOST_DisplayManagerCocoa.h 13161 2008-01-07 19:13:47Z hos $ + * $Id$ * * BEGIN GPL LICENSE BLOCK * * * This program is free software; you can redistribute it and/or Property changes on: trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.h ___ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm === --- trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm 2009-09-30 13:58:21 UTC (rev 23568) +++ trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm 2009-09-30 17:13:57 UTC (rev 23569) @@ -1,5 +1,5 @@ /** - * $Id: GHOST_DisplayManagerCocoa.mm 13161 2008-01-07 19:13:47Z hos $ + * $Id$ * * BEGIN GPL LICENSE BLOCK * * * This program is free software; you can redistribute it and/or @@ -27,8 +27,6 @@ */ /** - - * $Id: GHOST_DisplayManagerCocoa.mm 13161 2008-01-07 19:13:47Z hos $ * Copyright (C) 2001 NaN Technologies B.V. * @author Maarten Gribnau * @date September 21, 2001 Property changes on: trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm ___ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h === --- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h 2009-09-30 13:58:21 UTC (rev 23568) +++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h 2009-09-30 17:13:57 UTC (rev 23569) @@ -1,5 +1,5 @@ /** - * $Id: GHOST_SystemCocoa.h 20741 2009-06-08 20:08:19Z blendix $ + * $Id$ * * BEGIN GPL LICENSE BLOCK * * * This program is free software; you can redistribute it and/or Property changes on: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h ___ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm === --- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm 2009-09-30 13:58:21 UTC (rev 23568) +++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm 2009-09-30 17:13:57 UTC (rev 23569) @@ -1,5 +1,5 @@ /** - * $Id: GHOST_SystemCocoa.cpp 23296 2009-09-16 22:27:27Z broken $ + * $Id$ * * BEGIN GPL LICENSE BLOCK * * * This program is free software; you can redistribute it and/or Property changes on: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm ___ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23568] trunk/blender/source/gameengine/ GameLogic/SCA_PropertySensor.cpp: svn merge https://svn.blender.org/svnroot /bf-blender/branches/blender2.4 -
Revision: 23568 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23568 Author: campbellbarton Date: 2009-09-30 15:58:21 +0200 (Wed, 30 Sep 2009) Log Message: --- svn merge https://svn.blender.org/svnroot/bf-blender/branches/blender2.4 -r23566:23567 Modified Paths: -- trunk/blender/source/gameengine/GameLogic/SCA_PropertySensor.cpp Modified: trunk/blender/source/gameengine/GameLogic/SCA_PropertySensor.cpp === --- trunk/blender/source/gameengine/GameLogic/SCA_PropertySensor.cpp 2009-09-30 13:19:42 UTC (rev 23567) +++ trunk/blender/source/gameengine/GameLogic/SCA_PropertySensor.cpp 2009-09-30 13:58:21 UTC (rev 23568) @@ -38,6 +38,7 @@ #include "SCA_EventManager.h" #include "SCA_LogicManager.h" #include "BoolValue.h" +#include "FloatValue.h" #ifdef HAVE_CONFIG_H #include @@ -190,6 +191,22 @@ m_checkpropval.Upper(); } result = (testprop == m_checkpropval); + + /* Patch: floating point values cant use strings usefully since you can have "0.0" == "0." +* this could be made into a generic Value class function for comparing values with a string. +*/ + if(result==false && dynamic_cast(orgprop) != NULL) { + float f; + + if(EOF == sscanf(m_checkpropval.ReadPtr(), "%f", &f)) + { + //error + } + else { + result = (f == ((CFloatValue *)orgprop)->GetFloat()); + } + } + /* end patch */ } orgprop->Release(); ___ 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 [23567] branches/blender2.4/source/ gameengine/GameLogic/SCA_PropertySensor.cpp: comparing float values with the property sensor didnt work
Revision: 23567 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23567 Author: campbellbarton Date: 2009-09-30 15:19:42 +0200 (Wed, 30 Sep 2009) Log Message: --- comparing float values with the property sensor didnt work Modified Paths: -- branches/blender2.4/source/gameengine/GameLogic/SCA_PropertySensor.cpp Modified: branches/blender2.4/source/gameengine/GameLogic/SCA_PropertySensor.cpp === --- branches/blender2.4/source/gameengine/GameLogic/SCA_PropertySensor.cpp 2009-09-30 08:47:39 UTC (rev 23566) +++ branches/blender2.4/source/gameengine/GameLogic/SCA_PropertySensor.cpp 2009-09-30 13:19:42 UTC (rev 23567) @@ -38,6 +38,7 @@ #include "SCA_EventManager.h" #include "SCA_LogicManager.h" #include "BoolValue.h" +#include "FloatValue.h" #ifdef HAVE_CONFIG_H #include @@ -191,6 +192,22 @@ m_checkpropval.Upper(); } result = (testprop == m_checkpropval); + + /* Patch: floating point values cant use strings usefully since you can have "0.0" == "0." +* this could be made into a generic Value class function for comparing values with a string. +*/ + if(result==false && dynamic_cast(orgprop) != NULL) { + float f; + + if(EOF == sscanf(m_checkpropval.ReadPtr(), "%f", &f)) + { + //error + } + else { + result = (f == ((CFloatValue *)orgprop)->GetFloat()); + } + } + /* end patch */ } orgprop->Release(); ___ 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 [23566] trunk/blender: Cocoa port start:
Revision: 23566 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23566 Author: damien78 Date: 2009-09-30 10:47:39 +0200 (Wed, 30 Sep 2009) Log Message: --- Cocoa port start: GHOST*Cocoa.mm & .h files creation First Cocoa version of GHOST_SystemCocoa.mm CMake files update to allow optional (WITH_COCOA option) Cocoa version build - disabled by default SCons files are not updated to allow Cocoa build (the ghost .mm files) Modified Paths: -- trunk/blender/CMakeLists.txt trunk/blender/intern/ghost/CMakeLists.txt trunk/blender/intern/ghost/intern/GHOST_ISystem.cpp Added Paths: --- trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.h trunk/blender/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.h trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm Modified: trunk/blender/CMakeLists.txt === --- trunk/blender/CMakeLists.txt2009-09-30 04:59:14 UTC (rev 23565) +++ trunk/blender/CMakeLists.txt2009-09-30 08:47:39 UTC (rev 23566) @@ -81,6 +81,10 @@ OPTION(WITH_BUILDINFO "Include extra build details" ON) OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON) +IF (APPLE) +OPTION(WITH_COCOA"Use Cocoa framework instead of deprecated Carbon" OFF) +ENDIF (APPLE) + IF(NOT WITH_GAMEENGINE AND WITH_PLAYER) MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE") ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER) @@ -402,6 +406,7 @@ FIND_PACKAGE(OpenAL) IF(OPENAL_FOUND) SET(WITH_OPENAL ON) + SET(OPENAL_INCLUDE_DIR "${OPENAL_INCLUDE_DIR};${LIBDIR}/openal/include") ELSE(OPENAL_FOUND) SET(WITH_OPENAL OFF) ENDIF(OPENAL_FOUND) @@ -485,9 +490,13 @@ SET(LLIBS stdc++ SystemStubs) + IF (WITH_COCOA) + SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -DGHOST_COCOA") + SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime") + ELSE (WITH_COCOA) SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing") SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime") - + ENDIF (WITH_COCOA) IF(WITH_OPENMP) SET(LLIBS "${LLIBS} -lgomp ") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ") Modified: trunk/blender/intern/ghost/CMakeLists.txt === --- trunk/blender/intern/ghost/CMakeLists.txt 2009-09-30 04:59:14 UTC (rev 23565) +++ trunk/blender/intern/ghost/CMakeLists.txt 2009-09-30 08:47:39 UTC (rev 23566) @@ -26,9 +26,18 @@ SET(INC . ../string) -FILE(GLOB SRC intern/*.cpp) +FILE(GLOB SRC intern/*.cpp intern/*.mm) IF(APPLE) + IF(WITH_COCOA) + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp") + ELSE(WITH_COCOA) + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCocoa.mm") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCocoa.mm") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCocoa.mm") + ENDIF(WITH_COCOA) LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerWin32.cpp") LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemWin32.cpp") LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowWin32.cpp") @@ -41,6 +50,9 @@ LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp") LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp") LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCocoa.mm") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCocoa.mm") + LIST(REMOVE_ITEM SRC "${