From 8c74944a8e6e21cca35a2f610360e1e2a1418b76 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 Jan 2010 22:53:05 +0000 Subject: debug prints are too much on my system it hangs ddd. --- source/blender/blenloader/intern/readfile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 6bf347e9bd5..3bb94ecf169 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10691,7 +10691,8 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old) if(id==NULL) { read_libblock(fd, ptr, bhead, LIB_READ+LIB_INDIRECT, NULL); - if(G.f & G_DEBUG) printf("expand_doit: other lib %s\n", lib->name); + // commented because this can print way too much + // if(G.f & G_DEBUG) printf("expand_doit: other lib %s\n", lib->name); /* for outliner dependency only */ ptr->curlib->parent= mainvar->curlib; @@ -10706,7 +10707,8 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old) /*oldnewmap_insert(fd->libmap, bhead->old, id, 1);*/ change_idid_adr_fd(fd, bhead->old, id); - if(G.f & G_DEBUG) printf("expand_doit: already linked: %s lib: %s\n", id->name, lib->name); + // commented because this can print way too much + // if(G.f & G_DEBUG) printf("expand_doit: already linked: %s lib: %s\n", id->name, lib->name); } MEM_freeN(lib); -- cgit v1.2.3 From b34a0fd18ad1476ba655c1c2aa84abb3d5384166 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 19 Jan 2010 02:47:44 +0000 Subject: Partial fix for issues in [#20564] Color Management/Linear Workflow not taken into account in Preview Render anymore? --- source/blender/blenloader/intern/readfile.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3bb94ecf169..8975dcd4c67 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10136,7 +10136,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) Scene *sce=main->scene.first; Material *ma=main->mat.first; World *wo=main->world.first; - int convert=0; + Tex *tex=main->tex.first; + int i, convert=0; /* convert to new color management system: while previously colors were stored as srgb, @@ -10152,6 +10153,21 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if (convert) { while(ma) { + if (ma->ramp_col) { + ColorBand *band = (ColorBand *)ma->ramp_col; + for (i=0; itot; i++) { + CBData *data = band->data + i; + srgb_to_linearrgb_v3_v3(&data->r, &data->r); + } + } + if (ma->ramp_spec) { + ColorBand *band = (ColorBand *)ma->ramp_spec; + for (i=0; itot; i++) { + CBData *data = band->data + i; + srgb_to_linearrgb_v3_v3(&data->r, &data->r); + } + } + srgb_to_linearrgb_v3_v3(&ma->r, &ma->r); srgb_to_linearrgb_v3_v3(&ma->specr, &ma->specr); srgb_to_linearrgb_v3_v3(&ma->mirr, &ma->mirr); @@ -10159,6 +10175,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ma=ma->id.next; } + while(tex) { + if (tex->coba) { + ColorBand *band = (ColorBand *)tex->coba; + for (i=0; itot; i++) { + CBData *data = band->data + i; + srgb_to_linearrgb_v3_v3(&data->r, &data->r); + } + } + tex=tex->id.next; + } + while(wo) { srgb_to_linearrgb_v3_v3(&wo->ambr, &wo->ambr); srgb_to_linearrgb_v3_v3(&wo->horr, &wo->horr); -- cgit v1.2.3 From 7759fc2983422ef234b1d9a2bcdbc4c7e6265071 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 19 Jan 2010 11:31:49 +0000 Subject: Motion Paths - (Part 3) Operators, Drawing, and Fixes This commit makes the new-style Motion Paths work for Objects and Bones. Motion Paths can either be added for Objects (Object buttons) or for Selected Bones in PoseMode (Armature Buttons), and/or removed from these panels too. Changes: * Changed the way the baking code worked, since it was better to be able to bake a bunch of objects at once, instead of doing it per object * Fixed a variety of bugs regarding initialising defaults and reading old files * Added operators for Objects (like for bones), and replaced the existing code for bones. * Fixed bug with baking code that was causing it to bake the wrong ranges Todos: * Frame number drawing is currently messed up, since the "cached" text drawing takes into account the object transforms. * The new MotionPath panels currently appear as the first panels in the respective contexts, probably due to the order in which the files are included. This needs some fixing, though not sure what the best way is yet. --- source/blender/blenloader/intern/readfile.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 8975dcd4c67..96b2b793267 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10381,9 +10381,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main) avs->ghost_sf= arm->ghostsf; avs->ghost_ef= arm->ghostef; + if ((avs->ghost_sf == avs->ghost_ef) && (avs->ghost_sf == 0)) { + avs->ghost_sf= 1; + avs->ghost_ef= 100; + } /* type */ - avs->ghost_type= arm->ghosttype; + if (arm->ghostep == 0) + avs->ghost_type= GHOST_TYPE_NONE; + else + avs->ghost_type= arm->ghosttype + 1; /* stepsize */ avs->ghost_step= arm->ghostsize; @@ -10394,9 +10401,15 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* ranges */ avs->path_bc= arm->pathbc; avs->path_ac= arm->pathac; + if ((avs->path_bc == avs->path_ac) && (avs->path_bc == 0)) + avs->path_bc= avs->path_ac= 10; avs->path_sf= arm->pathsf; avs->path_ef= arm->pathef; + if ((avs->path_sf == avs->path_ef) && (avs->path_sf == 0)) { + avs->path_sf= 1; + avs->path_ef= 250; + } /* flags */ if (arm->pathflag & ARM_PATH_FNUMS) @@ -10419,6 +10432,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if (avs->path_step == 0) avs->path_step= 1; } + else + animviz_settings_init(&ob->pose->avs); } } -- cgit v1.2.3 From ccb6e1904abf358c0f999019ffd62d407ecc920b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 19 Jan 2010 22:44:43 +0000 Subject: =?UTF-8?q?patch=20from=20Bj=C3=B8rnar=20Hansen=20(anachron)=20Mul?= =?UTF-8?q?tiple=20background=20images=20displaying=20each=20on=20a=20diff?= =?UTF-8?q?erent=20axis.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes made from the original patch. - Use an enum rather then multiple booleans. - Reduced the space taken up by the user interface. - Made the image template compact display not show fields & premul options. - Added readfile.c lines so old blendfile images are loaded. - Option to hide BGpic UI (like modifiers & constraints) - Use the index rather then a bgpic from the context for the remove operator. note: could be good to use 1 image for both left+right, for eg, but for this to work as intended we would need to add image flipping depending on the axis so left this commented out for now. --- source/blender/blenloader/intern/readfile.c | 38 +++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 8 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 96b2b793267..11a9a6efff5 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4630,12 +4630,20 @@ static void lib_link_screen(FileData *fd, Main *main) for (sl= sa->spacedata.first; sl; sl= sl->next) { if(sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D*) sl; + BGpic *bgpic; v3d->camera= newlibadr(fd, sc->id.lib, v3d->camera); v3d->ob_centre= newlibadr(fd, sc->id.lib, v3d->ob_centre); + /* should be do_versions but not easy adding into the listbase */ if(v3d->bgpic) { - v3d->bgpic->ima= newlibadr_us(fd, sc->id.lib, v3d->bgpic->ima); + v3d->bgpic= newlibadr(fd, sc->id.lib, v3d->bgpic); + BLI_addtail(&v3d->bgpicbase, bgpic); + v3d->bgpic= NULL; + } + + for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) { + bgpic->ima= newlibadr_us(fd, sc->id.lib, bgpic->ima); } if(v3d->localvd) { v3d->localvd->camera= newlibadr(fd, sc->id.lib, v3d->localvd->camera); @@ -4809,14 +4817,15 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) for (sl= sa->spacedata.first; sl; sl= sl->next) { if(sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D*) sl; + BGpic *bgpic; v3d->camera= restore_pointer_by_name(newmain, (ID *)v3d->camera, 1); if(v3d->camera==NULL) v3d->camera= sc->scene->camera; v3d->ob_centre= restore_pointer_by_name(newmain, (ID *)v3d->ob_centre, 1); - if(v3d->bgpic) { - v3d->bgpic->ima= restore_pointer_by_name(newmain, (ID *)v3d->bgpic->ima, 1); + for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) { + bgpic->ima= restore_pointer_by_name(newmain, (ID *)bgpic->ima, 1); } if(v3d->localvd) { /*Base *base;*/ @@ -5089,10 +5098,22 @@ static void direct_link_screen(FileData *fd, bScreen *sc) if (sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D*) sl; - v3d->bgpic= newdataadr(fd, v3d->bgpic); + BGpic *bgpic; + v3d->flag |= V3D_INVALID_BACKBUF; - if(v3d->bgpic) - v3d->bgpic->iuser.ok= 1; + + link_list(fd, &(v3d->bgpicbase)); + + /* should be do_versions except this doesnt fit well there */ + if(v3d->bgpic) { + bgpic= newdataadr(fd, v3d->bgpic); + BLI_addtail(&v3d->bgpicbase, bgpic); + v3d->bgpic= NULL; + } + + for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) + bgpic->iuser.ok= 1; + if(v3d->gpd) { v3d->gpd= newdataadr(fd, v3d->gpd); direct_link_gpencil(fd, v3d->gpd); @@ -8350,8 +8371,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ((SpaceImage *)sl)->iuser.fie_ima= 2; else if(sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D *)sl; - if(v3d->bgpic) - v3d->bgpic->iuser.fie_ima= 2; + BGpic *bgpic; + for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) + bgpic->iuser.fie_ima= 2; } } } -- cgit v1.2.3 From 9857ffde31725b085d24a09f1bbfe7ae1bb839d8 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 20 Jan 2010 18:27:19 +0000 Subject: Bugfix: copying drivers did not set compiled expression to NULL, also tweak to set it to NULL on file read instead of write as is done usually. --- source/blender/blenloader/intern/readfile.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 11a9a6efff5..5b75912aa2a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1780,6 +1780,8 @@ static void direct_link_fcurves(FileData *fd, ListBase *list) if (fcu->driver) { ChannelDriver *driver= fcu->driver; DriverVar *dvar; + + driver->expr_comp= NULL; /* relink variables, targets and their paths */ link_list(fd, &driver->variables); -- cgit v1.2.3 From 3e1783c715201320caf87b3660bd590892277ae2 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 21 Jan 2010 00:00:45 +0000 Subject: New Compositor node: Hue Control Was very quick to do, now re-aquainted with node editor. http://mke3.net/blender/devel/2.5/hue_correct_node.jpg Todo: modes for affecting hue and value on the vertical axis as well as just saturation - or if an enterprising coder wants to give it a go, let me know and I can help :) --- source/blender/blenloader/intern/readfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5b75912aa2a..c8bcc43086e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2102,7 +2102,7 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree) if(ntree->type==NTREE_SHADER && (node->type==SH_NODE_CURVE_VEC || node->type==SH_NODE_CURVE_RGB)) direct_link_curvemapping(fd, node->storage); else if(ntree->type==NTREE_COMPOSIT) { - if( ELEM3(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB)) + if( ELEM4(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT)) direct_link_curvemapping(fd, node->storage); else if(ELEM3(node->type, CMP_NODE_IMAGE, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) ((ImageUser *)node->storage)->ok= 1; -- cgit v1.2.3 From 96b5658d0cd33b02cb6668670b7706b8897c0460 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Fri, 22 Jan 2010 04:21:46 +0000 Subject: Fix [#20756] Texture painting on 3D tends to forget textures in the new texture menu. Part of this fix (loading files with brushes/textures) will only apply for new files saved after this commit --- source/blender/blenloader/intern/readfile.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c8bcc43086e..7ba17ced089 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10373,9 +10373,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - /* put 2.50 compatibility code here until next subversion bump */ - - if (1) { + if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 12)) + { Scene *sce; Object *ob; Brush *brush; @@ -10475,6 +10474,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + + + /* put 2.50 compatibility code here until next subversion bump */ + if (1) { + ; + } /* 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 f66d5a7b77d0f7a1eb2d530cb58509e52554b8e9 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 23 Jan 2010 03:57:11 +0000 Subject: Animation Editors: DopeSheet filtering option to only include Objects that are members of the specified group Between the datablock filtering options and the auto-snapping menu in the headers of Animation Editors, there is a new toggle for enabling this new feature (only when there are groups in the scene). Enabling this, a field to enter/select a group in the scene to filter with, will appear beside it. This feature has been added to make it easier to manage animating multiple character shots in Durian. By assigning the rigs of several bandits to a single group, or Sintel and her staff to another group, or Sintel and the guardians to another group, and so on, it is possible to filter the animation data shown in the editors to a useful subset of the total motion in the scene. This makes it easier to retime or edit the motions of one set of characters and their props without affecting the motions of other no-related objects. The downside is that there is a bit more setup work required upfront, but that's probably a small price to pay for some groupings that may be useful in other ways too later (perhaps for compositing or lighting work). --- source/blender/blenloader/intern/readfile.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 7ba17ced089..b10c13eef8d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4653,9 +4653,12 @@ static void lib_link_screen(FileData *fd, Main *main) } else if(sl->spacetype==SPACE_IPO) { SpaceIpo *sipo= (SpaceIpo *)sl; + bDopeSheet *ads= sipo->ads; - if(sipo->ads) - sipo->ads->source= newlibadr(fd, sc->id.lib, sipo->ads->source); + if (ads) { + ads->source= newlibadr(fd, sc->id.lib, ads->source); + ads->filter_grp= newlibadr(fd, sc->id.lib, ads->filter_grp); + } } else if(sl->spacetype==SPACE_BUTS) { SpaceButs *sbuts= (SpaceButs *)sl; @@ -4686,8 +4689,14 @@ static void lib_link_screen(FileData *fd, Main *main) } else if(sl->spacetype==SPACE_ACTION) { SpaceAction *saction= (SpaceAction *)sl; + bDopeSheet *ads= &saction->ads; + + if (ads) { + ads->source= newlibadr(fd, sc->id.lib, ads->source); + ads->filter_grp= newlibadr(fd, sc->id.lib, ads->filter_grp); + } + saction->action = newlibadr(fd, sc->id.lib, saction->action); - saction->ads.source= newlibadr(fd, sc->id.lib, saction->ads.source); } else if(sl->spacetype==SPACE_IMAGE) { SpaceImage *sima= (SpaceImage *)sl; @@ -4695,7 +4704,13 @@ static void lib_link_screen(FileData *fd, Main *main) sima->image= newlibadr_us(fd, sc->id.lib, sima->image); } else if(sl->spacetype==SPACE_NLA){ - /* SpaceNla *snla= (SpaceNla *)sl; */ + SpaceNla *snla= (SpaceNla *)sl; + bDopeSheet *ads= snla->ads; + + if (ads) { + ads->source= newlibadr(fd, sc->id.lib, ads->source); + ads->filter_grp= newlibadr(fd, sc->id.lib, ads->filter_grp); + } } else if(sl->spacetype==SPACE_TEXT) { SpaceText *st= (SpaceText *)sl; -- cgit v1.2.3 From 0c5998e7998cba70d1dceacc5ed8109a5bba9e23 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 25 Jan 2010 06:24:05 +0000 Subject: Radians -> Degrees (in UI) Rotations are now stored internally as radians, while exposing degrees in the UI - in the graph editor and UI controls. This is done in two areas: 1) Using the unit system to convert RNA data to display as degrees in the UI controls 2) FCurves now use degrees for rotation, so you can edit in the graph editor what you see in the UI. All rotation data is consistently accessible in DNA and RNA as radians, degrees are only used for the UI controls and graph editor. This commit includes conversions will convert old files (stored data and also fcurve data) to the new units, hopefully everything should go smoothly! Part of this also changes a few properties that were hard-coded as degrees before (such as IK pole angle and brush texture rotation) to also use the same consistent system of radians (dna/rna) and degrees (ui). Thanks to Joshua for hints and review here too. --- source/blender/blenloader/intern/readfile.c | 87 ++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index b10c13eef8d..dcebd5d69e2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6439,6 +6439,30 @@ static void do_version_mtex_factor_2_50(MTex **mtex_array, short idtype) } } +static void do_version_fcurve_radians_degrees_250(FCurve *fcu) +{ + int i; + + if (fcu->bezt) { + for (i=0; itotvert; i++) { + BezTriple *bt = fcu->bezt+i; + + bt->vec[0][1] *= 180.0/M_PI; + bt->vec[1][1] *= 180.0/M_PI; + bt->vec[2][1] *= 180.0/M_PI; + } + } + else if (fcu->fpt) { + for (i=0; itotvert; i++) { + FPoint *fpt = fcu->fpt+i; + + fpt->vec[1] *= 180.0/M_PI; + } + } + + fcu->flag |= FCURVE_ROTATION_DEGREES; +} + static void do_versions(FileData *fd, Library *lib, Main *main) { /* WATCH IT!!!: pointers from libdata have not been converted */ @@ -10493,7 +10517,68 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* put 2.50 compatibility code here until next subversion bump */ if (1) { - ; + { + /* still missing: + - Pose channel IK (min x/y/z, max x/y/z) + */ + bAction *act; + Object *ob; + + float rads_per_deg = M_PI / 180.0; + + /* convert degrees to radians for internal use */ + for (ob=main->object.first; ob; ob=ob->id.next) { + AnimData *adt = BKE_animdata_from_id((ID *)ob); + bConstraint *con; + + for (con=ob->constraints.first; con; con=con->next) { + + if(con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) { + bRigidBodyJointConstraint *data = con->data; + data->axX *= rads_per_deg; + data->axY *= rads_per_deg; + data->axZ *= rads_per_deg; + } + else if(con->type==CONSTRAINT_TYPE_KINEMATIC) { + bKinematicConstraint *data = con->data; + data->poleangle *= rads_per_deg; + } + else if(con->type==CONSTRAINT_TYPE_ROTLIMIT) { + bRotLimitConstraint *data = con->data; + FCurve *fcu; + + /* do it here, slightly less chance of getting a false positive */ + for (fcu=adt->action->curves.first; fcu; fcu=fcu->next) { + if (strcmp(fcu->rna_path, "minimum_x")==0) + do_version_fcurve_radians_degrees_250(fcu); + } + + data->xmin *= rads_per_deg; + data->xmax *= rads_per_deg; + data->ymin *= rads_per_deg; + data->ymax *= rads_per_deg; + data->zmin *= rads_per_deg; + data->zmax *= rads_per_deg; + + } + } + } + + /* convert fcurve values to be stored in degrees */ + for (act = main->action.first; act; act=act->id.next) { + FCurve *fcu; + + /* convert over named properties with PROP_UNIT_ROTATION time of this change */ + for (fcu=act->curves.first; fcu; fcu=fcu->next) { + if (strcmp(fcu->rna_path, "rotation_euler")==0) + do_version_fcurve_radians_degrees_250(fcu); + else if (strcmp(fcu->rna_path, "delta_rotation_euler")==0) + do_version_fcurve_radians_degrees_250(fcu); + else if (strcmp(fcu->rna_path, "pole_angle")==0) + do_version_fcurve_radians_degrees_250(fcu); + } + } + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ -- cgit v1.2.3 From 3b446ed4e45fccc0e4a6fc998a28442b5429a209 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 25 Jan 2010 11:06:55 +0000 Subject: Durian Request/Bugfixes: Graph Editor Zooming doesn't go far enough Pushed limits for Graph Editor view extents to proper limits, and fixed clamping used in View2D code which was preventing height of View2D viewports from getting below 1.0 --- source/blender/blenloader/intern/readfile.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index dcebd5d69e2..5fda492728c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4632,7 +4632,7 @@ static void lib_link_screen(FileData *fd, Main *main) for (sl= sa->spacedata.first; sl; sl= sl->next) { if(sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D*) sl; - BGpic *bgpic; + BGpic *bgpic = NULL; v3d->camera= newlibadr(fd, sc->id.lib, v3d->camera); v3d->ob_centre= newlibadr(fd, sc->id.lib, v3d->ob_centre); @@ -6184,7 +6184,13 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) /* init mainarea view2d */ ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); ar->v2d.scroll |= (V2D_SCROLL_LEFT|V2D_SCROLL_SCALE_VERTICAL); - + + ar->v2d.min[0]= FLT_MIN; + ar->v2d.min[1]= FLT_MIN; + + ar->v2d.max[0]= MAXFRAMEF; + ar->v2d.max[1]= FLT_MAX; + //ar->v2d.flag |= V2D_IS_INITIALISED; break; } -- cgit v1.2.3 From 8961ef09ec968f54cbca493295ca8381444317ed Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 25 Jan 2010 11:09:41 +0000 Subject: Bugfix for Rotation Keyframe version patching: Use strstr not strcmp, since RNA paths are not purely property names. --- source/blender/blenloader/intern/readfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5fda492728c..9d036d93831 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10576,11 +10576,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* convert over named properties with PROP_UNIT_ROTATION time of this change */ for (fcu=act->curves.first; fcu; fcu=fcu->next) { - if (strcmp(fcu->rna_path, "rotation_euler")==0) + if (strstr(fcu->rna_path, "rotation_euler")==0) do_version_fcurve_radians_degrees_250(fcu); - else if (strcmp(fcu->rna_path, "delta_rotation_euler")==0) + else if (strstr(fcu->rna_path, "delta_rotation_euler")==0) do_version_fcurve_radians_degrees_250(fcu); - else if (strcmp(fcu->rna_path, "pole_angle")==0) + else if (strstr(fcu->rna_path, "pole_angle")==0) do_version_fcurve_radians_degrees_250(fcu); } } -- cgit v1.2.3 From aab5a7a4af19335f07231b30f86df8d2fc7bc9e7 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 25 Jan 2010 11:15:04 +0000 Subject: Bleh... second attempt at getting this right! --- source/blender/blenloader/intern/readfile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 9d036d93831..cb17b3332b7 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10555,7 +10555,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* do it here, slightly less chance of getting a false positive */ for (fcu=adt->action->curves.first; fcu; fcu=fcu->next) { - if (strcmp(fcu->rna_path, "minimum_x")==0) + if (strstr(fcu->rna_path, "minimum_x")) do_version_fcurve_radians_degrees_250(fcu); } @@ -10576,11 +10576,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* convert over named properties with PROP_UNIT_ROTATION time of this change */ for (fcu=act->curves.first; fcu; fcu=fcu->next) { - if (strstr(fcu->rna_path, "rotation_euler")==0) + if (strstr(fcu->rna_path, "rotation_euler")) do_version_fcurve_radians_degrees_250(fcu); - else if (strstr(fcu->rna_path, "delta_rotation_euler")==0) + else if (strstr(fcu->rna_path, "delta_rotation_euler")) do_version_fcurve_radians_degrees_250(fcu); - else if (strstr(fcu->rna_path, "pole_angle")==0) + else if (strstr(fcu->rna_path, "pole_angle")) do_version_fcurve_radians_degrees_250(fcu); } } -- cgit v1.2.3 From 52284155e1a9b0935c91a55009f16132622c964c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 Jan 2010 17:24:04 +0000 Subject: undo would often crash when filter_group was used. conversion wasnt included in lib_link_screen_restore --- source/blender/blenloader/intern/readfile.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index cb17b3332b7..492321d9ed9 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4869,10 +4869,11 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) } else if(sl->spacetype==SPACE_IPO) { - /* XXX animato */ -#if 0 SpaceIpo *sipo= (SpaceIpo *)sl; + bDopeSheet *ads= sipo->ads; + /* XXX animato */ +#if 0 sipo->ipo= restore_pointer_by_name(newmain, (ID *)sipo->ipo, 0); if(sipo->blocktype==ID_SEQ) sipo->from= (ID *)find_sequence_from_ipo_helper(newmain, sipo->ipo); @@ -4882,7 +4883,11 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) // not free sipo->ipokey, creates dependency with src/ if(sipo->editipo) MEM_freeN(sipo->editipo); sipo->editipo= NULL; + #endif + if (ads->filter_grp) { + ads->filter_grp= restore_pointer_by_name(newmain, (ID *)ads->filter_grp, 0); + } } else if(sl->spacetype==SPACE_BUTS) { SpaceButs *sbuts= (SpaceButs *)sl; @@ -4908,6 +4913,10 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) SpaceAction *saction= (SpaceAction *)sl; saction->action = restore_pointer_by_name(newmain, (ID *)saction->action, 1); saction->ads.source= restore_pointer_by_name(newmain, (ID *)saction->ads.source, 1); + + if(saction->ads.filter_grp) { + saction->ads.filter_grp= restore_pointer_by_name(newmain, (ID *)saction->ads.filter_grp, 0); + } } else if(sl->spacetype==SPACE_IMAGE) { SpaceImage *sima= (SpaceImage *)sl; @@ -4915,7 +4924,12 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) sima->image= restore_pointer_by_name(newmain, (ID *)sima->image, 1); } else if(sl->spacetype==SPACE_NLA){ - /* SpaceNla *snla= (SpaceNla *)sl; */ + SpaceNla *snla= (SpaceNla *)sl; + bDopeSheet *ads= snla->ads; + + if (ads->filter_grp) { + ads->filter_grp= restore_pointer_by_name(newmain, (ID *)ads->filter_grp, 0); + } } else if(sl->spacetype==SPACE_TEXT) { SpaceText *st= (SpaceText *)sl; -- cgit v1.2.3 From 905a238075ca9660fbf41476c373c3723e8b7e0a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 25 Jan 2010 17:51:21 +0000 Subject: Fix for radians-degrees version patch, more testing should have gone into this before committing: * Subversion was not increased, meaning that conversion would be applied even on files saved with the new version. * Drivers were not converted. * FCurve generator modifiers were not converted. This seems to cover all cases we found for Durian, if another conversion is needed for this, be sure to increase the subversion number and do it in a separate if() test, otherwise files will break. --- source/blender/blenloader/intern/readfile.c | 158 +++++++++++++++------------- 1 file changed, 86 insertions(+), 72 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 492321d9ed9..30a5b647fe1 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6459,28 +6459,43 @@ static void do_version_mtex_factor_2_50(MTex **mtex_array, short idtype) } } -static void do_version_fcurve_radians_degrees_250(FCurve *fcu) +static void do_version_fcurves_radians_degrees_250(ListBase *lb, char *propname) { + FCurve *fcu; + FModifier *fcm; int i; - if (fcu->bezt) { - for (i=0; itotvert; i++) { - BezTriple *bt = fcu->bezt+i; - - bt->vec[0][1] *= 180.0/M_PI; - bt->vec[1][1] *= 180.0/M_PI; - bt->vec[2][1] *= 180.0/M_PI; - } - } - else if (fcu->fpt) { - for (i=0; itotvert; i++) { - FPoint *fpt = fcu->fpt+i; + for (fcu=lb->first; fcu; fcu=fcu->next) { + if (strstr(fcu->rna_path, propname)) { + if (fcu->bezt) { + for (i=0; itotvert; i++) { + BezTriple *bt = fcu->bezt+i; + + bt->vec[0][1] *= 180.0/M_PI; + bt->vec[1][1] *= 180.0/M_PI; + bt->vec[2][1] *= 180.0/M_PI; + } + } + else if (fcu->fpt) { + for (i=0; itotvert; i++) { + FPoint *fpt = fcu->fpt+i; + + fpt->vec[1] *= 180.0/M_PI; + } + } - fpt->vec[1] *= 180.0/M_PI; + for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) { + if (fcm->type == FMODIFIER_TYPE_GENERATOR) { + FMod_Generator *data= (FMod_Generator *)fcm->data; + + for (i=0; iarraysize; i++) + data->coefficients[i] *= 180/M_PI; + } + } + + fcu->flag |= FCURVE_ROTATION_DEGREES; } } - - fcu->flag |= FCURVE_ROTATION_DEGREES; } static void do_versions(FileData *fd, Library *lib, Main *main) @@ -10536,69 +10551,68 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* put 2.50 compatibility code here until next subversion bump */ - if (1) { - { - /* still missing: - - Pose channel IK (min x/y/z, max x/y/z) - */ - bAction *act; - Object *ob; - - float rads_per_deg = M_PI / 180.0; - - /* convert degrees to radians for internal use */ - for (ob=main->object.first; ob; ob=ob->id.next) { - AnimData *adt = BKE_animdata_from_id((ID *)ob); - bConstraint *con; - - for (con=ob->constraints.first; con; con=con->next) { - - if(con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) { - bRigidBodyJointConstraint *data = con->data; - data->axX *= rads_per_deg; - data->axY *= rads_per_deg; - data->axZ *= rads_per_deg; - } - else if(con->type==CONSTRAINT_TYPE_KINEMATIC) { - bKinematicConstraint *data = con->data; - data->poleangle *= rads_per_deg; - } - else if(con->type==CONSTRAINT_TYPE_ROTLIMIT) { - bRotLimitConstraint *data = con->data; - FCurve *fcu; - - /* do it here, slightly less chance of getting a false positive */ - for (fcu=adt->action->curves.first; fcu; fcu=fcu->next) { - if (strstr(fcu->rna_path, "minimum_x")) - do_version_fcurve_radians_degrees_250(fcu); - } - - data->xmin *= rads_per_deg; - data->xmax *= rads_per_deg; - data->ymin *= rads_per_deg; - data->ymax *= rads_per_deg; - data->zmin *= rads_per_deg; - data->zmax *= rads_per_deg; + if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 13)) { + /* still missing: - Pose channel IK (min x/y/z, max x/y/z) + NOTE: if you do more conversion, be sure to do it outside of this and + increase subversion again, otherwise it will not be correct */ + bAction *act; + Object *ob; + + float rads_per_deg = M_PI / 180.0; + + /* convert degrees to radians for internal use */ + for (ob=main->object.first; ob; ob=ob->id.next) { + AnimData *adt = BKE_animdata_from_id((ID *)ob); + bConstraint *con; - } - } + if(adt) { + do_version_fcurves_radians_degrees_250(&adt->drivers, "rotation_euler"); + do_version_fcurves_radians_degrees_250(&adt->drivers, "delta_rotation_euler"); + do_version_fcurves_radians_degrees_250(&adt->drivers, "pole_angle"); } - /* convert fcurve values to be stored in degrees */ - for (act = main->action.first; act; act=act->id.next) { - FCurve *fcu; + for (con=ob->constraints.first; con; con=con->next) { - /* convert over named properties with PROP_UNIT_ROTATION time of this change */ - for (fcu=act->curves.first; fcu; fcu=fcu->next) { - if (strstr(fcu->rna_path, "rotation_euler")) - do_version_fcurve_radians_degrees_250(fcu); - else if (strstr(fcu->rna_path, "delta_rotation_euler")) - do_version_fcurve_radians_degrees_250(fcu); - else if (strstr(fcu->rna_path, "pole_angle")) - do_version_fcurve_radians_degrees_250(fcu); + if(con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) { + bRigidBodyJointConstraint *data = con->data; + data->axX *= rads_per_deg; + data->axY *= rads_per_deg; + data->axZ *= rads_per_deg; + } + else if(con->type==CONSTRAINT_TYPE_KINEMATIC) { + bKinematicConstraint *data = con->data; + data->poleangle *= rads_per_deg; + } + else if(con->type==CONSTRAINT_TYPE_ROTLIMIT) { + bRotLimitConstraint *data = con->data; + + if(adt) { + do_version_fcurves_radians_degrees_250(&adt->action->curves, "minimum_x"); + do_version_fcurves_radians_degrees_250(&adt->action->curves, "minimum_y"); + do_version_fcurves_radians_degrees_250(&adt->action->curves, "minimum_z"); + do_version_fcurves_radians_degrees_250(&adt->action->curves, "maximum_x"); + do_version_fcurves_radians_degrees_250(&adt->action->curves, "maximum_y"); + do_version_fcurves_radians_degrees_250(&adt->action->curves, "maximum_z"); + } + + data->xmin *= rads_per_deg; + data->xmax *= rads_per_deg; + data->ymin *= rads_per_deg; + data->ymax *= rads_per_deg; + data->zmin *= rads_per_deg; + data->zmax *= rads_per_deg; + } } } + + /* convert fcurve values to be stored in degrees */ + for (act = main->action.first; act; act=act->id.next) { + /* convert over named properties with PROP_UNIT_ROTATION time of this change */ + do_version_fcurves_radians_degrees_250(&act->curves, "rotation_euler"); + do_version_fcurves_radians_degrees_250(&act->curves, "delta_rotation_euler"); + do_version_fcurves_radians_degrees_250(&act->curves, "pole_angle"); + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ -- cgit v1.2.3 From c72fcc759bd8481033631a30be57befe54492496 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 25 Jan 2010 18:38:09 +0000 Subject: More fixes for radians-degrees, wasn't converting pose channel constraints properly yet, also did conversion ik min/max limits. --- source/blender/blenloader/intern/readfile.c | 81 ++++++++++++++++------------- 1 file changed, 44 insertions(+), 37 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 30a5b647fe1..141fcce96ac 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6497,6 +6497,35 @@ static void do_version_fcurves_radians_degrees_250(ListBase *lb, char *propname) } } } + +static void do_version_constraints_radians_degrees_250(ListBase *lb) +{ + bConstraint *con; + + /* fcurves for this are not converted, assumption is these were unlikely to be used */ + for (con=lb->first; con; con=con->next) { + if(con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) { + bRigidBodyJointConstraint *data = con->data; + data->axX *= M_PI/180.0; + data->axY *= M_PI/180.0; + data->axZ *= M_PI/180.0; + } + else if(con->type==CONSTRAINT_TYPE_KINEMATIC) { + bKinematicConstraint *data = con->data; + data->poleangle *= M_PI/180.0; + } + else if(con->type==CONSTRAINT_TYPE_ROTLIMIT) { + bRotLimitConstraint *data = con->data; + + data->xmin *= M_PI/180.0; + data->xmax *= M_PI/180.0; + data->ymin *= M_PI/180.0; + data->ymax *= M_PI/180.0; + data->zmin *= M_PI/180.0; + data->zmax *= M_PI/180.0; + } + } +} static void do_versions(FileData *fd, Library *lib, Main *main) { @@ -10552,56 +10581,34 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* put 2.50 compatibility code here until next subversion bump */ if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 13)) { - /* still missing: - Pose channel IK (min x/y/z, max x/y/z) - NOTE: if you do more conversion, be sure to do it outside of this and + /* NOTE: if you do more conversion, be sure to do it outside of this and increase subversion again, otherwise it will not be correct */ - bAction *act; Object *ob; - - float rads_per_deg = M_PI / 180.0; + bAction *act; /* convert degrees to radians for internal use */ for (ob=main->object.first; ob; ob=ob->id.next) { AnimData *adt = BKE_animdata_from_id((ID *)ob); - bConstraint *con; + bPoseChannel *pchan; - if(adt) { + if (adt) { do_version_fcurves_radians_degrees_250(&adt->drivers, "rotation_euler"); do_version_fcurves_radians_degrees_250(&adt->drivers, "delta_rotation_euler"); do_version_fcurves_radians_degrees_250(&adt->drivers, "pole_angle"); } - - for (con=ob->constraints.first; con; con=con->next) { - - if(con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) { - bRigidBodyJointConstraint *data = con->data; - data->axX *= rads_per_deg; - data->axY *= rads_per_deg; - data->axZ *= rads_per_deg; - } - else if(con->type==CONSTRAINT_TYPE_KINEMATIC) { - bKinematicConstraint *data = con->data; - data->poleangle *= rads_per_deg; - } - else if(con->type==CONSTRAINT_TYPE_ROTLIMIT) { - bRotLimitConstraint *data = con->data; - - if(adt) { - do_version_fcurves_radians_degrees_250(&adt->action->curves, "minimum_x"); - do_version_fcurves_radians_degrees_250(&adt->action->curves, "minimum_y"); - do_version_fcurves_radians_degrees_250(&adt->action->curves, "minimum_z"); - do_version_fcurves_radians_degrees_250(&adt->action->curves, "maximum_x"); - do_version_fcurves_radians_degrees_250(&adt->action->curves, "maximum_y"); - do_version_fcurves_radians_degrees_250(&adt->action->curves, "maximum_z"); - } - data->xmin *= rads_per_deg; - data->xmax *= rads_per_deg; - data->ymin *= rads_per_deg; - data->ymax *= rads_per_deg; - data->zmin *= rads_per_deg; - data->zmax *= rads_per_deg; + do_version_constraints_radians_degrees_250(&ob->constraints); + if (ob->pose) { + for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) { + pchan->limitmin[0] *= M_PI/180.0; + pchan->limitmin[1] *= M_PI/180.0; + pchan->limitmin[2] *= M_PI/180.0; + pchan->limitmax[0] *= M_PI/180.0; + pchan->limitmax[1] *= M_PI/180.0; + pchan->limitmax[2] *= M_PI/180.0; + + do_version_constraints_radians_degrees_250(&pchan->constraints); } } } -- cgit v1.2.3 From 14d4feca576e78d3707872bfb8b29c749bb20572 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 26 Jan 2010 03:16:14 +0000 Subject: Radians vs Degrees: The Second Attempt F-Curves now internally store radians again instead of degrees. - This solves problems with inconsistencies when working with drivers. - No need to version patch old files, potentially screwing them up. As such, removed the version patching for F-Curves. - Is better suited to optionally showing radians throughout the UI instead or degrees. As a result, values are now converted on the fly in the Graph Editor for display and operators that operate on values. I've made the conversion system for this rather general, so that other unit type conversions can also be hooked up with the type conversion backend. Also, made some tweaks to F-Curve RNA wrapping to make it represent the data better. TODO: - Transform code currently still needs to be corrected to work with these changes. Currently moving keyframes for rotation curves will make them change too rapidly vertically when using degrees. --- source/blender/blenloader/intern/readfile.c | 65 +++-------------------------- 1 file changed, 6 insertions(+), 59 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 141fcce96ac..46051555a81 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6459,50 +6459,10 @@ static void do_version_mtex_factor_2_50(MTex **mtex_array, short idtype) } } -static void do_version_fcurves_radians_degrees_250(ListBase *lb, char *propname) -{ - FCurve *fcu; - FModifier *fcm; - int i; - - for (fcu=lb->first; fcu; fcu=fcu->next) { - if (strstr(fcu->rna_path, propname)) { - if (fcu->bezt) { - for (i=0; itotvert; i++) { - BezTriple *bt = fcu->bezt+i; - - bt->vec[0][1] *= 180.0/M_PI; - bt->vec[1][1] *= 180.0/M_PI; - bt->vec[2][1] *= 180.0/M_PI; - } - } - else if (fcu->fpt) { - for (i=0; itotvert; i++) { - FPoint *fpt = fcu->fpt+i; - - fpt->vec[1] *= 180.0/M_PI; - } - } - - for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) { - if (fcm->type == FMODIFIER_TYPE_GENERATOR) { - FMod_Generator *data= (FMod_Generator *)fcm->data; - - for (i=0; iarraysize; i++) - data->coefficients[i] *= 180/M_PI; - } - } - - fcu->flag |= FCURVE_ROTATION_DEGREES; - } - } -} - static void do_version_constraints_radians_degrees_250(ListBase *lb) { bConstraint *con; - /* fcurves for this are not converted, assumption is these were unlikely to be used */ for (con=lb->first; con; con=con->next) { if(con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) { bRigidBodyJointConstraint *data = con->data; @@ -10578,25 +10538,15 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } - - /* put 2.50 compatibility code here until next subversion bump */ if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 13)) { /* NOTE: if you do more conversion, be sure to do it outside of this and increase subversion again, otherwise it will not be correct */ Object *ob; - bAction *act; /* convert degrees to radians for internal use */ for (ob=main->object.first; ob; ob=ob->id.next) { - AnimData *adt = BKE_animdata_from_id((ID *)ob); bPoseChannel *pchan; - if (adt) { - do_version_fcurves_radians_degrees_250(&adt->drivers, "rotation_euler"); - do_version_fcurves_radians_degrees_250(&adt->drivers, "delta_rotation_euler"); - do_version_fcurves_radians_degrees_250(&adt->drivers, "pole_angle"); - } - do_version_constraints_radians_degrees_250(&ob->constraints); if (ob->pose) { @@ -10612,18 +10562,15 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } } - - /* convert fcurve values to be stored in degrees */ - for (act = main->action.first; act; act=act->id.next) { - /* convert over named properties with PROP_UNIT_ROTATION time of this change */ - do_version_fcurves_radians_degrees_250(&act->curves, "rotation_euler"); - do_version_fcurves_radians_degrees_250(&act->curves, "delta_rotation_euler"); - do_version_fcurves_radians_degrees_250(&act->curves, "pole_angle"); - } + } + + /* put 2.50 compatibility code here until next subversion bump */ + if (1) { + } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ - /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ + /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */ /* don't forget to set version number in blender.c! */ } -- cgit v1.2.3 From e307f6c6a0476d0ad68aded9033ec4f18532b58a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 26 Jan 2010 13:50:17 +0000 Subject: rename defgroup functions to be more consistant. * no functional changes * --- source/blender/blenloader/intern/readfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 46051555a81..5c09f866b3a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7813,10 +7813,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } if(ob->soft && ob->soft->vertgroup==0) { - bDeformGroup *locGroup = get_named_vertexgroup(ob, "SOFTGOAL"); + bDeformGroup *locGroup = defgroup_find_name(ob, "SOFTGOAL"); if(locGroup){ /* retrieve index for that group */ - ob->soft->vertgroup = 1 + get_defgroup_num(ob, locGroup); + ob->soft->vertgroup = 1 + defgroup_find_index(ob, locGroup); } } } @@ -8502,7 +8502,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for(curdef= ob->defbase.first; curdef; curdef=curdef->next) { /* replace an empty-string name with unique name */ if (curdef->name[0] == '\0') { - unique_vertexgroup_name(curdef, ob); + defgroup_unique_name(curdef, ob); } } -- cgit v1.2.3 From 641774436f08f067939c9d854187da51e12c2454 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 26 Jan 2010 14:00:13 +0000 Subject: am learning bad spelling from blender. grr --- source/blender/blenloader/intern/readfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5c09f866b3a..1309c0b3bf1 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -11987,7 +11987,7 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in Main *mainvar= CTX_data_main(C); Scene *scene= CTX_data_scene(C); - /* make main consistant */ + /* make main consistent */ expand_main(*fd, mainl); /* do this when expand found other libs */ -- cgit v1.2.3 From b119ce5fcc91466c6aeb1232e8bf4dca401adaed Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 26 Jan 2010 18:18:21 +0000 Subject: Drag and drop 2.5 integration! Finally, slashdot regulars can use Blender too now! :) ** Drag works as follows: - drag-able items are defined by the standard interface ui toolkit - each button can get this feature, via uiButSetDragXXX(but, ...). There are calls to define drag-able images, ID blocks, RNA paths, file paths, and so on. By default you drag an icon, exceptionally an ImBuf - Drag items are registered centrally in the WM, it allows more drag items simultaneous too, but not implemented ** Drop works as follows: - On mouse release, and if drag items exist in the WM, it converts the mouse event to an EVT_DROP type. This event then gets the full drag info as customdata - drop regions are defined with WM_dropbox_add(), similar to keymaps you can make a "drop map" this way, which become 'drop map handlers' in the queues. - next to that the UI kit handles some common button types (like accepting ID or names) to be catching a drop event too. - Every "drop box" has two callbacks: - poll() = check if the event drag data is relevant for this box - copy() = fill in custom properties in the dropbox to initialize an operator - The dropbox handler then calls its standard Operator with its dropbox properties. ** Currently implemented Drag items: - ID icons in browse buttons - ID icons in context menu of properties region - ID icons in outliner and rna viewer - FileBrowser icons - FileBrowser preview images Drag-able icons are subtly visualized by making them brighter a bit on mouse-over. In case the icon is a button or UI element too (most cases), the drag-able feature will make the item react to mouse-release instead of mouse-press. Drop options: - UI buttons: ID and text buttons (paste name) - View3d: Object ID drop copies object - View3d: Material ID drop assigns to object under cursor - View3d: Image ID drop assigns to object UV texture under cursor - Sequencer: Path drop will add either Image or Movie strip - Image window: Path drop will open image ** Drag and drop Notes: - Dropping into another Blender window (from same application) works too. I've added code that passes on mousemoves and clicks to other windows, without activating them though. This does make using multi-window Blender a bit friendler. - Dropping a file path to an image, is not the same as dropping an Image ID... keep this in mind. Sequencer for example wants paths to be dropped, textures in 3d window wants an Image ID. - Although drop boxes could be defined via Python, I suggest they're part of the UI and editor design (= how we want an editor to work), and not default offered configurable like keymaps. - At the moment only one item can be dragged at a time. This is for several reasons.... For one, Blender doesn't have a well defined uniform way to define "what is selected" (files, outliner items, etc). Secondly there's potential conflicts on what todo when you drop mixed drag sets on spots. All undefined stuff... nice for later. - Example to bypass the above: a collection of images that form a strip, should be represented in filewindow as a single sequence anyway. This then will fit well and gets handled neatly by design. - Another option to check is to allow multiple options per drop... it could show the operator as a sort of menu, allowing arrow or scrollwheel to choose. For time being I'd prefer to try to design a singular drop though, just offer only one drop action per data type on given spots. - What does work already, but a tad slow, is to use a function that detects an object (type) under cursor, so a drag item's option can be further refined (like drop object on object = parent). (disabled) ** More notes - Added saving for Region layouts (like split points for toolbar) - Label buttons now handle mouse over - File list: added full path entry for drop feature. - Filesel bugfix: wm_operator_exec() got called there and fully handled, while WM event code tried same. Added new OPERATOR_HANDLED flag for this. Maybe python needs it too? - Cocoa: added window move event, so multi-win setups work OK (didnt save). - Interface_handlers.c: removed win->active - Severe area copy bug: area handlers were not set to NULL - Filesel bugfix: next/prev folder list was not copied on area copies ** Leftover todos - Cocoa windows seem to hang on cases still... needs check - Cocoa 'draw overlap' swap doesn't work - Cocoa window loses focus permanently on using Spotlight (for these reasons, makefile building has Carbon as default atm) - ListView templates in UI cannot become dragged yet, needs review... it consists of two overlapping UI elements, preventing handling icon clicks. - There's already Ghost library code to handle dropping from OS into Blender window. I've noticed this code is unfinished for Macs, but seems to be complete for Windows. Needs test... currently, an external drop event will print in console when succesfully delivered to Blender's WM. --- source/blender/blenloader/intern/readfile.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 1309c0b3bf1..26eafa38f8e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4536,6 +4536,7 @@ static void direct_link_windowmanager(FileData *fd, wmWindowManager *wm) wm->defaultconf= NULL; wm->jobs.first= wm->jobs.last= NULL; + wm->drags.first= wm->drags.last= NULL; wm->windrawable= NULL; wm->initialized= 0; -- cgit v1.2.3 From ebafb7e484fa45aed0f4be75cfb5d570d7d43f81 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 Jan 2010 00:01:59 +0000 Subject: bugfix [#20823] Attempting to undo renaming a UV set on this scene causes a crash --- source/blender/blenloader/intern/readfile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 26eafa38f8e..c0f0d7e54da 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4886,8 +4886,10 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) sipo->editipo= NULL; #endif - if (ads->filter_grp) { - ads->filter_grp= restore_pointer_by_name(newmain, (ID *)ads->filter_grp, 0); + if(ads) { + if(ads->filter_grp) { + ads->filter_grp= restore_pointer_by_name(newmain, (ID *)ads->filter_grp, 0); + } } } else if(sl->spacetype==SPACE_BUTS) { -- cgit v1.2.3 From f84f96aee58bfbf014cedc68bf9de81dc0edc0ff Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 27 Jan 2010 11:43:34 +0000 Subject: DopeSheet and NLA Editor Scrollbar/View Bugs: Fixed some long-standing bugs with DopeSheet and NLA Editor main views not being properly lined up with their channels, and/or showing an incorrect scrollbar. This fixes #20759, and probably a few other reports about similar issues that might've cropped up. NOTE: - probably a version bump might be needed after this, to avoid problems on durian animation files? - the default .b.blend needs updating again, since the saved config there doesn't get updated (or doesn't here, when using load factory settings) --- source/blender/blenloader/intern/readfile.c | 37 +++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c0f0d7e54da..c69104f1f74 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6226,6 +6226,9 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) SpaceNla *snla= (SpaceNla *)sl; memcpy(&ar->v2d, &snla->v2d, sizeof(View2D)); + ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f; + ar->v2d.tot.ymax= 0.0f; + ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); ar->v2d.scroll |= (V2D_SCROLL_RIGHT); ar->v2d.align = V2D_ALIGN_NO_POS_Y; @@ -6236,7 +6239,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) { /* we totally reinit the view for the Action Editor, as some old instances had some weird cruft set */ ar->v2d.tot.xmin= -20.0f; - ar->v2d.tot.ymin= (float)(-sa->winy); + ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f; ar->v2d.tot.xmax= (float)((sa->winx > 120)? (sa->winx) : 120); ar->v2d.tot.ymax= 0.0f; @@ -6246,7 +6249,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) ar->v2d.min[1]= 0.0f; ar->v2d.max[0]= MAXFRAMEF; - ar->v2d.max[1]= 10000.0f; + ar->v2d.max[1]= FLT_MAX; ar->v2d.minzoom= 0.01f; ar->v2d.maxzoom= 50; @@ -10568,8 +10571,34 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } /* put 2.50 compatibility code here until next subversion bump */ - if (1) { - + { + /* fix for bad View2D extents for Animation Editors */ + bScreen *screen; + ScrArea *sa; + SpaceLink *sl; + + for (screen= main->screen.first; screen; screen= screen->id.next) { + for (sa= screen->areabase.first; sa; sa= sa->next) { + for (sl= sa->spacedata.first; sl; sl= sl->next) { + ListBase *regionbase; + ARegion *ar; + + if (sl == sa->spacedata.first) + regionbase = &sa->regionbase; + else + regionbase = &sl->regionbase; + + if (ELEM(sl->spacetype, SPACE_ACTION, SPACE_NLA)) { + for (ar = (ARegion*)regionbase->first; ar; ar = ar->next) { + if (ar->regiontype == RGN_TYPE_WINDOW) { + ar->v2d.cur.ymax= ar->v2d.tot.ymax= 0.0f; + ar->v2d.cur.ymin= ar->v2d.tot.ymin= (float)(-sa->winy) / 3.0f; + } + } + } + } + } + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ -- cgit v1.2.3 From a22eb04b19e65c957aca97a378d4122b24e4681e Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 27 Jan 2010 11:58:04 +0000 Subject: Bumped subversion for readfile patch (Anim Editors View2D stuff) --- source/blender/blenloader/intern/readfile.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c69104f1f74..aab8f9f2b1b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10570,8 +10570,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - /* put 2.50 compatibility code here until next subversion bump */ - { + if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 14)) { /* fix for bad View2D extents for Animation Editors */ bScreen *screen; ScrArea *sa; @@ -10600,6 +10599,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } } + + + /* put 2.50 compatibility code here until next subversion bump */ + //{ + + //} /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */ -- cgit v1.2.3 From 39fa9ecd1a4f1d7433a079cfcc6170a4a8d75451 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 27 Jan 2010 15:30:20 +0000 Subject: Fix #20651: 3D Cursor resets after add object operator redo. The 3d cursor is not getting an undo push, so also made it preserved now through undo's, this is like e.g. the 3d view position which also stays the same. --- source/blender/blenloader/intern/readfile.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index aab8f9f2b1b..c3457adc288 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4823,11 +4823,15 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) for(sc= newmain->screen.first; sc; sc= sc->id.next) { - + Scene *oldscene= sc->scene; + sc->scene= restore_pointer_by_name(newmain, (ID *)sc->scene, 1); if(sc->scene==NULL) sc->scene= curscene; + /* keep cursor location through undo */ + copy_v3_v3(sc->scene->cursor, oldscene->cursor); + sa= sc->areabase.first; while(sa) { SpaceLink *sl; -- cgit v1.2.3 From 5445dda2956d64385b20874592b3305b7056505a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 27 Jan 2010 21:40:08 +0000 Subject: Ambient Occlusion split up into: Ambient occlusion: multiplied with direct lighting by default, add is also still available and more blending methods might be added if they are useful. This is fundamentally a non physical effect. Environment lighting: always added as you would expect (though you can subtract by specifying negative energy). This can be just white or take colors or textures from the world. Indirect lighting: only supported for AAO at the moment (and is still too approximate), and also is always added. A factor is available to specify how much is added, though value 1.0 is correct. Also: * Material ambient value now defaults to 1.0. * Added Environment, Indirect and Emit pass. * "Both" blending method is no longer available. * Attenuation, sampling parameters are still shared, some could be split up, though if they are different this would affect performance. --- source/blender/blenloader/intern/readfile.c | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c3457adc288..84b27ad44eb 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10604,6 +10604,36 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 15)) { + World *wo; + Material *ma; + + /* ambient default from 0.5f to 1.0f */ + for(ma= main->mat.first; ma; ma=ma->id.next) + ma->amb *= 2.0f; + + for(wo= main->world.first; wo; wo=wo->id.next) { + /* ao splitting into ao/env/indirect */ + wo->ao_env_energy= wo->aoenergy; + wo->aoenergy= 1.0f; + + if(wo->ao_indirect_bounces == 0) + wo->ao_indirect_bounces= 1; + else + wo->mode |= WO_INDIRECT_LIGHT; + + if(wo->aomix == WO_AOSUB) + wo->ao_env_energy= -wo->ao_env_energy; + else if(wo->aomix == WO_AOADDSUB) + wo->mode |= WO_AMB_OCC; + + wo->aomix= WO_AOMUL; + + /* ambient default from 0.5f to 1.0f */ + mul_v3_fl(&wo->ambr, 0.5f); + wo->ao_env_energy *= 0.5f; + } + } /* put 2.50 compatibility code here until next subversion bump */ //{ -- cgit v1.2.3 From bf16ed0c800762c61177ba2f16f6eecf89535d21 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 27 Jan 2010 23:20:32 +0000 Subject: Fixed some crashes with undo, when going back to the initial state of the file. --- source/blender/blenloader/intern/readfile.c | 33 +++++++++++------------------ 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 84b27ad44eb..b0e68c81c73 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4876,24 +4876,12 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) else if(sl->spacetype==SPACE_IPO) { SpaceIpo *sipo= (SpaceIpo *)sl; bDopeSheet *ads= sipo->ads; - - /* XXX animato */ -#if 0 - sipo->ipo= restore_pointer_by_name(newmain, (ID *)sipo->ipo, 0); - if(sipo->blocktype==ID_SEQ) - sipo->from= (ID *)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/ - if(sipo->editipo) MEM_freeN(sipo->editipo); - sipo->editipo= NULL; - -#endif - if(ads) { - if(ads->filter_grp) { + if (ads) { + ads->source= restore_pointer_by_name(newmain, (ID *)ads->source, 1); + + if (ads->filter_grp) ads->filter_grp= restore_pointer_by_name(newmain, (ID *)ads->filter_grp, 0); - } } } else if(sl->spacetype==SPACE_BUTS) { @@ -4918,12 +4906,12 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) } else if(sl->spacetype==SPACE_ACTION) { SpaceAction *saction= (SpaceAction *)sl; + saction->action = restore_pointer_by_name(newmain, (ID *)saction->action, 1); saction->ads.source= restore_pointer_by_name(newmain, (ID *)saction->ads.source, 1); - if(saction->ads.filter_grp) { + if (saction->ads.filter_grp) saction->ads.filter_grp= restore_pointer_by_name(newmain, (ID *)saction->ads.filter_grp, 0); - } } else if(sl->spacetype==SPACE_IMAGE) { SpaceImage *sima= (SpaceImage *)sl; @@ -4933,9 +4921,12 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) else if(sl->spacetype==SPACE_NLA){ SpaceNla *snla= (SpaceNla *)sl; bDopeSheet *ads= snla->ads; - - if (ads->filter_grp) { - ads->filter_grp= restore_pointer_by_name(newmain, (ID *)ads->filter_grp, 0); + + if (ads) { + ads->source= restore_pointer_by_name(newmain, (ID *)ads->source, 1); + + if (ads->filter_grp) + ads->filter_grp= restore_pointer_by_name(newmain, (ID *)ads->filter_grp, 0); } } else if(sl->spacetype==SPACE_TEXT) { -- cgit v1.2.3 From 01ea2175db20e5b2040b427217d8b11bb8b31b09 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 29 Jan 2010 13:06:50 +0000 Subject: Fix #20327: uv smart project options can't be tweaked. Python operators calling C operators would get too many undo pushes, causing redo of the python operator not to work. Now the depth of operator callbacks is counted to detected nested calls, and in that case skip the undo/register here, and only do a single undo/register for the mother operator. --- source/blender/blenloader/intern/readfile.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index b0e68c81c73..26492ed490c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4540,6 +4540,7 @@ static void direct_link_windowmanager(FileData *fd, wmWindowManager *wm) wm->windrawable= NULL; wm->initialized= 0; + wm->op_undo_depth= 0; } static void lib_link_windowmanager(FileData *fd, Main *main) -- cgit v1.2.3 From 96daa3348d2ab3bdcc0fbbd3fa685eefe1d01067 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 30 Jan 2010 21:11:46 +0000 Subject: Bugfixes: * Old files imported to 2.5 with curves that got cycles FModifiers added during version patching, would not have their keyframes shown for editing. * #20893: Can't see/show the Properties area in the NLA I don't know why this worked on a few of my test files several months ago, and yet now fails for many files today. --- source/blender/blenloader/intern/readfile.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 26492ed490c..39c2550bd79 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6073,6 +6073,14 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) ar->alignment= RGN_ALIGN_LEFT; ar->v2d.scroll= V2D_SCROLL_BOTTOM; ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; + + // for some reason, some files still don't get this auto + ar= MEM_callocN(sizeof(ARegion), "area region from do_versions"); + BLI_addtail(lb, ar); + ar->regiontype= RGN_TYPE_UI; + ar->alignment= RGN_ALIGN_RIGHT; + ar->v2d.scroll= V2D_SCROLL_RIGHT; + ar->v2d.flag = RGN_FLAG_HIDDEN; break; case SPACE_NODE: -- cgit v1.2.3 From f749d0361f8a2cf8ba7d515c31cec1dcf8fe96a5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 30 Jan 2010 22:33:47 +0000 Subject: - hash characters in the path would confuse the output file name and not add numbers to it (when rendering animations). - added an option to BLI_convertstringframe and BLI_convertstringframe_range to add digits if not found. - removed BLI_convertstringframe where its obviously not needed - such as loading movies and sounds. --- source/blender/blenloader/intern/readfile.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 39c2550bd79..14995944048 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9682,7 +9682,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) char str[FILE_MAX]; BLI_join_dirfile(str, seq->strip->dir, seq->strip->stripdata->name); BLI_convertstringcode(str, G.sce); - BLI_convertstringframe(str, scene->r.cfra); seq->sound = sound_new_file(main, str); } } -- cgit v1.2.3 From 2156ddc52947bb7667699478d06256b0362286bb Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 1 Feb 2010 19:35:32 +0000 Subject: Fix part of #19858: texture node outputs don't work separately, the meaning of node output indices was changed without a version patch. --- source/blender/blenloader/intern/readfile.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 14995944048..84cb61af5ae 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9632,6 +9632,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) bSound *sound; Sequence *seq; bActuator *act; + int a; for(sound = main->sound.first; sound; sound = sound->id.next) { @@ -9704,6 +9705,15 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for(ma= main->mat.first; ma; ma= ma->id.next) { if(ma->nodetree && strlen(ma->nodetree->id.name)==0) strcpy(ma->nodetree->id.name, "NTShader Nodetree"); + + /* which_output 0 is now "not specified" */ + for(a=0; amtex[a]) { + tx= newlibadr(fd, lib, ma->mtex[a]->tex); + if(tx && tx->use_nodes) + ma->mtex[a]->which_output++; + } + } } /* and composit trees */ for(sce= main->scene.first; sce; sce= sce->id.next) { @@ -9726,8 +9736,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } /* and texture trees */ for(tx= main->tex.first; tx; tx= tx->id.next) { - if(tx->nodetree && strlen(tx->nodetree->id.name)==0) - strcpy(tx->nodetree->id.name, "NTTexture Nodetree"); + bNode *node; + + if(tx->nodetree) { + if(strlen(tx->nodetree->id.name)==0) + strcpy(tx->nodetree->id.name, "NTTexture Nodetree"); + + /* which_output 0 is now "not specified" */ + for(node=tx->nodetree->nodes.first; node; node=node->next) + if(node->type == TEX_NODE_OUTPUT) + node->custom1++; + } } /* copy standard draw flag to meshes(used to be global, is not available here) */ -- cgit v1.2.3 From 942e1fc6a8dff027f8d1d00a00ff8d8d794336f3 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 2 Feb 2010 17:28:53 +0000 Subject: Give border render coordinates a sane default, so enabling border in the render properties shows the render border in the 3d view. --- source/blender/blenloader/intern/readfile.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 84cb61af5ae..bdd0d89410d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10654,9 +10654,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } /* put 2.50 compatibility code here until next subversion bump */ - //{ - - //} + { + Scene *sce; + + /* initialize to sane default so toggling on border shows something */ + for(sce = main->scene.first; sce; sce = sce->id.next) { + if(sce->r.border.xmin == 0.0f && sce->r.border.ymin == 0.0f && + sce->r.border.xmax == 0.0f && sce->r.border.ymax == 0.0f) { + sce->r.border.xmin= 0.0f; + sce->r.border.ymin= 0.0f; + sce->r.border.xmax= 1.0f; + sce->r.border.ymax= 1.0f; + } + } + } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */ -- cgit v1.2.3 From 104f46afdd4f2b3f66a73ddc14582bcb2854ef36 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 2 Feb 2010 18:24:10 +0000 Subject: linking in mesh data with animation crashed blender. also fixed some warnings. --- source/blender/blenloader/intern/readfile.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index bdd0d89410d..051bc1851b8 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3310,6 +3310,7 @@ static void lib_link_mesh(FileData *fd, Main *main) /*Link ID Properties -- and copy this comment EXACTLY for easy finding of library blocks that implement this.*/ if (me->id.properties) IDP_LibLinkProperty(me->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); + if (me->adt) lib_link_animdata(fd, &me->id, me->adt); /* this check added for python created meshes */ if(me->mat) { @@ -3397,6 +3398,9 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh) mesh->msticky= newdataadr(fd, mesh->msticky); mesh->dvert= newdataadr(fd, mesh->dvert); + mesh->adt= newdataadr(fd, mesh->adt); + direct_link_animdata(fd, mesh->adt); + /* Partial-mesh visibility (do this before using totvert, totface, or totedge!) */ mesh->pv= newdataadr(fd, mesh->pv); if(mesh->pv) { -- cgit v1.2.3 From eedf5cbe89826faa728cf90d935cc696dd79b045 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 4 Feb 2010 16:54:25 +0000 Subject: reading in hair with dynamics wasnt working but mostly crashed when duplicating the object. from reading all places dynamic hair is used I think these changes are correct (cloth seems to share pointcache with the psys) but its not obvious. jahka: please check this is ok. --- source/blender/blenloader/intern/readfile.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 051bc1851b8..e9cbbb95b02 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3187,6 +3187,13 @@ static void lib_link_particlesystems(FileData *fd, Object *ob, ID *id, ListBase pt->ob=newlibadr(fd, id->lib, pt->ob); psys->target_ob = newlibadr(fd, id->lib, psys->target_ob); + + if(psys->clmd) { + /* XXX - from reading existing code this seems correct but intended usage of + * pointcache should /w cloth should be added in 'ParticleSystem' - campbell */ + psys->clmd->point_cache= psys->pointcache; + psys->clmd->ptcaches.first= psys->clmd->ptcaches.last= NULL; + } } else { /* particle modifier must be removed before particle system */ -- cgit v1.2.3 From b28033d53f9f876cc2132cfe9dc46ef1c204b063 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 6 Feb 2010 11:50:39 +0000 Subject: Constraints Loading: Refactored the constraints reading code to take advantage of the new ID loopers. Now, adding a new constraint type will not require much effort with the file loading code, unless the constraint uses any special direct data which needs to be handled differently. --- source/blender/blenloader/intern/readfile.c | 371 +++++----------------------- 1 file changed, 67 insertions(+), 304 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index e9cbbb95b02..084f29e7d55 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2137,10 +2137,24 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree) /* ************ READ ARMATURE ***************** */ +/* temp struct used to transport needed info to lib_link_constraint_cb() */ +typedef struct tConstraintLinkData { + FileData *fd; + ID *id; +} tConstraintLinkData; +/* callback function used to relink constraint ID-links */ +static void lib_link_constraint_cb(bConstraint *con, ID **idpoin, void *userdata) +{ + tConstraintLinkData *cld= (tConstraintLinkData *)userdata; + *idpoin = newlibadr(cld->fd, cld->id->lib, *idpoin); +} + static void lib_link_constraints(FileData *fd, ID *id, ListBase *conlist) { + tConstraintLinkData cld; bConstraint *con; - + + /* legacy fixes */ for (con = conlist->first; con; con=con->next) { /* patch for error introduced by changing constraints (dunno how) */ /* if con->data type changes, dna cannot resolve the pointer! (ton) */ @@ -2149,184 +2163,48 @@ static void lib_link_constraints(FileData *fd, ID *id, ListBase *conlist) } /* own ipo, all constraints have it */ con->ipo= newlibadr_us(fd, id->lib, con->ipo); // XXX depreceated - old animation system + } + + /* relink all ID-blocks used by the constraints */ + cld.fd= fd; + cld.id= id; + + id_loop_constraints(conlist, lib_link_constraint_cb, &cld); +} + +static void direct_link_constraints(FileData *fd, ListBase *lb) +{ + bConstraint *con; + + link_list(fd, lb); + for (con=lb->first; con; con=con->next) { + con->data = newdataadr(fd, con->data); switch (con->type) { - case CONSTRAINT_TYPE_PYTHON: + case CONSTRAINT_TYPE_PYTHON: { - bPythonConstraint *data= (bPythonConstraint*)con->data; - bConstraintTarget *ct; + bPythonConstraint *data= con->data; - for (ct= data->targets.first; ct; ct= ct->next) - ct->tar = newlibadr(fd, id->lib, ct->tar); - - data->text = newlibadr(fd, id->lib, data->text); - //IDP_LibLinkProperty(data->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); - } - break; - case CONSTRAINT_TYPE_ACTION: - { - bActionConstraint *data; - data= ((bActionConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - data->act = newlibadr(fd, id->lib, data->act); - } - break; - case CONSTRAINT_TYPE_LOCLIKE: - { - bLocateLikeConstraint *data; - data= ((bLocateLikeConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - } - break; - case CONSTRAINT_TYPE_ROTLIKE: - { - bRotateLikeConstraint *data; - data= ((bRotateLikeConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); + link_list(fd, &data->targets); + + data->prop = newdataadr(fd, data->prop); + if (data->prop) + IDP_DirectLinkProperty(data->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); } - break; - case CONSTRAINT_TYPE_SIZELIKE: + break; + case CONSTRAINT_TYPE_SPLINEIK: { - bSizeLikeConstraint *data; - data= ((bSizeLikeConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); + bSplineIKConstraint *data= con->data; + + data->points= newdataadr(fd, data->points); } - break; - case CONSTRAINT_TYPE_KINEMATIC: + break; + case CONSTRAINT_TYPE_KINEMATIC: { - bKinematicConstraint *data; - data = ((bKinematicConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - data->poletar = newlibadr(fd, id->lib, data->poletar); con->lin_error = 0.f; con->rot_error = 0.f; } - break; - case CONSTRAINT_TYPE_TRACKTO: - { - bTrackToConstraint *data; - data = ((bTrackToConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - } - break; - case CONSTRAINT_TYPE_MINMAX: - { - bMinMaxConstraint *data; - data = ((bMinMaxConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - } - break; - case CONSTRAINT_TYPE_LOCKTRACK: - { - bLockTrackConstraint *data; - data= ((bLockTrackConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - } - break; - case CONSTRAINT_TYPE_FOLLOWPATH: - { - bFollowPathConstraint *data; - data= ((bFollowPathConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - } - break; - case CONSTRAINT_TYPE_STRETCHTO: - { - bStretchToConstraint *data; - data= ((bStretchToConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - } - break; - case CONSTRAINT_TYPE_RIGIDBODYJOINT: - { - bRigidBodyJointConstraint *data; - data= ((bRigidBodyJointConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - } - break; - case CONSTRAINT_TYPE_CLAMPTO: - { - bClampToConstraint *data; - data= ((bClampToConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - } - break; - case CONSTRAINT_TYPE_CHILDOF: - { - bChildOfConstraint *data; - data= ((bChildOfConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - } - break; - case CONSTRAINT_TYPE_TRANSFORM: - { - bTransformConstraint *data; - data= ((bTransformConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - } - break; - case CONSTRAINT_TYPE_DISTLIMIT: - { - bDistLimitConstraint *data; - data= ((bDistLimitConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - } - break; - case CONSTRAINT_TYPE_SHRINKWRAP: - { - bShrinkwrapConstraint *data; - data= ((bShrinkwrapConstraint*)con->data); - data->target = newlibadr(fd, id->lib, data->target); - } - break; - case CONSTRAINT_TYPE_DAMPTRACK: - { - bDampTrackConstraint *data; - data= ((bDampTrackConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - } - break; - case CONSTRAINT_TYPE_SPLINEIK: - { - bSplineIKConstraint *data; - data= ((bSplineIKConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - } - break; - case CONSTRAINT_TYPE_TRANSLIKE: - { - bTransLikeConstraint *data; - data= ((bTransLikeConstraint*)con->data); - data->tar = newlibadr(fd, id->lib, data->tar); - } - break; - case CONSTRAINT_TYPE_NULL: - break; - } - } -} - -static void direct_link_constraints(FileData *fd, ListBase *lb) -{ - bConstraint *cons; - - link_list(fd, lb); - for (cons=lb->first; cons; cons=cons->next) { - cons->data = newdataadr(fd, cons->data); - - if (cons->type == CONSTRAINT_TYPE_PYTHON) { - bPythonConstraint *data= cons->data; - - link_list(fd, &data->targets); - - data->prop = newdataadr(fd, data->prop); - if (data->prop) - IDP_DirectLinkProperty(data->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); - } - else if (cons->type == CONSTRAINT_TYPE_SPLINEIK) { - bSplineIKConstraint *data= cons->data; - - data->points= newdataadr(fd, data->points); + break; } } } @@ -11317,148 +11195,33 @@ static void expand_mesh(FileData *fd, Main *mainvar, Mesh *me) } } +/* temp struct used to transport needed info to expand_constraint_cb() */ +typedef struct tConstraintExpandData { + FileData *fd; + Main *mainvar; +} tConstraintExpandData; +/* callback function used to expand constraint ID-links */ +static void expand_constraint_cb(bConstraint *con, ID **idpoin, void *userdata) +{ + tConstraintExpandData *ced= (tConstraintExpandData *)userdata; + expand_doit(ced->fd, ced->mainvar, *idpoin); +} + static void expand_constraints(FileData *fd, Main *mainvar, ListBase *lb) { + tConstraintExpandData ced; bConstraint *curcon; - + + /* relink all ID-blocks used by the constraints */ + ced.fd= fd; + ced.mainvar= mainvar; + + id_loop_constraints(lb, expand_constraint_cb, &ced); + + /* depreceated manual expansion stuff */ for (curcon=lb->first; curcon; curcon=curcon->next) { - if (curcon->ipo) expand_doit(fd, mainvar, curcon->ipo); // XXX depreceated - old animation system - - switch (curcon->type) { - case CONSTRAINT_TYPE_NULL: - break; - case CONSTRAINT_TYPE_PYTHON: - { - bPythonConstraint *data = (bPythonConstraint*)curcon->data; - bConstraintTarget *ct; - - for (ct= data->targets.first; ct; ct= ct->next) - expand_doit(fd, mainvar, ct->tar); - - expand_doit(fd, mainvar, data->text); - } - break; - case CONSTRAINT_TYPE_ACTION: - { - bActionConstraint *data = (bActionConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - expand_doit(fd, mainvar, data->act); - } - break; - case CONSTRAINT_TYPE_LOCLIKE: - { - bLocateLikeConstraint *data = (bLocateLikeConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_ROTLIKE: - { - bRotateLikeConstraint *data = (bRotateLikeConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_SIZELIKE: - { - bSizeLikeConstraint *data = (bSizeLikeConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_KINEMATIC: - { - bKinematicConstraint *data = (bKinematicConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - expand_doit(fd, mainvar, data->poletar); - } - break; - case CONSTRAINT_TYPE_TRACKTO: - { - bTrackToConstraint *data = (bTrackToConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_MINMAX: - { - bMinMaxConstraint *data = (bMinMaxConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_LOCKTRACK: - { - bLockTrackConstraint *data = (bLockTrackConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_FOLLOWPATH: - { - bFollowPathConstraint *data = (bFollowPathConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_STRETCHTO: - { - bStretchToConstraint *data = (bStretchToConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_RIGIDBODYJOINT: - { - bRigidBodyJointConstraint *data = (bRigidBodyJointConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_CLAMPTO: - { - bClampToConstraint *data = (bClampToConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_CHILDOF: - { - bChildOfConstraint *data = (bChildOfConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_TRANSFORM: - { - bTransformConstraint *data = (bTransformConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_DISTLIMIT: - { - bDistLimitConstraint *data = (bDistLimitConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_SHRINKWRAP: - { - bShrinkwrapConstraint *data = (bShrinkwrapConstraint*)curcon->data; - expand_doit(fd, mainvar, data->target); - } - break; - case CONSTRAINT_TYPE_DAMPTRACK: - { - bDampTrackConstraint *data = (bDampTrackConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_SPLINEIK: - { - bSplineIKConstraint *data = (bSplineIKConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - case CONSTRAINT_TYPE_TRANSLIKE: - { - bTransLikeConstraint *data = (bTransLikeConstraint*)curcon->data; - expand_doit(fd, mainvar, data->tar); - } - break; - default: - break; - } } } -- cgit v1.2.3 From de90619a46f2c5896b3ee1d241981b90a1b96269 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 6 Feb 2010 20:25:17 +0000 Subject: Fix #20452: motion blur buttons were missing. Motion blur samples are now also decoupled from antialiasing samples. Implemented by Matt, I'm just committing the patch. --- source/blender/blenloader/intern/readfile.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 084f29e7d55..f4261cbb738 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10082,6 +10082,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if(sce->r.frame_step==0) sce->r.frame_step= 1; + if (sce->r.mblur_samples==0) + sce->r.mblur_samples = sce->r.osa; if(sce->ed && sce->ed->seqbasep) { -- cgit v1.2.3 From 064345ad8c72d0af21b31c3da47bad6ceb3a7023 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Sun, 7 Feb 2010 19:07:56 +0000 Subject: Partial fix for [#20567] SEQUENCER: Image Preview completely unusable * Zoom and Pan should work now (thanks Aligorith for reviewing) * mostly removed ancient drawing code * Fit preview in Window still has issue, HOME key in preview area should be working though --- source/blender/blenloader/intern/readfile.c | 68 +++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 8 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f4261cbb738..ed551e56fe9 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5921,6 +5921,29 @@ static void area_add_header_region(ScrArea *sa, ListBase *lb) ar->v2d.flag = (V2D_PIXELOFS_X|V2D_PIXELOFS_Y); } +static void sequencer_init_preview_region(ARegion* ar) +{ + // XXX a bit ugly still, copied from space_sequencer + /* NOTE: if you change values here, also change them in space_sequencer.c, sequencer_new */ + ar->regiontype= RGN_TYPE_PREVIEW; + ar->alignment= RGN_ALIGN_TOP; + ar->flag |= RGN_FLAG_HIDDEN; + ar->v2d.keepzoom= V2D_KEEPASPECT | V2D_KEEPZOOM; + ar->v2d.minzoom= 0.00001f; + ar->v2d.maxzoom= 100000.0f; + ar->v2d.tot.xmin= -960.0f; /* 1920 width centered */ + ar->v2d.tot.ymin= -540.0f; /* 1080 height centered */ + ar->v2d.tot.xmax= 960.0f; + ar->v2d.tot.ymax= 540.0f; + ar->v2d.min[0]= 0.0f; + ar->v2d.min[1]= 0.0f; + ar->v2d.max[0]= 12000.0f; + ar->v2d.max[1]= 12000.0f; + ar->v2d.cur= ar->v2d.tot; + ar->v2d.align= V2D_ALIGN_FREE; // (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y); + ar->v2d.keeptot= V2D_KEEPTOT_FREE; +} + /* 2.50 patch */ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) { @@ -6001,9 +6024,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) } ar= MEM_callocN(sizeof(ARegion), "preview area for sequencer"); BLI_insertlinkbefore(lb, ar_main, ar); - ar->regiontype= RGN_TYPE_PREVIEW; - ar->alignment= RGN_ALIGN_TOP; - ar->flag |= RGN_FLAG_HIDDEN; + sequencer_init_preview_region(ar); break; case SPACE_VIEW3D: /* toolbar */ @@ -10300,7 +10321,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) break; } - if (ar) { + if (ar && (ar->regiontype == RGN_TYPE_PREVIEW)) { SpaceType *st= BKE_spacetype_from_id(SPACE_SEQ); BKE_area_region_free(st, ar); BLI_freelinkN(regionbase, ar); @@ -10345,9 +10366,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } ar= MEM_callocN(sizeof(ARegion), "preview area for sequencer"); BLI_insertlinkbefore(regionbase, ar_main, ar); - ar->regiontype= RGN_TYPE_PREVIEW; - ar->alignment= RGN_ALIGN_TOP; - ar->flag |= RGN_FLAG_HIDDEN; + sequencer_init_preview_region(ar); } } } @@ -10454,7 +10473,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ma->vol.ms_intensity = 1.f; } } - } if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 13)) { @@ -10558,6 +10576,40 @@ static void do_versions(FileData *fd, Library *lib, Main *main) sce->r.border.ymax= 1.0f; } } + + /* sequencer changes */ + { + bScreen *screen; + ScrArea *sa; + SpaceLink *sl; + + for(screen= main->screen.first; screen; screen= screen->id.next) { + for(sa= screen->areabase.first; sa; sa= sa->next) { + for(sl= sa->spacedata.first; sl; sl= sl->next) { + if(sl->spacetype==SPACE_SEQ) { + ARegion *ar_preview; + ListBase *regionbase; + SpaceSeq *sseq = (SpaceSeq *)sl; + + if (sl == sa->spacedata.first) { + regionbase = &sa->regionbase; + } else { + regionbase = &sl->regionbase; + } + + ar_preview = (ARegion*)regionbase->first; + for (; ar_preview; ar_preview = ar_preview->next) { + if (ar_preview->regiontype == RGN_TYPE_PREVIEW) + break; + } + if (ar_preview && (ar_preview->regiontype == RGN_TYPE_PREVIEW)) { + sequencer_init_preview_region(ar_preview); + } + } + } + } + } + } /* sequencer changes */ } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ -- cgit v1.2.3 From 9827a3e9eac70f68db6dc16d03016c51b7ece3f0 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 7 Feb 2010 23:41:17 +0000 Subject: 2.5 Audio: - recode of the whole sequencer audio handling - encode audio flag removed, instead you choose None as audio codec, added None for video codec too - ffmpeg formats/codecs: enabled: theora, ogg, vorbis; added: matroska, flac (not working, who can fix?), mp3, wav - sequencer wave drawing - volume animation (now also working when mixing down to a file!) - made sequencer strip position and length values unanimatable --- source/blender/blenloader/intern/readfile.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ed551e56fe9..5938f9e6e2a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4138,14 +4138,14 @@ static void lib_link_scene(FileData *fd, Main *main) if(seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo); if(seq->scene) seq->scene= newlibadr(fd, sce->id.lib, seq->scene); if(seq->sound) { - seq->sound_handle= NULL; + seq->scene_sound = NULL; if(seq->type == SEQ_HD_SOUND) seq->type = SEQ_SOUND; else seq->sound= newlibadr(fd, sce->id.lib, seq->sound); if (seq->sound) { seq->sound->id.us++; - seq->sound_handle= sound_new_handle(sce, seq->sound, seq->startdisp, seq->enddisp, seq->startofs); + seq->scene_sound = sound_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs); } } seq->anim= 0; @@ -4161,7 +4161,7 @@ static void lib_link_scene(FileData *fd, Main *main) #endif if(sce->ed) - seq_update_muting(sce->ed); + seq_update_muting(sce, sce->ed); if(sce->nodetree) { lib_link_ntree(fd, &sce->id, sce->nodetree); @@ -4217,7 +4217,7 @@ static void direct_link_scene(FileData *fd, Scene *sce) sce->obedit= NULL; sce->stats= 0; - memset(&sce->sound_handles, 0, sizeof(sce->sound_handles)); + sound_create_scene(sce); /* set users to one by default, not in lib-link, this will increase it for compo nodes */ sce->id.us= 1; @@ -5200,6 +5200,7 @@ static void fix_relpaths_library(const char *basepath, Main *main) static void direct_link_sound(FileData *fd, bSound *sound) { sound->handle = NULL; + sound->playback_handle = NULL; sound->packedfile = direct_link_packedfile(fd, sound->packedfile); sound->newpackedfile = direct_link_packedfile(fd, sound->newpackedfile); @@ -10565,6 +10566,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* put 2.50 compatibility code here until next subversion bump */ { Scene *sce; + Sequence *seq; /* initialize to sane default so toggling on border shows something */ for(sce = main->scene.first; sce; sce = sce->id.next) { @@ -10575,6 +10577,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main) sce->r.border.xmax= 1.0f; sce->r.border.ymax= 1.0f; } + + if((sce->r.ffcodecdata.flags & FFMPEG_MULTIPLEX_AUDIO) == 0) + sce->r.ffcodecdata.audio_codec = 0x0; // CODEC_ID_NONE + + SEQ_BEGIN(sce->ed, seq) { + seq->volume = 1.0f; + } + SEQ_END } /* sequencer changes */ -- cgit v1.2.3 From ec7df03c867d28316708e9b91bec5cef0aee832e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 8 Feb 2010 13:55:31 +0000 Subject: Warning fixes, one actual bug found in sequencer sound wave drawing. Also changed some malloc to MEM_mallocN while trying to track down a memory leak. --- source/blender/blenloader/intern/readfile.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5938f9e6e2a..872778a4bfe 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10599,7 +10599,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if(sl->spacetype==SPACE_SEQ) { ARegion *ar_preview; ListBase *regionbase; - SpaceSeq *sseq = (SpaceSeq *)sl; if (sl == sa->spacedata.first) { regionbase = &sa->regionbase; -- cgit v1.2.3 From 12f6c667d96367bc4718de5077ef0f609c4d5ece Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 8 Feb 2010 14:12:18 +0000 Subject: debug print was making it take > 20sec to open blender with some complex files. --- source/blender/blenloader/intern/readfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 872778a4bfe..af9df4b00ba 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10934,7 +10934,8 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old) /* this is actually only needed on UI call? when ID was already read before, and another append happens which invokes same ID... in that case the lookup table needs this entry */ oldnewmap_insert(fd->libmap, bhead->old, id, 1); - if(G.f & G_DEBUG) printf("expand: already read %s\n", id->name); + // commented because this can print way too much + // if(G.f & G_DEBUG) printf("expand: already read %s\n", id->name); } } } -- cgit v1.2.3 From d98603129ca30aabe29f17f28f4ac72dbc0ca4ac Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 11 Feb 2010 15:43:31 +0000 Subject: Added an option "Cast Approximate" to control if a material should cast shadow when using approximate AO, separate from "Traceable". --- source/blender/blenloader/intern/readfile.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index af9df4b00ba..175851266ed 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10563,10 +10563,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - /* put 2.50 compatibility code here until next subversion bump */ - { + if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 17)) { Scene *sce; Sequence *seq; + Material *ma; /* initialize to sane default so toggling on border shows something */ for(sce = main->scene.first; sce; sce = sce->id.next) { @@ -10587,6 +10587,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) SEQ_END } + for(ma = main->mat.first; ma; ma=ma->id.next) + if(ma->mode & MA_TRACEBLE) + ma->shade_flag |= MA_APPROX_OCCLUSION; + /* sequencer changes */ { bScreen *screen; @@ -10621,6 +10625,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } /* sequencer changes */ } + /* put 2.50 compatibility code here until next subversion bump */ + { + } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */ -- cgit v1.2.3 From b482b8543eb10102c6c09756e08977a3b69ff633 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 12 Feb 2010 00:44:26 +0000 Subject: Bugfix #21051: Restored 'Playback FPS' This commit restores the 'Playback FPS' option which showed an indicator of the frame rate of animation playback in the 3D-View. The info for this is now stored in a temp struct in scene data, with the status info being updated by the "animation step" operator instead of relying on globals as the old code did. This seems a lot more stable than in 2.49, but the accuracy is still questionable. --- source/blender/blenloader/intern/readfile.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 175851266ed..ecddb6280b3 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4216,6 +4216,7 @@ static void direct_link_scene(FileData *fd, Scene *sce) sce->dagisvalid = 0; sce->obedit= NULL; sce->stats= 0; + sce->fps_info= NULL; sound_create_scene(sce); -- cgit v1.2.3 From 081c1205a31cb12ef632565b8d0c3fce024aa339 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 12 Feb 2010 13:34:04 +0000 Subject: correct fsf address --- source/blender/blenloader/intern/readfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ecddb6280b3..79649f61750 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. -- cgit v1.2.3 From 39c3ebdc910100a3194f62ac52af4e15a9422264 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 13 Feb 2010 13:38:10 +0000 Subject: fix for memory leak: node animation data wasnt being free'd also some corrections to memory debug stuff. --- source/blender/blenloader/intern/readfile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 79649f61750..5c2fcf7aee5 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5307,7 +5307,7 @@ static BHead *read_data_into_oldnewmap(FileData *fd, BHead *bhead, char *allocna while(bhead && bhead->code==DATA) { void *data; -#if 0 +#if 0 /* XXX DUMB DEBUGGING OPTION TO GIVE NAMES for guarded malloc errors */ short *sp= fd->filesdna->structs[bhead->SDNAnr]; char *allocname = fd->filesdna->types[ sp[0] ]; @@ -5315,8 +5315,9 @@ static BHead *read_data_into_oldnewmap(FileData *fd, BHead *bhead, char *allocna strcpy(tmp, allocname); data= read_struct(fd, bhead, tmp); -#endif +#else data= read_struct(fd, bhead, allocname); +#endif if (data) { oldnewmap_insert(fd->datamap, bhead->old, data, 0); -- cgit v1.2.3 From 677386e53a079a10e0c965759156f298471409ca Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Feb 2010 23:33:18 +0000 Subject: initial support for extensions in the user preferences only one script at the moment: [#20848] Blender Gears for 2.5 (for ideasman42) from Michel Anders (varkenvarken) --- source/blender/blenloader/intern/readfile.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5c2fcf7aee5..9fed1e5c5af 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10685,6 +10685,7 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead) link_list(fd, &user->themes); link_list(fd, &user->keymaps); + link_list(fd, &user->extensions); for(keymap=user->keymaps.first; keymap; keymap=keymap->next) { keymap->modal_items= NULL; -- cgit v1.2.3 From 2061f91741861f5646974b4960b5ff03d509f5eb Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Feb 2010 15:49:22 +0000 Subject: Render Slots: change the implementation by moving it from the render to the image code, this should be clearer and makes reusing the Render struct later on easier. --- source/blender/blenloader/intern/readfile.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 9fed1e5c5af..627e086ba94 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1191,6 +1191,7 @@ void blo_make_image_pointer_map(FileData *fd, Main *oldmain) { Image *ima= oldmain->image.first; Scene *sce= oldmain->scene.first; + int a; fd->imamap= oldnewmap_new(); @@ -1200,6 +1201,9 @@ void blo_make_image_pointer_map(FileData *fd, Main *oldmain) oldnewmap_insert(fd->imamap, ibuf, ibuf, 0); if(ima->gputexture) oldnewmap_insert(fd->imamap, ima->gputexture, ima->gputexture, 0); + for(a=0; arenders[a]) + oldnewmap_insert(fd->imamap, ima->renders[a], ima->renders[a], 0); } for(; sce; sce= sce->id.next) { if(sce->nodetree) { @@ -1217,7 +1221,7 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain) OldNew *entry= fd->imamap->entries; Image *ima= oldmain->image.first; Scene *sce= oldmain->scene.first; - int i; + int i, a; /* used entries were restored, so we put them to zero */ for (i=0; iimamap->nentries; i++, entry++) { @@ -1239,6 +1243,8 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain) } ima->gputexture= newimaadr(fd, ima->gputexture); + for(a=0; arenders[a]= newimaadr(fd, ima->renders[a]); } for(; sce; sce= sce->id.next) { if(sce->nodetree) { @@ -2660,7 +2666,8 @@ static void direct_link_image(FileData *fd, Image *ima) ima->anim= NULL; ima->rr= NULL; ima->repbind= NULL; - ima->render_text= newdataadr(fd, ima->render_text); + memset(ima->renders, 0, sizeof(ima->renders)); + ima->last_render_slot= ima->render_slot; ima->packedfile = direct_link_packedfile(fd, ima->packedfile); ima->preview = direct_link_preview_image(fd, ima->preview); -- cgit v1.2.3 From 57308d838262f3d059b688aa31718af25fb21abb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 16 Feb 2010 17:58:50 +0000 Subject: [#21102] Nonunique ID names in sequencer! now uniqute names are ensured with recursive name checking on the scene --- source/blender/blenloader/intern/readfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 627e086ba94..5b17cc14ff2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10120,7 +10120,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) { seq=sce->ed->seqbasep->first; while(seq) { - seqUniqueName(sce->ed->seqbasep, seq); + seqbase_unique_name_recursive(&sce->ed->seqbase, seq); seq=seq->next; } } -- cgit v1.2.3 From ad01c90ee3942fb2a4a792f0454a136b441f42b4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Feb 2010 19:24:04 +0000 Subject: Revert render slots commit for release, I can't find the bug or even redo it myself, there will still be render slots just old implementation. --- source/blender/blenloader/intern/readfile.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5b17cc14ff2..f4112bde8da 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1191,7 +1191,6 @@ void blo_make_image_pointer_map(FileData *fd, Main *oldmain) { Image *ima= oldmain->image.first; Scene *sce= oldmain->scene.first; - int a; fd->imamap= oldnewmap_new(); @@ -1201,9 +1200,6 @@ void blo_make_image_pointer_map(FileData *fd, Main *oldmain) oldnewmap_insert(fd->imamap, ibuf, ibuf, 0); if(ima->gputexture) oldnewmap_insert(fd->imamap, ima->gputexture, ima->gputexture, 0); - for(a=0; arenders[a]) - oldnewmap_insert(fd->imamap, ima->renders[a], ima->renders[a], 0); } for(; sce; sce= sce->id.next) { if(sce->nodetree) { @@ -1221,7 +1217,7 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain) OldNew *entry= fd->imamap->entries; Image *ima= oldmain->image.first; Scene *sce= oldmain->scene.first; - int i, a; + int i; /* used entries were restored, so we put them to zero */ for (i=0; iimamap->nentries; i++, entry++) { @@ -1243,8 +1239,6 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain) } ima->gputexture= newimaadr(fd, ima->gputexture); - for(a=0; arenders[a]= newimaadr(fd, ima->renders[a]); } for(; sce; sce= sce->id.next) { if(sce->nodetree) { @@ -2666,8 +2660,7 @@ static void direct_link_image(FileData *fd, Image *ima) ima->anim= NULL; ima->rr= NULL; ima->repbind= NULL; - memset(ima->renders, 0, sizeof(ima->renders)); - ima->last_render_slot= ima->render_slot; + ima->render_text= newdataadr(fd, ima->render_text); ima->packedfile = direct_link_packedfile(fd, ima->packedfile); ima->preview = direct_link_preview_image(fd, ima->preview); -- cgit v1.2.3 From 4755ab9f80df7ed52366b7928658e89c54fa15ac Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 19 Feb 2010 13:13:21 +0000 Subject: scene_update_for_newframe was calling DAG_scene_update_flags() and BKE_animsys_evaluate_all_animation() for each set. gain some speedup by only calling once. minor printf changes to readfile.c, no functional change. --- source/blender/blenloader/intern/readfile.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f4112bde8da..61f101dee8c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3436,6 +3436,7 @@ static void lib_link_object(FileData *fd, Main *main) if(ob->proxy->id.lib==NULL) { ob->proxy->proxy_from= NULL; ob->proxy= NULL; + printf("Proxy lost from object %s lib %s\n", ob->id.name+2, ob->id.lib->name); } else { /* this triggers object_update to always use a copy */ @@ -3450,11 +3451,14 @@ static void lib_link_object(FileData *fd, Main *main) ob->data= newlibadr_us(fd, ob->id.lib, ob->data); if(ob->data==NULL && poin!=NULL) { + if(ob->id.lib) + printf("Can't find obdata of %s lib %s\n", ob->id.name+2, ob->id.lib->name); + else + printf("Object %s lost data.\n", ob->id.name+2); + ob->type= OB_EMPTY; warn= 1; - if(ob->id.lib) printf("Can't find obdata of %s lib %s\n", ob->id.name+2, ob->id.lib->name); - else printf("Object %s lost data.\n", ob->id.name+2); - + if(ob->pose) { free_pose(ob->pose); ob->pose= NULL; -- cgit v1.2.3 From b65a983d391edf4c2ee2fcf9c80f4ff074bc6b59 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 22 Feb 2010 09:22:36 +0000 Subject: use BLI_findstring in more places & remove some warnings, no functional changes. --- source/blender/blenloader/intern/readfile.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 61f101dee8c..591ec969c40 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -32,6 +32,7 @@ #include #include // for printf fopen fwrite fclose sprintf FILE #include // for getenv atoi +#include // for offsetof #include // for open #include // for strrchr strncmp strstr #include // for fabs @@ -10882,20 +10883,9 @@ char *bhead_id_name(FileData *fd, BHead *bhead) static ID *is_yet_read(FileData *fd, Main *mainvar, BHead *bhead) { - ListBase *lb; - char *idname= bhead_id_name(fd, bhead); - - lb= wich_libbase(mainvar, GS(idname)); - - if(lb) { - ID *id= lb->first; - while(id) { - if( strcmp(id->name, idname)==0 ) - return id; - id= id->next; - } - } - return NULL; + const char *idname= bhead_id_name(fd, bhead); + /* wich_libbase can be NULL, intentionally not using idname+2 */ + return BLI_findstring(wich_libbase(mainvar, GS(idname)), idname, offsetof(ID, name)); } static void expand_doit(FileData *fd, Main *mainvar, void *old) -- cgit v1.2.3 From 10dbf6faee8d9b0f592c598c0b29008effa3b80c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 26 Feb 2010 14:28:29 +0000 Subject: rename extension to addon after discussion with meta-androcto & mindrones --- source/blender/blenloader/intern/readfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 591ec969c40..e0ec3b26b52 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10690,7 +10690,7 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead) link_list(fd, &user->themes); link_list(fd, &user->keymaps); - link_list(fd, &user->extensions); + link_list(fd, &user->addons); for(keymap=user->keymaps.first; keymap; keymap=keymap->next) { keymap->modal_items= NULL; -- cgit v1.2.3 From 81ab852ba9ac379bbed64eddcf7b7ea867455892 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 1 Mar 2010 06:23:59 +0000 Subject: Bugfix #21262: Loading Alpha 0 project crash in Alpha 1 Old temp-pointers for File Browser instances were not being cleared on file load, resulting in crashes when trying to free temp screen layouts that contained file browser instance data. --- source/blender/blenloader/intern/readfile.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index e0ec3b26b52..fbf3c6f0ebe 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5125,6 +5125,18 @@ static void direct_link_screen(FileData *fd, bScreen *sc) // cl->line= newdataadr(fd, cl->line); } + else if(sl->spacetype==SPACE_FILE) { + SpaceFile *sfile= (SpaceFile *)sl; + + /* this sort of info is probably irrelevant for reloading... + * plus, it isn't saved to files yet! + */ + sfile->folders_prev= sfile->folders_next= NULL; + sfile->files= NULL; + sfile->layout= NULL; + sfile->op= NULL; + sfile->params= NULL; + } } sa->actionzones.first= sa->actionzones.last= NULL; -- cgit v1.2.3 From 7aea1465071b69409ab270bc9da4ef76bf678fb1 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Mon, 1 Mar 2010 19:18:56 +0000 Subject: Replace the >>why is this here?? comment by some hard-earned experience with the .bullet file format (derived from .blend) --- source/blender/blenloader/intern/readfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index fbf3c6f0ebe..fbde733f717 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -581,7 +581,8 @@ static void bh4_from_bh8(BHead *bhead, BHead8 *bhead8, int do_endian_swap) if (bhead4->code != ENDB) { - // why is this here ?? + //perform a endian swap on 64bit pointers, otherwise the pointer might map to zero + //0x0000000000000000000012345678 would become 0x12345678000000000000000000000000 if (do_endian_swap) { SWITCH_LONGINT(bhead8->old); } -- cgit v1.2.3