* Group unlinking wasnt removing groups from particle systems, or render layers light overrid.

* BPath sequencer strip looper was only operating on the active scene, now look through all scenes.
* The active sequence strip wasnt being reset when scenes switched, so you could see the previous scenes strip when switching to a new scene.
This commit is contained in:
Campbell Barton 2008-04-27 20:43:25 +00:00
parent 1da7742b8a
commit 9101d5689f
5 changed files with 65 additions and 21 deletions

View File

@ -41,6 +41,7 @@
#include "DNA_object_types.h"
#include "DNA_nla_types.h"
#include "DNA_scene_types.h"
#include "DNA_particle_types.h"
#include "BLI_blenlib.h"
@ -77,11 +78,25 @@ void unlink_group(Group *group)
{
Material *ma;
Object *ob;
Scene *sce;
SceneRenderLayer *srl;
ParticleSystem *psys;
for(ma= G.main->mat.first; ma; ma= ma->id.next) {
if(ma->group==group)
ma->group= NULL;
}
for(ma= G.main->mat.first; ma; ma= ma->id.next) {
if(ma->group==group)
ma->group= NULL;
}
for (sce= G.main->scene.first; sce; sce= sce->id.next) {
for(srl= sce->r.layers.first; srl; srl= srl->next) {
if (srl->light_override==group)
srl->light_override= NULL;
}
}
for(ob= G.main->object.first; ob; ob= ob->id.next) {
bActionStrip *strip;
@ -94,9 +109,13 @@ void unlink_group(Group *group)
strip->object= NULL;
}
}
/* TODO - psys groups */
/* TODO - lamp groups */
/* TODO - render groups */
for(psys=ob->particlesystem.first; psys; psys=psys->next){
if(psys->part->dup_group==group)
psys->part->dup_group= NULL;
if(psys->part->eff_group==group)
psys->part->eff_group= NULL;
}
}
group->id.us= 0;
}

View File

@ -295,6 +295,8 @@ void set_scene_bg(Scene *sce)
GroupObject *go;
int flag;
set_last_seq(NULL);
G.scene= sce;
/* check for cyclic sets, for reading old files but also for definite security (py?) */

View File

@ -33,6 +33,7 @@ struct BPathIteratorSeqData {
int totseq;
int seq;
struct Sequence **seqar; /* Sequence */
struct Scene *scene; /* Current scene */
};
struct BPathIterator {

View File

@ -95,6 +95,7 @@ void BLI_bpathIterator_init( struct BPathIterator *bpi ) {
bpi->seqdata.totseq = 0;
bpi->seqdata.seq = 0;
bpi->seqdata.seqar = NULL;
bpi->seqdata.scene = NULL;
BLI_bpathIterator_step(bpi);
}
@ -103,6 +104,7 @@ void BLI_bpathIterator_free( struct BPathIterator *bpi ) {
if (bpi->seqdata.seqar)
MEM_freeN((void *)bpi->seqdata.seqar);
bpi->seqdata.seqar = NULL;
bpi->seqdata.scene = NULL;
}
void BLI_bpathIterator_getPath( struct BPathIterator *bpi, char *path) {
@ -202,34 +204,52 @@ static struct bSound *snd_stepdata__internal(struct bSound *snd, int step_next)
static struct Sequence *seq_stepdata__internal(struct BPathIterator *bpi, int step_next) {
Sequence *seq;
if (G.scene->ed==NULL) {
return NULL;
}
if (bpi->seqdata.seqar == NULL) {
/* allocate the sequencer array */
build_seqar( &(((Editing *)G.scene->ed)->seqbase), &bpi->seqdata.seqar, &bpi->seqdata.totseq);
bpi->seqdata.seq = 0;
/* Initializing */
if (bpi->seqdata.scene==NULL) {
bpi->seqdata.scene= G.main->scene.first;
}
if (step_next) {
bpi->seqdata.seq++;
}
if (bpi->seqdata.seq >= bpi->seqdata.totseq) {
seq = NULL;
} else {
seq = bpi->seqdata.seqar[bpi->seqdata.seq];
while (!SEQ_HAS_PATH(seq)) {
bpi->seqdata.seq++;
while (bpi->seqdata.scene) {
if (bpi->seqdata.scene->ed) {
if (bpi->seqdata.seqar == NULL) {
/* allocate the sequencer array */
build_seqar( &(((Editing *)bpi->seqdata.scene->ed)->seqbase), &bpi->seqdata.seqar, &bpi->seqdata.totseq);
bpi->seqdata.seq = 0;
}
if (bpi->seqdata.seq >= bpi->seqdata.totseq) {
seq = NULL;
break;
} else {
seq = bpi->seqdata.seqar[bpi->seqdata.seq];
while (!SEQ_HAS_PATH(seq)) {
bpi->seqdata.seq++;
if (bpi->seqdata.seq >= bpi->seqdata.totseq) {
seq = NULL;
break;
}
seq = bpi->seqdata.seqar[bpi->seqdata.seq];
}
}
seq = bpi->seqdata.seqar[bpi->seqdata.seq];
if (seq) {
return seq;
} else {
/* keep looking through the next scene, reallocate seq array */
MEM_freeN((void *)bpi->seqdata.seqar);
bpi->seqdata.seqar = NULL;
bpi->seqdata.scene = bpi->seqdata.scene->id.next;
}
} else {
/* no seq data in this scene, next */
bpi->seqdata.scene = bpi->seqdata.scene->id.next;
}
}
return seq ;
return NULL;
}
void seq_getpath(struct BPathIterator *bpi, char *path) {
@ -638,7 +658,7 @@ void findMissingFiles(char *str) {
char filepath[FILE_MAX], *libpath;
int filesize, recur_depth;
char dirname[FILE_MAX], filename[FILE_MAX], filename_new[FILE_MAX], dummyname[FILE_MAX];
char dirname[FILE_MAX], filename[FILE_MAX], filename_new[FILE_MAX];
waitcursor( 1 );

View File

@ -73,6 +73,8 @@ void set_scene(Scene *sce) /* also see scene.c: set_scene_bg() */
exit_paint_modes();
set_last_seq(NULL);
G.scene= sce;
sc= G.main->screen.first;