diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-06-16 22:09:01 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-06-16 22:12:12 +0300 |
commit | d747bfbe298327a01f03a0c7d1183c98f4c85f4e (patch) | |
tree | f0d4423c60086b77e7eff3c58290345621adb861 /source/blender/blenkernel/intern/library_query.c | |
parent | 503315111e43188fb8bfc003b4979797c433eaa4 (diff) |
Fix/cleanup BKE libquery's ID looper.
Some area were still not in sync with readfile.c, now should be better.
Note that readfile.c has been used as référence here re us refcounting,
not sure how accurate it is, time will say :|
Diffstat (limited to 'source/blender/blenkernel/intern/library_query.c')
-rw-r--r-- | source/blender/blenkernel/intern/library_query.c | 61 |
1 files changed, 44 insertions, 17 deletions
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index d29d2191602..4fe408e755a 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -227,6 +227,14 @@ static void library_foreach_mtex(LibraryForeachIDData *data, MTex *mtex) FOREACH_FINALIZE_VOID; } +static void library_foreach_paint(LibraryForeachIDData *data, Paint *paint) +{ + FOREACH_CALLBACK_INVOKE(data, paint->brush, IDWALK_USER); + FOREACH_CALLBACK_INVOKE(data, paint->palette, IDWALK_USER); + + FOREACH_FINALIZE_VOID; +} + /** * Loop over all of the ID's this datablock links to. @@ -278,7 +286,7 @@ void BKE_library_foreach_ID_link(ID *id, LibraryIDLinkCallback callback, void *u CALLBACK_INVOKE(scene->camera, IDWALK_NOP); CALLBACK_INVOKE(scene->world, IDWALK_USER); CALLBACK_INVOKE(scene->set, IDWALK_NOP); - CALLBACK_INVOKE(scene->clip, IDWALK_NOP); + CALLBACK_INVOKE(scene->clip, IDWALK_USER); CALLBACK_INVOKE(scene->nodetree, IDWALK_NOP); /* DO NOT handle scene->basact here, it's doubling with the loop over whole scene->base later, * since basact is just a pointer to one of those items. */ @@ -318,6 +326,9 @@ void BKE_library_foreach_ID_link(ID *id, LibraryIDLinkCallback callback, void *u CALLBACK_INVOKE(seq->clip, IDWALK_USER); CALLBACK_INVOKE(seq->mask, IDWALK_USER); CALLBACK_INVOKE(seq->sound, IDWALK_USER); + for (SequenceModifierData *smd = seq->modifiers.first; smd; smd = smd->next) { + CALLBACK_INVOKE(smd->mask_id, IDWALK_USER); + } } SEQ_END } @@ -330,28 +341,28 @@ void BKE_library_foreach_ID_link(ID *id, LibraryIDLinkCallback callback, void *u if (toolsett) { CALLBACK_INVOKE(toolsett->skgen_template, IDWALK_NOP); + CALLBACK_INVOKE(toolsett->particle.scene, IDWALK_NOP); CALLBACK_INVOKE(toolsett->particle.object, IDWALK_NOP); CALLBACK_INVOKE(toolsett->particle.shape_object, IDWALK_NOP); - CALLBACK_INVOKE(toolsett->imapaint.stencil, IDWALK_NOP); - CALLBACK_INVOKE(toolsett->imapaint.clone, IDWALK_NOP); - CALLBACK_INVOKE(toolsett->imapaint.canvas, IDWALK_NOP); + + library_foreach_paint(&data, &toolsett->imapaint.paint); + CALLBACK_INVOKE(toolsett->imapaint.stencil, IDWALK_USER); + CALLBACK_INVOKE(toolsett->imapaint.clone, IDWALK_USER); + CALLBACK_INVOKE(toolsett->imapaint.canvas, IDWALK_USER); + if (toolsett->vpaint) { - CALLBACK_INVOKE(toolsett->vpaint->paint.brush, IDWALK_NOP); - CALLBACK_INVOKE(toolsett->vpaint->paint.palette, IDWALK_NOP); + library_foreach_paint(&data, &toolsett->vpaint->paint); } if (toolsett->wpaint) { - CALLBACK_INVOKE(toolsett->wpaint->paint.brush, IDWALK_NOP); - CALLBACK_INVOKE(toolsett->wpaint->paint.palette, IDWALK_NOP); + library_foreach_paint(&data, &toolsett->wpaint->paint); } if (toolsett->sculpt) { - CALLBACK_INVOKE(toolsett->sculpt->paint.brush, IDWALK_NOP); - CALLBACK_INVOKE(toolsett->sculpt->paint.palette, IDWALK_NOP); + library_foreach_paint(&data, &toolsett->sculpt->paint); CALLBACK_INVOKE(toolsett->sculpt->gravity_object, IDWALK_NOP); } if (toolsett->uvsculpt) { - CALLBACK_INVOKE(toolsett->uvsculpt->paint.brush, IDWALK_NOP); - CALLBACK_INVOKE(toolsett->uvsculpt->paint.palette, IDWALK_NOP); + library_foreach_paint(&data, &toolsett->uvsculpt->paint); } } @@ -398,6 +409,7 @@ void BKE_library_foreach_ID_link(ID *id, LibraryIDLinkCallback callback, void *u CALLBACK_INVOKE(object->pd->tex, IDWALK_USER); CALLBACK_INVOKE(object->pd->f_source, IDWALK_NOP); } + /* Note that ob->effect is deprecated, so no need to handle it here. */ if (object->pose) { bPoseChannel *pchan; @@ -608,6 +620,15 @@ void BKE_library_foreach_ID_link(ID *id, LibraryIDLinkCallback callback, void *u CALLBACK_INVOKE(psett->effector_weights->group, IDWALK_NOP); } + if (psett->pd) { + CALLBACK_INVOKE(psett->pd->tex, IDWALK_USER); + CALLBACK_INVOKE(psett->pd->f_source, IDWALK_NOP); + } + if (psett->pd2) { + CALLBACK_INVOKE(psett->pd2->tex, IDWALK_USER); + CALLBACK_INVOKE(psett->pd2->f_source, IDWALK_NOP); + } + if (psett->boids) { BoidState *state; BoidRule *rule; @@ -625,7 +646,6 @@ void BKE_library_foreach_ID_link(ID *id, LibraryIDLinkCallback callback, void *u } } } - break; } @@ -634,16 +654,23 @@ void BKE_library_foreach_ID_link(ID *id, LibraryIDLinkCallback callback, void *u MovieClip *clip = (MovieClip *) id; MovieTracking *tracking = &clip->tracking; MovieTrackingObject *object; + MovieTrackingTrack *track; + MovieTrackingPlaneTrack *plane_track; CALLBACK_INVOKE(clip->gpd, IDWALK_USER); - for (object = tracking->objects.first; object; object = object->next) { - ListBase *tracksbase = BKE_tracking_object_get_tracks(tracking, object); - MovieTrackingTrack *track; - for (track = tracksbase->first; track; track = track->next) { + for (track = tracking->tracks.first; track; track = track->next) { + CALLBACK_INVOKE(track->gpd, IDWALK_USER); + } + for (object = tracking->objects.first; object; object = object->next) { + for (track = object->tracks.first; track; track = track->next) { CALLBACK_INVOKE(track->gpd, IDWALK_USER); } } + + for (plane_track = tracking->plane_tracks.first; plane_track; plane_track = plane_track->next) { + CALLBACK_INVOKE(plane_track->image, IDWALK_USER); + } break; } |