diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-21 22:32:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-21 22:32:30 +0400 |
commit | 037626024a202c3b85f9ca479d2aafb10bbc6bf6 (patch) | |
tree | 0998df3d8f8d354507c239986cd1900faa913cbd /source/blender/blenloader | |
parent | 122d92e5b7d138bbb78d02d011a6952b8ecd5f0c (diff) | |
parent | dd21def25d2ddfa6ca04a7d11481a84b76e2c0ab (diff) |
svn merge ^/trunk/blender -r49776:50097
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 58 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_250.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 44 |
3 files changed, 93 insertions, 11 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 917656f93a0..5b88f2a2ea7 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2913,6 +2913,7 @@ static void lib_link_vfont(FileData *UNUSED(fd), Main *main) static void direct_link_vfont(FileData *fd, VFont *vf) { vf->data = NULL; + vf->temp_pf = NULL; vf->packedfile = direct_link_packedfile(fd, vf->packedfile); } @@ -4796,6 +4797,16 @@ static void link_paint(FileData *fd, Scene *sce, Paint *p) } } +static void lib_link_sequence_modifiers(FileData *fd, Scene *scene, ListBase *lb) +{ + SequenceModifierData *smd; + + for (smd = lb->first; smd; smd = smd->next) { + if (smd->mask_id) + smd->mask_id = newlibadr_us(fd, scene->id.lib, smd->mask_id); + } +} + static void lib_link_scene(FileData *fd, Main *main) { Scene *sce; @@ -4853,25 +4864,35 @@ static void lib_link_scene(FileData *fd, Main *main) } if (seq->clip) { seq->clip = newlibadr(fd, sce->id.lib, seq->clip); - seq->clip->id.us++; + if (seq->clip) { + seq->clip->id.us++; + } } if (seq->mask) { seq->mask = newlibadr(fd, sce->id.lib, seq->mask); - seq->mask->id.us++; + if (seq->mask) { + seq->mask->id.us++; + } + } + if (seq->scene_camera) { + seq->scene_camera = newlibadr(fd, sce->id.lib, seq->scene_camera); } - if (seq->scene_camera) seq->scene_camera = newlibadr(fd, sce->id.lib, seq->scene_camera); if (seq->sound) { seq->scene_sound = NULL; - if (seq->type == SEQ_TYPE_SOUND_HD) + if (seq->type == SEQ_TYPE_SOUND_HD) { seq->type = SEQ_TYPE_SOUND_RAM; - else + } + else { seq->sound = newlibadr(fd, sce->id.lib, seq->sound); + } if (seq->sound) { seq->sound->id.us++; seq->scene_sound = sound_add_scene_sound_defaults(sce, seq); } } seq->anim = NULL; + + lib_link_sequence_modifiers(fd, sce, &seq->modifiers); } SEQ_END @@ -4928,6 +4949,29 @@ static void direct_link_paint(FileData *fd, Paint **paint) (*paint)->num_input_samples = 1; } +static void direct_link_sequence_modifiers(FileData *fd, ListBase *lb) +{ + SequenceModifierData *smd; + + link_list(fd, lb); + + for (smd = lb->first; smd; smd = smd->next) { + if (smd->mask_sequence) + smd->mask_sequence = newdataadr(fd, smd->mask_sequence); + + if (smd->type == seqModifierType_Curves) { + CurvesModifierData *cmd = (CurvesModifierData *) smd; + + direct_link_curvemapping(fd, &cmd->curve_mapping); + } + else if (smd->type == seqModifierType_HueCorrect) { + HueCorrectModifierData *hcmd = (HueCorrectModifierData *) smd; + + direct_link_curvemapping(fd, &hcmd->curve_mapping); + } + } +} + static void direct_link_scene(FileData *fd, Scene *sce) { Editing *ed; @@ -4983,6 +5027,7 @@ static void direct_link_scene(FileData *fd, Scene *sce) seq->seq1= newdataadr(fd, seq->seq1); seq->seq2= newdataadr(fd, seq->seq2); seq->seq3= newdataadr(fd, seq->seq3); + seq->mask_sequence= newdataadr(fd, seq->mask_sequence); /* a patch: after introduction of effects with 3 input strips */ if (seq->seq3 == NULL) seq->seq3 = seq->seq2; @@ -5039,6 +5084,8 @@ static void direct_link_scene(FileData *fd, Scene *sce) // seq->strip->color_balance->gui = 0; // XXX - peter, is this relevant in 2.5? } } + + direct_link_sequence_modifiers(fd, &seq->modifiers); } SEQ_END @@ -5735,6 +5782,7 @@ static void direct_link_region(FileData *fd, ARegion *ar, int spacetype) ar->v2d.tab_offset = NULL; ar->v2d.tab_num = 0; ar->v2d.tab_cur = 0; + ar->v2d.sms = NULL; ar->handlers.first = ar->handlers.last = NULL; ar->uiblocks.first = ar->uiblocks.last = NULL; ar->headerstr = NULL; diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index d551caea425..ed5ffbf463e 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -2435,7 +2435,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) tex->pd->falloff_curve->preset = CURVE_PRESET_LINE; tex->pd->falloff_curve->cm->flag &= ~CUMA_EXTEND_EXTRAPOLATE; curvemap_reset(tex->pd->falloff_curve->cm, &tex->pd->falloff_curve->clipr, tex->pd->falloff_curve->preset, CURVEMAP_SLOPE_POSITIVE); - curvemapping_changed(tex->pd->falloff_curve, 0); + curvemapping_changed(tex->pd->falloff_curve, FALSE); } } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 02b4537e9c8..4ada0c54a93 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -646,15 +646,21 @@ static void write_animdata(WriteData *wd, AnimData *adt) write_nladata(wd, &adt->nla_tracks); } -static void write_curvemapping(WriteData *wd, CurveMapping *cumap) +static void write_curvemapping_curves(WriteData *wd, CurveMapping *cumap) { int a; - - writestruct(wd, DATA, "CurveMapping", 1, cumap); - for (a=0; a<CM_TOT; a++) + + for (a = 0; a < CM_TOT; a++) writestruct(wd, DATA, "CurveMapPoint", cumap->cm[a].totpoint, cumap->cm[a].curve); } +static void write_curvemapping(WriteData *wd, CurveMapping *cumap) +{ + writestruct(wd, DATA, "CurveMapping", 1, cumap); + + write_curvemapping_curves(wd, cumap); +} + static void write_node_socket(WriteData *wd, bNodeSocket *sock) { bNodeSocketType *stype= ntreeGetSocketType(sock->type); @@ -1815,7 +1821,7 @@ static void write_meshs(WriteData *wd, ListBase *idbase) /* backup */ - /* now fill in polys to mfaces*/ + /* now fill in polys to mfaces */ mesh->totface = BKE_mesh_mpoly_to_mface(&mesh->fdata, &backup_mesh.ldata, &backup_mesh.pdata, mesh->totface, backup_mesh.totloop, backup_mesh.totpoly); @@ -2086,6 +2092,32 @@ static void write_lamps(WriteData *wd, ListBase *idbase) } } +static void write_sequence_modifiers(WriteData *wd, ListBase *modbase) +{ + SequenceModifierData *smd; + + for (smd = modbase->first; smd; smd = smd->next) { + SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(smd->type); + + if (smti) { + writestruct(wd, DATA, smti->struct_name, 1, smd); + + if (smd->type == seqModifierType_Curves) { + CurvesModifierData *cmd = (CurvesModifierData *) smd; + + write_curvemapping(wd, &cmd->curve_mapping); + } + else if (smd->type == seqModifierType_HueCorrect) { + HueCorrectModifierData *hcmd = (HueCorrectModifierData *) smd; + + write_curvemapping(wd, &hcmd->curve_mapping); + } + } + else { + writestruct(wd, DATA, "SequenceModifierData", 1, smd); + } + } +} static void write_scenes(WriteData *wd, ListBase *scebase) { @@ -2192,6 +2224,8 @@ static void write_scenes(WriteData *wd, ListBase *scebase) strip->done = TRUE; } + + write_sequence_modifiers(wd, &seq->modifiers); } SEQ_END |