From a82a6bedc55fe676c11bf36f1017c0cbddcd9ca2 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Tue, 21 Apr 2009 16:58:25 +0000 Subject: Fix for bug #17457. This bug relates to files that have missing multires vertex data. The fix is, if the file was saved on the highest multires level, then mesh contains a copy of the vertices anyway, and we can just copy it back into multires. Otherwise, multires is removed from the mesh to avoid a crash. --- source/blender/blenloader/intern/readfile.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c88e06a9993..477f5a6cb59 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2876,6 +2876,18 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh) lvl->map_mem= NULL; } } + + /* Gracefully handle corrupted mesh */ + if(mesh->mr && !mesh->mr->verts) { + /* If totals match, simply load the current mesh verts into multires */ + if(mesh->totvert == ((MultiresLevel*)mesh->mr->levels.last)->totvert) + mesh->mr->verts = MEM_dupallocN(mesh->mvert); + else { + /* Otherwise, we can't recover the data, silently remove multires */ + multires_free(mesh->mr); + mesh->mr = NULL; + } + } if((fd->flags & FD_FLAGS_SWITCH_ENDIAN) && mesh->tface) { TFace *tf= mesh->tface; -- cgit v1.2.3 From b22819f686539f75438938ed45751e7dc3405a0c Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 22 Apr 2009 17:35:37 +0000 Subject: Bugfix #18039 Armature modifier didn't set amd->prevCos temp variable to NULL after freeing. Saving this in file will cause error or crash on reading. Quite weird how it survived so long? --- source/blender/blenloader/intern/readfile.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 477f5a6cb59..ce154755651 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3176,6 +3176,11 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) smd->emCache = smd->mCache = 0; } + else if (md->type==eModifierType_Armature) { + ArmatureModifierData *amd = (ArmatureModifierData*) md; + + amd->prevCos= NULL; + } else if (md->type==eModifierType_Cloth) { ClothModifierData *clmd = (ClothModifierData*) md; -- cgit v1.2.3 From b6fa9afccb941aa413ac788a5bc73d9170fd6228 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 12 May 2009 15:28:07 +0000 Subject: [#13726] Segfault with (Re)Appending objects fix this by freeing the lib-file-data after linking or appending, re-appending will be slower now (as slow as appending for the first time). Not strictly needed, set the memory for bhead's to zero in readfile.c since comparisons are done later on with this data making valgrind complain. Added some missing headers too. --- source/blender/blenloader/intern/readfile.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ce154755651..0873c572382 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -133,6 +133,7 @@ #include "BKE_main.h" // for Main #include "BKE_mesh.h" // for ME_ defines (patching) #include "BKE_modifier.h" +#include "BKE_multires.h" // for multires_free #include "BKE_node.h" // for tree type defines #include "BKE_object.h" #include "BKE_particle.h" @@ -617,6 +618,11 @@ static BHeadN *get_bhead(FileData *fd) BHeadN *new_bhead = 0; int readsize; + /* not strictly needed but shuts valgrind up + * since uninitialized memory gets compared */ + memset(&bhead8, 0, sizeof(BHead8)); + memset(&bhead4, 0, sizeof(BHead4)); + if (fd) { if ( ! fd->eof) { @@ -9233,6 +9239,8 @@ void BLO_script_library_append(BlendHandle **bh, char *dir, char *name, void BLO_library_append(SpaceFile *sfile, char *dir, int idcode) { BLO_library_append_(&sfile->libfiledata, sfile->filelist, sfile->totfile, dir, sfile->file, sfile->flag, idcode); + BLO_blendhandle_close(sfile->libfiledata); + sfile->libfiledata= NULL; } void BLO_library_append_(BlendHandle** libfiledata, struct direntry* filelist, int totfile, char *dir, char* file, short flag, int idcode) -- cgit v1.2.3 From 705764fe050fd15703fe2ab410516ff3ccc3f421 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 12 May 2009 16:20:23 +0000 Subject: Fix face occlusion for projection paint, (was broken for all RC's but nobody noticed) Its still not working right in perspective mode. For bleed use a faster method then Barycentric weights function since the point is always on the edge. last commit with memset in readfile.c missed one var. --- source/blender/blenloader/intern/readfile.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0873c572382..cbf2516da77 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -617,15 +617,16 @@ static BHeadN *get_bhead(FileData *fd) BHead bhead; BHeadN *new_bhead = 0; int readsize; - - /* not strictly needed but shuts valgrind up - * since uninitialized memory gets compared */ - memset(&bhead8, 0, sizeof(BHead8)); - memset(&bhead4, 0, sizeof(BHead4)); if (fd) { if ( ! fd->eof) { + /* not strictly needed but shuts valgrind up + * since uninitialized memory gets compared */ + memset(&bhead8, 0, sizeof(BHead8)); + memset(&bhead4, 0, sizeof(BHead4)); + memset(&bhead, 0, sizeof(BHead)); + // First read the bhead structure. // Depending on the platform the file was written on this can // be a big or little endian BHead4 or BHead8 structure. -- cgit v1.2.3 From 003534513645576215092b79f1aa46e85c89e3bd Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 14 May 2009 12:36:07 +0000 Subject: Bugfix, sorta :) Removed option to choose rendering to yafray. New yafaray is better, and already is being linked as option on the blender.org download page. --- source/blender/blenloader/intern/readfile.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index cbf2516da77..6c5a5bd551c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8092,6 +8092,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main) wrld->occlusionRes = 128; } } + + if (main->versionfile < 249) { + Scene *sce; + for (sce= main->scene.first; sce; sce= sce->id.next) + sce->r.renderer= 0; + + } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ -- cgit v1.2.3 From 9ce8a676906b6b07b0971f0d5886ae338d188629 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Sun, 17 May 2009 20:37:13 +0000 Subject: BGE Dome: removing of size option and adding tilt option. - Size adjustments can be accomplished with warp mesh data now. So we get a free spot in the GUI for a tilt option. - Tilt option to tilt the camera (for planetarium domes). Angle is in degree from -180 to +180. It's needed for planetarium domes (as this one http://domejunky.blogspot.com/2009/05/dome-corrected-bge.html ). - This is the last commit regarding dome code I expected to 2.49. I consider this feature full implemented now. (working on docs now) --- source/blender/blenloader/intern/readfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 6c5a5bd551c..91557da7aa6 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8082,9 +8082,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for (sce= main->scene.first; sce; sce= sce->id.next) { sce->r.domeangle = 180; sce->r.domemode = 1; - sce->r.domesize = 1.0f; sce->r.domeres = 4; sce->r.domeresbuf = 1.0f; + sce->r.dometilt = 0; } /* DBVT culling by default */ for(wrld=main->world.first; wrld; wrld= wrld->id.next) { -- cgit v1.2.3 From 07fc2aa5268da7708a289fa785b0f0cbd9be2575 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 18 May 2009 08:22:51 +0000 Subject: BGE #18665: Servo control and relative motion Servo control motion actuator did not work as expected when the object is moving on a moving platform. This patch introduces a new Ref field in the servo motion actuator to set a reference object for the velocity calculation. You can set the object during the game using the actuator "reference" attribute; use an object name or an object reference. The servo controller takes into account the angular velocity of the reference object to compute the relative local velocity. --- source/blender/blenloader/intern/readfile.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 91557da7aa6..0f233410f4e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3077,6 +3077,10 @@ static void lib_link_object(FileData *fd, Main *main) bAddObjectActuator *eoa= act->data; if(eoa) eoa->ob= newlibadr(fd, ob->id.lib, eoa->ob); } + else if(act->type==ACT_OBJECT) { + bObjectActuator *oa= act->data; + oa->reference= newlibadr(fd, ob->id.lib, oa->reference); + } else if(act->type==ACT_EDIT_OBJECT) { bEditObjectActuator *eoa= act->data; if(eoa==NULL) { @@ -3087,6 +3091,15 @@ static void lib_link_object(FileData *fd, Main *main) eoa->me= newlibadr(fd, ob->id.lib, eoa->me); } } + else if(act->type==ACT_OBJECT) { + bObjectActuator *oa= act->data; + if(oa==NULL) { + init_actuator(act); + } + else { + oa->reference= newlibadr(fd, ob->id.lib, oa->reference); + } + } else if(act->type==ACT_SCENE) { bSceneActuator *sa= act->data; sa->camera= newlibadr(fd, ob->id.lib, sa->camera); @@ -8862,6 +8875,10 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob) expand_doit(fd, mainvar, eoa->me); } } + else if(act->type==ACT_OBJECT) { + bObjectActuator *oa= act->data; + expand_doit(fd, mainvar, oa->reference); + } else if(act->type==ACT_SCENE) { bSceneActuator *sa= act->data; expand_doit(fd, mainvar, sa->camera); -- cgit v1.2.3 From 06a7155b681cdb02c6b75b9934f9235efcc6c297 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 21 May 2009 13:32:15 +0000 Subject: BGE: user control to compound shape and setParent. Compound shape control ====================== 1) GUI control It is now possible to control which child shape is added to a parent compound shape in the Physics buttons. The "Compound" shape button becomes "Add to parent" on child objects and determines whether the child shape is to be added to the top parent compound shape when the game is stated. Notes: * "Compound" is only available to top parent objects (objects without parent). * Nesting of compound shape is not possible: a child object with "Add to parent" button set will be added to the top parent compound shape, regardless of its position in the parent-child hierarchy and even if its immediate parent doesn't have the "Add to parent" button set. 2) runtime control It is now possible to control the compound shape at runtime: The SetParent actuator has a new "Compound" button that indicates whether the object shape should be added to the compound shape of the parent object, provided the parent has a compound shape of course. If not, the object retain it's individual state while parented. Similarly, the KX_GameObject.setParent() python function has a new compound parameter. Notes: * When an object is dynamically added to a compound shape, it looses temporarily all its physics capability to the benefit of the parent: it cannot register collisions and the characteristics of its shape are lost (ghost, sensor, dynamic, etc.). * Nested compound shape is not supported: if the object being parented is already a compound shape, it is not added to the compound parent (as if the Compound option was not set in the actuator or the setParent function). * To ensure compatibility with old blend files, the Blender subversion is changed to 2.48.5 and the old blend files are automatically converted to match the old behavior: all children of a Compound object will have the "Add to parent" button set automatically. Child ghost control =================== It is now possible to control if an object should becomes ghost or solid when parented. This is only applicable if the object is not added to the parent compound shape (see above). A new "Ghost" button is available on the SetParent actuator to that effect. Similarly the KX_GameObject.setParent() python function has a new compound parameter. Notes: * This option is not applicable to sensor objects: they stay ghost all the time. * Make sure the child object does not enter in collision with the parent shape when the Ghost option if off and the parent is dynamic: the collision creates a reaction force but the parent cannot escape the child, so the force builds up and produces eratic movements. * The collision capability of an ordinary object (dynamic or static) is limited when it is parented: it becomes automatically static and can only detect dynamic and sensor objects. * A sensor object retain its full collision capability when parented: it can detect static and dynamic object. Python control ============== KX_GameObject.setParent(parent,compound,ghost): Sets this object's parent. Control the shape status with the optional compound and ghost parameters: compound=1: the object shape should be added to the parent compound shape (default) compound=0: the object should keep its individual shape. In that case you can control if it should be ghost or not: ghost=1 if the object should be made ghost while parented (default) ghost=0 if the object should be solid while parented Note: if the object type is sensor, it stays ghost regardless of ghost parameter parent: KX_GameObject reference or string (object name w/o OB prefix) --- source/blender/blenloader/intern/readfile.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0f233410f4e..25c8a928a3b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8106,6 +8106,22 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 5)) { + Object *ob; + for(ob = main->object.first; ob; ob= ob->id.next) { + if(ob->parent) { + /* check if top parent has compound shape set and if yes, set this object + to compound shaper as well (was the behaviour before, now it's optional) */ + Object *parent= newlibadr(fd, lib, ob->parent); + while (parent->parent != NULL) { + parent = newlibadr(fd, lib, parent->parent); + } + if (parent->gameflag & OB_CHILD) + ob->gameflag |= OB_CHILD; + } + } + } + if (main->versionfile < 249) { Scene *sce; for (sce= main->scene.first; sce; sce= sce->id.next) -- cgit v1.2.3 From 036ebc55233241bf9bd8149f855185cfcfb1ab67 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 21 May 2009 18:10:19 +0000 Subject: BGE: GUI control over frame rate, logic rate, physics rate and physics subrate. Four new buttons in World settings to control frame rate: fps: Nominal frame rate in frame per second. Also sets the physics timestep = 1/fps phys: Maximum number of physics timestep per game frame in case the actual fps is less than nominal. This allows the physics to keep up with real time even if the graphics slows down the game. sub: Fixed number of simulation substeps per physic timestep. Improves the precision of the physics simulation. Useful for fast moving objects for example. log: Maximum number of logic steps per game frame in case the actual fps is less than nominal. This allows the logic system to follow the physics simulation. Upper bound = phys (setting the value higher than phys has no effect). On games with heavy logic system, it is useful to set this value to 1, to keep logic time under control. All these values were already accessible from Python except phys: GameLogic.getMaxPhysicsFrame(): Gets the maximum number of physics frame per render frame. GameLogic.setMaxPhysicsFrame(phys): Sets the maximum number of physics timestep that are executed per render frame. Higher value allows physics to keep up with realtime even if graphics slows down the game. Physics timestep is fixed and equal to 1/tickrate (see setLogicTicRate) maxphysics/ticrate is the maximum delay of the renderer that physics can compensate. phys: integer --- source/blender/blenloader/intern/readfile.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 25c8a928a3b..bda0348f2ca 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8108,6 +8108,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 5)) { Object *ob; + World *wrld; for(ob = main->object.first; ob; ob= ob->id.next) { if(ob->parent) { /* check if top parent has compound shape set and if yes, set this object @@ -8120,6 +8121,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ob->gameflag |= OB_CHILD; } } + for(wrld=main->world.first; wrld; wrld= wrld->id.next) { + wrld->ticrate = 60; + wrld->maxlogicstep = 5; + wrld->physubstep = 1; + wrld->maxphystep = 5; + } } if (main->versionfile < 249) { -- cgit v1.2.3 From eb8c5f3272b87fffaf017badf55f761de9a04fd1 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sat, 23 May 2009 22:35:47 +0000 Subject: Set default constraint solver mode more compatible to Blender 2.48 settings, this fixes rigid body stacking in this blend file: http://blenderartists.org/forum/showpost.php?p=1382653&postcount=102 (todo: expose this setting in World setting GUI) Expose contact processing threshold in Advanced GUI, next to rigid body margin, called CPT. Default to 1, makes rigid body stacking a bit more stable, smaller values makes sliding easier (at the cost of easier jittering). Disabled for 'dynamic' objects that don't rotate, because characters etc. always need smooth sliding. --- source/blender/blenloader/intern/readfile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index bda0348f2ca..0b0a97b7ec0 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8083,7 +8083,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* Adjustments needed after Bullets update */ for(ob = main->object.first; ob; ob= ob->id.next) { ob->damping *= 0.635f; - ob->rdamping = 0.1 + (0.59f * ob->rdamping); + ob->rdamping = 0.1 + (0.8f * ob->rdamping); } } @@ -8105,11 +8105,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main) wrld->occlusionRes = 128; } } - + if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 5)) { Object *ob; World *wrld; for(ob = main->object.first; ob; ob= ob->id.next) { + ob->pad3 = 1.; //pad3 is used for m_contactProcessingThreshold if(ob->parent) { /* check if top parent has compound shape set and if yes, set this object to compound shaper as well (was the behaviour before, now it's optional) */ -- cgit v1.2.3 From 83bb096f24cb2252f90a77923bd1818930a2fed2 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sun, 24 May 2009 06:31:47 +0000 Subject: + renamed pad3 to m_contactProcessingThreshold (thanks Campbell Barton/ideasman for confirming it is ok to rename it) + fixed Python method, PyArg_ParseTuple already checks for errors, no returning of NULL, thanks Campbell too) + added linear/angular spring for each of the 6DOFs of a generic 6dof constraint. This makes the generic 6dof constraint very versatile. --- source/blender/blenloader/intern/readfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0b0a97b7ec0..d8566e06ed7 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8110,7 +8110,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) Object *ob; World *wrld; for(ob = main->object.first; ob; ob= ob->id.next) { - ob->pad3 = 1.; //pad3 is used for m_contactProcessingThreshold + ob->m_contactProcessingThreshold = 1.; //pad3 is used for m_contactProcessingThreshold if(ob->parent) { /* check if top parent has compound shape set and if yes, set this object to compound shaper as well (was the behaviour before, now it's optional) */ -- cgit v1.2.3 From ea94f8ab8a2cbe7ccfb4914ef6441c3be7ac0e60 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 24 May 2009 13:41:37 +0000 Subject: == Sequencer == This adds custom proxy file storage to the sequencer. Reasoning: sometimes low resolution versions are already available as a seperate file built by the capture application. So there is no real reason to make blender build it's own seperate proxy. This also somewhat fixes (aehm works around :) ) [#13632] Creating Proxy Takes Over Process, Should be Background Since now you can just fire up ffmpeg to build your proxies in the background. (You could have done before and build a directory of jpeg files, but then you would have to rename all the files since otherwise things are off by one...) --- source/blender/blenloader/intern/readfile.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d8566e06ed7..d9df1ee4419 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3689,6 +3689,7 @@ static void direct_link_scene(FileData *fd, Scene *sce) if (seq->flag & SEQ_USE_PROXY) { seq->strip->proxy = newdataadr( fd, seq->strip->proxy); + seq->strip->proxy->anim = 0; } else { seq->strip->proxy = 0; } -- cgit v1.2.3 From b7653ba5421a245957ac6170f0bbca0589220bae Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 May 2009 00:31:41 +0000 Subject: missing null check, would crash blender when loading some files --- source/blender/blenloader/intern/readfile.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d9df1ee4419..3284f8efdf2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8116,11 +8116,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* check if top parent has compound shape set and if yes, set this object to compound shaper as well (was the behaviour before, now it's optional) */ Object *parent= newlibadr(fd, lib, ob->parent); - while (parent->parent != NULL) { - parent = newlibadr(fd, lib, parent->parent); + if(parent) { + while (parent->parent != NULL) { + parent = newlibadr(fd, lib, parent->parent); + } + if (parent->gameflag & OB_CHILD) + ob->gameflag |= OB_CHILD; } - if (parent->gameflag & OB_CHILD) - ob->gameflag |= OB_CHILD; } } for(wrld=main->world.first; wrld; wrld= wrld->id.next) { -- cgit v1.2.3 From 1266e0f2bffb95a59157075f9f4f071dcc744f73 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 May 2009 01:00:17 +0000 Subject: quick fix still allowed for possible crash, check for valid newlibadr return value in the while loop. --- source/blender/blenloader/intern/readfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3284f8efdf2..abfb8ebd04c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8116,10 +8116,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* check if top parent has compound shape set and if yes, set this object to compound shaper as well (was the behaviour before, now it's optional) */ Object *parent= newlibadr(fd, lib, ob->parent); + while (parent && parent->parent != NULL) { + parent = newlibadr(fd, lib, parent->parent); + } if(parent) { - while (parent->parent != NULL) { - parent = newlibadr(fd, lib, parent->parent); - } if (parent->gameflag & OB_CHILD) ob->gameflag |= OB_CHILD; } -- cgit v1.2.3 From ca4d741ce9865c696ef0e41c0c44dd916974d099 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 26 May 2009 08:30:28 +0000 Subject: Bugfix: (discovered by course participant :) Brush option "Clone" didn't read linked Clone Image from file. No idea how this ever could work even... even for Undo it would crash. --- source/blender/blenloader/intern/readfile.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index abfb8ebd04c..a99cb86f86b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1459,6 +1459,8 @@ static void lib_link_brush(FileData *fd, Main *main) if(brush->id.flag & LIB_NEEDLINK) { brush->id.flag -= LIB_NEEDLINK; + brush->clone.image= newlibadr_us(fd, brush->id.lib, brush->clone.image); + for(a=0; amtex[a]; if(mtex) -- cgit v1.2.3 From 17c51c6cb778aa584dee93c9bd70d1a0844d53ac Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Thu, 28 May 2009 22:26:28 +0000 Subject: Bullet Physics maxphystep = 1 is better general default to avoid vicious circle (graphics slower -> physics slower -> overall frametime slower -> graphics slower etc.) See difference in vault.blend --- source/blender/blenloader/intern/readfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index a99cb86f86b..8cfe3ea8ace 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8131,7 +8131,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) wrld->ticrate = 60; wrld->maxlogicstep = 5; wrld->physubstep = 1; - wrld->maxphystep = 5; + wrld->maxphystep = 1; } } -- cgit v1.2.3 From 39177018af16b208e41714d454a44c58a2eea0b7 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Fri, 29 May 2009 08:55:14 +0000 Subject: Revert commit 20478: instead of changing the default in blender, it's better to change the values for the demos that need it. --- source/blender/blenloader/intern/readfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 8cfe3ea8ace..a99cb86f86b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8131,7 +8131,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) wrld->ticrate = 60; wrld->maxlogicstep = 5; wrld->physubstep = 1; - wrld->maxphystep = 1; + wrld->maxphystep = 5; } } -- cgit v1.2.3 From ae565b9bb39bf3fd6c87f3f3e145f4004e19a44b Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 31 May 2009 17:59:57 +0000 Subject: == Sequencer == This fixes: IPO pinning on sequencer strips was lost during Undo. --- source/blender/blenloader/intern/readfile.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index a99cb86f86b..596910ea5ae 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4091,12 +4091,14 @@ void lib_link_screen_restore(Main *newmain, Scene *curscene) } else if(sl->spacetype==SPACE_IPO) { SpaceIpo *sipo= (SpaceIpo *)sl; - - if(sipo->blocktype==ID_SEQ) sipo->from= NULL; // no libdata - else sipo->from= restore_pointer_by_name(newmain, (ID *)sipo->from, 0); + + sipo->ipo= restore_pointer_by_name(newmain, (ID *)sipo->ipo, 0); + if(sipo->blocktype==ID_SEQ) + sipo->from= find_sequence_from_ipo_helper(newmain, sipo->ipo); + else + sipo->from= restore_pointer_by_name(newmain, (ID *)sipo->from, 0); // not free sipo->ipokey, creates dependency with src/ - sipo->ipo= restore_pointer_by_name(newmain, (ID *)sipo->ipo, 0); if(sipo->editipo) MEM_freeN(sipo->editipo); sipo->editipo= NULL; } -- cgit v1.2.3 From 9b088acc676bed7f30851720358b00327905e85d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 3 Jun 2009 20:06:40 +0000 Subject: KX_MouseFocusSensor - bug reported by Micro27 on blenderartist vertical bounds checking for multiple viewports was inverted. quiet some compiler warnings and minor corrections --- source/blender/blenloader/intern/readfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 596910ea5ae..f0ec75dedd9 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4094,7 +4094,7 @@ void lib_link_screen_restore(Main *newmain, Scene *curscene) sipo->ipo= restore_pointer_by_name(newmain, (ID *)sipo->ipo, 0); if(sipo->blocktype==ID_SEQ) - sipo->from= find_sequence_from_ipo_helper(newmain, sipo->ipo); + sipo->from= (ID *)find_sequence_from_ipo_helper(newmain, sipo->ipo); else sipo->from= restore_pointer_by_name(newmain, (ID *)sipo->from, 0); -- cgit v1.2.3 From 580e69b365a2b308bc5d8a2e7cc41b7f3ee5c248 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Sat, 6 Jun 2009 21:49:00 +0000 Subject: Patch/Bugfix so wind noise got controlable seed and therefore redoable cloth sims - bug reported by istvan --- source/blender/blenloader/intern/readfile.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f0ec75dedd9..38b8bfaaa88 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -162,6 +162,8 @@ #include "mydevice.h" #include "blendef.h" +#include "PIL_time.h" + #include /* @@ -8144,6 +8146,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } + // correct introduce of seed for wind force + if (main->versionfile < 249 && main->subversionfile < 1) { + Object *ob; + for(ob = main->object.first; ob; ob= ob->id.next) { + if(ob->pd) + ob->pd->seed = ((unsigned int)(ceil(PIL_check_seconds_timer()))+1) % 128; + } + + } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ -- cgit v1.2.3 From 219f1ce2f034642776782b9465c41783c1a6ab6a Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 10 Jun 2009 15:09:44 +0000 Subject: 2.5 Scene toolsettings was not setting Brush pointers on read, causing crashes on reading files. Thanks Jingyuan for (irc) report! :) --- source/blender/blenloader/intern/readfile.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ce3a35c7194..6cde040e5fd 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3827,12 +3827,19 @@ static void lib_link_scene(FileData *fd, Main *main) sce->world= newlibadr_us(fd, sce->id.lib, sce->world); sce->set= newlibadr(fd, sce->id.lib, sce->set); sce->ima= newlibadr_us(fd, sce->id.lib, sce->ima); + sce->toolsettings->imapaint.brush= newlibadr_us(fd, sce->id.lib, sce->toolsettings->imapaint.brush); if(sce->toolsettings->sculpt) sce->toolsettings->sculpt->brush= newlibadr_us(fd, sce->id.lib, sce->toolsettings->sculpt->brush); - + if(sce->toolsettings->vpaint) + sce->toolsettings->vpaint->brush= + newlibadr_us(fd, sce->id.lib, sce->toolsettings->vpaint->brush); + if(sce->toolsettings->wpaint) + sce->toolsettings->wpaint->brush= + newlibadr_us(fd, sce->id.lib, sce->toolsettings->wpaint->brush); + sce->toolsettings->skgen_template = newlibadr(fd, sce->id.lib, sce->toolsettings->skgen_template); for(base= sce->base.first; base; base= next) { -- cgit v1.2.3 From ca12954e9fb3b38d662190d12e72937ef9990d89 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 14 Jun 2009 18:54:35 +0000 Subject: == Sequencer == Big proxy fix (addressing hopefully most complaints on mailing list and in tracker) * proxy render settings are now independent of render size settings. That means: which proxy size is used, is controlled by two parameters now: the proxy size of the files, can be controlled with additional buttons within the proxy panels. What is shown in a specific preview window depends on the header settings of the preview panel. So: proxies are _only_ used in those windows, that are switched to a specific proxy resolution. * output rendering is always done _without_ proxies. * proxy generation now shows a waitcursor with numbers. (closing Bug: [#18909] Building Proxies doesn't give any feedback which was rather a feature request, since the problem mentioned there was always the case :) ) --- source/blender/blenloader/intern/readfile.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 38b8bfaaa88..c4d63cf14fd 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8156,6 +8156,34 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } + if (main->versionfile < 249 && main->subversionfile < 2) { + Scene *sce= main->scene.first; + Sequence *seq; + Editing *ed; + + while(sce) { + ed= sce->ed; + if(ed) { + WHILE_SEQ(&ed->seqbase) { + if (seq->strip && seq->strip->proxy){ + if (G.scene->r.size != 100.0) { + seq->strip->proxy->size + = sce->r.size; + } else { + seq->strip->proxy->size + = 25.0; + } + seq->strip->proxy->quality =90; + } + } + END_SEQ + } + + sce= sce->id.next; + } + + } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ -- cgit v1.2.3 From 2d40b8d56ff100b71dac7c4694f6115dcc0b01b5 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 16 Jun 2009 13:09:36 +0000 Subject: 2.5 Added SpaceLogic, to restore the old logic buttons into. In future it can be used for a more advanced logic editor, with states, behaviour, whatever. We'll see! This commit only adds the backend for new space. Committed this now as reference for when we need another space type. It's still not well plugin-able (dynamic space types), but my idea is to just have a new SpacePlugIn for this, with a neat small API to define all relevant callbacks. Also note the icon for the spacetype is wrong still. --- source/blender/blenloader/intern/readfile.c | 8 ++++++++ source/blender/blenloader/intern/writefile.c | 3 +++ 2 files changed, 11 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 6cde040e5fd..e4afdb6b7b5 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4733,6 +4733,14 @@ static void direct_link_screen(FileData *fd, bScreen *sc) } snode->nodetree= snode->edittree= NULL; } + else if(sl->spacetype==SPACE_LOGIC) { + SpaceLogic *slogic= (SpaceLogic *)sl; + + if(slogic->gpd) { + slogic->gpd= newdataadr(fd, slogic->gpd); + direct_link_gpencil(fd, slogic->gpd); + } + } else if(sl->spacetype==SPACE_SEQ) { SpaceSeq *sseq= (SpaceSeq *)sl; if(sseq->gpd) { diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 943e23861ad..f8112406e80 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1884,6 +1884,9 @@ static void write_screens(WriteData *wd, ListBase *scrbase) else if(sl->spacetype==SPACE_NODE){ writestruct(wd, DATA, "SpaceNode", 1, sl); } + else if(sl->spacetype==SPACE_LOGIC){ + writestruct(wd, DATA, "SpaceLogic", 1, sl); + } sl= sl->next; } } -- cgit v1.2.3