[Bf-blender-cvs] [6a95105] id-remap: Merge branch 'libquery-recursive' into id-remap

Bastien Montagne noreply at git.blender.org
Thu Feb 18 23:11:51 CET 2016


Commit: 6a951054d0efda0e2222855d92b50471ca9428de
Author: Bastien Montagne
Date:   Thu Feb 18 18:10:57 2016 +0100
Branches: id-remap
https://developer.blender.org/rB6a951054d0efda0e2222855d92b50471ca9428de

Merge branch 'libquery-recursive' into id-remap

Conflicts:
	source/blender/blenkernel/intern/library_query.c

===================================================================



===================================================================

diff --cc source/blender/blenkernel/intern/library_query.c
index cf186b6,2a9f449..0e22a4f
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@@ -62,7 -61,8 +62,9 @@@
  #include "DNA_world_types.h"
  
  #include "BLI_utildefines.h"
 +#include "BLI_listbase.h"
+ #include "BLI_ghash.h"
+ #include "BLI_linklist_stack.h"
  
  #include "BKE_animsys.h"
  #include "BKE_constraint.h"
@@@ -158,20 -194,11 +197,24 @@@ static void library_foreach_actuatorsOb
          bActuator *UNUSED(actuator), ID **id_pointer, void *user_data, int cd_flag)
  {
  	LibraryForeachIDData *data = (LibraryForeachIDData *) user_data;
- 	FOREACH_CALLBACK_INVOKE_ID_PP(data->self_id, id_pointer, data->flag, data->callback, data->user_data, cd_flag);
+ 	FOREACH_CALLBACK_INVOKE_ID_PP(data, id_pointer, cd_flag);
+ 
+ 	FOREACH_FINALIZE_VOID;
  }
  
 +static void library_foreach_nla_strip(LibraryForeachIDData *data, NlaStrip *strip)
 +{
 +	NlaStrip *substrip;
 +
- 	FOREACH_CALLBACK_INVOKE(data->self_id, strip->act, data->flag, data->callback, data->user_data, IDWALK_USER);
++	FOREACH_CALLBACK_INVOKE(data, strip->act, IDWALK_USER);
 +
 +	for (substrip = strip->strips.first; substrip; substrip = substrip->next) {
 +		library_foreach_nla_strip(data, substrip);
 +	}
++
++	FOREACH_FINALIZE_VOID;
 +}
 +
  static void library_foreach_animationData(LibraryForeachIDData *data, AnimData *adt)
  {
  	FCurve *fcu;
@@@ -193,14 -217,7 +235,16 @@@
  		}
  	}
  
- 	FOREACH_CALLBACK_INVOKE(data->self_id, adt->action, data->flag, data->callback, data->user_data, IDWALK_USER);
- 	FOREACH_CALLBACK_INVOKE(data->self_id, adt->tmpact, data->flag, data->callback, data->user_data, IDWALK_USER);
++	FOREACH_CALLBACK_INVOKE(data, adt->action, IDWALK_USER);
++	FOREACH_CALLBACK_INVOKE(data, adt->tmpact, IDWALK_USER);
 +
 +	for (nla_track = adt->nla_tracks.first; nla_track; nla_track = nla_track->next) {
 +		for (nla_strip = nla_track->strips.first; nla_strip; nla_strip = nla_strip->next) {
 +			library_foreach_nla_strip(data, nla_strip);
 +		}
 +	}
++
+ 	FOREACH_FINALIZE_VOID;
  }
  
  static void library_foreach_mtex(LibraryForeachIDData *data, MTex *mtex)
@@@ -232,469 -261,455 +288,479 @@@ void BKE_library_foreach_ID_link(ID *id
  	}
  
  #define CALLBACK_INVOKE_ID(check_id, cb_flag) \
- 	FOREACH_CALLBACK_INVOKE_ID(id, check_id, flag, callback, user_data, cb_flag)
+ 	FOREACH_CALLBACK_INVOKE_ID(&data, check_id, cb_flag)
  
  #define CALLBACK_INVOKE(check_id_super, cb_flag) \
- 	FOREACH_CALLBACK_INVOKE(id, check_id_super, flag, callback, user_data, cb_flag)
- 
- 	switch (GS(id->name)) {
- 		case ID_LI:
- 		{
- 			Library *lib = (Library *) id;
- 			CALLBACK_INVOKE(lib->parent, IDWALK_NOP);
- 			break;
- 		}
- 		case ID_SCE:
- 		{
- 			Scene *scene = (Scene *) id;
- 			ToolSettings *toolsett = scene->toolsettings;
- 			SceneRenderLayer *srl;
- 			Base *base;
- 
- 			CALLBACK_INVOKE(scene->camera, IDWALK_NOP);
- 			CALLBACK_INVOKE(scene->world, IDWALK_USER);
- 			CALLBACK_INVOKE(scene->set, IDWALK_NOP);
- 			CALLBACK_INVOKE(scene->clip, IDWALK_NOP);
- 			if (scene->nodetree) {
- 				/* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */
- 				BKE_library_foreach_ID_link((ID *)scene->nodetree, callback, user_data, flag);
- 			}
- 			/* 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. */
- 			CALLBACK_INVOKE(scene->obedit, IDWALK_NOP);
+ 	FOREACH_CALLBACK_INVOKE(&data, check_id_super, cb_flag)
  
- 			for (srl = scene->r.layers.first; srl; srl = srl->next) {
- 				FreestyleModuleConfig *fmc;
- 				FreestyleLineSet *fls;
+ 	do {
+ 		data.id_self = id;
  
- 				if (srl->mat_override) {
- 					CALLBACK_INVOKE(srl->mat_override, IDWALK_USER);
- 				}
- 				if (srl->light_override) {
- 					CALLBACK_INVOKE(srl->light_override, IDWALK_USER);
+ 		switch (GS(id->name)) {
++			case ID_LI:
++			{
++				Library *lib = (Library *) id;
++				CALLBACK_INVOKE(lib->parent, IDWALK_NOP);
++				break;
++			}
+ 			case ID_SCE:
+ 			{
+ 				Scene *scene = (Scene *) id;
+ 				ToolSettings *toolsett = scene->toolsettings;
+ 				SceneRenderLayer *srl;
+ 				Base *base;
+ 
+ 				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->nodetree, IDWALK_NOP);
++				if (scene->nodetree) {
++					/* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */
++					BKE_library_foreach_ID_link((ID *)scene->nodetree, callback, user_data, flag);
 +				}
- 				for (fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) {
- 					if (fmc->script) {
- 						CALLBACK_INVOKE(fmc->script, 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. */
+ 				CALLBACK_INVOKE(scene->obedit, IDWALK_NOP);
+ 
+ 				for (srl = scene->r.layers.first; srl; srl = srl->next) {
+ 					FreestyleModuleConfig *fmc;
+ 					FreestyleLineSet *fls;
+ 
+ 					if (srl->mat_override) {
+ 						CALLBACK_INVOKE(srl->mat_override, IDWALK_USER);
  					}
- 				}
- 				for (fls = srl->freestyleConfig.linesets.first; fls; fls = fls->next) {
- 					if (fls->group) {
- 						CALLBACK_INVOKE(fls->group, IDWALK_USER);
+ 					if (srl->light_override) {
+ 						CALLBACK_INVOKE(srl->light_override, IDWALK_USER);
  					}
- 					if (fls->linestyle) {
- 						CALLBACK_INVOKE(fls->linestyle, IDWALK_USER);
+ 					for (fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) {
+ 						if (fmc->script) {
+ 							CALLBACK_INVOKE(fmc->script, IDWALK_NOP);
+ 						}
+ 					}
+ 					for (fls = srl->freestyleConfig.linesets.first; fls; fls = fls->next) {
+ 						if (fls->group) {
+ 							CALLBACK_INVOKE(fls->group, IDWALK_USER);
+ 						}
+ 						if (fls->linestyle) {
+ 							CALLBACK_INVOKE(fls->linestyle, IDWALK_USER);
+ 						}
  					}
  				}
- 			}
  
- 			if (scene->ed) {
- 				Sequence *seq;
- 				SEQP_BEGIN(scene->ed, seq)
- 				{
- 					CALLBACK_INVOKE(seq->scene, IDWALK_NOP);
- 					CALLBACK_INVOKE(seq->scene_camera, IDWALK_NOP);
- 					CALLBACK_INVOKE(seq->clip, IDWALK_USER);
- 					CALLBACK_INVOKE(seq->mask, IDWALK_USER);
- 					CALLBACK_INVOKE(seq->sound, IDWALK_USER);
- 				}
- 				SEQ_END
- 			}
+ 				if (scene->ed) {
+ 					Sequence *seq;
+ 					SEQP_BEGIN(scene->ed, seq)
+ 					{
+ 						CALLBACK_INVOKE(seq->scene, IDWALK_NOP);
+ 						CALLBACK_INVOKE(seq->scene_camera, IDWALK_NOP);
+ 						CALLBACK_INVOKE(seq->clip, IDWALK_USER);
+ 						CALLBACK_INVOKE(seq->mask, IDWALK_USER);
+ 						CALLBACK_INVOKE(seq->sound, IDWALK_USER);
+ 					}
+ 					SEQ_END
+ 				}
  
- 			CALLBACK_INVOKE(scene->gpd, IDWALK_USER);
+ 				CALLBACK_INVOKE(scene->gpd, IDWALK_USER);
  
- 			for (base = scene->base.first; base; base = base->next) {
- 				CALLBACK_INVOKE(base->object, IDWALK_USER | IDWALK_NEVER_NULL);
- 			}
+ 				for (base = scene->base.first; base; base = base->next) {
+ 					CALLBACK_INVOKE(base->object, IDWALK_USER);
+ 				}
  
- 			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);
- 				if (toolsett->vpaint) {
- 					CALLBACK_INVOKE(toolsett->vpaint->paint.brush, IDWALK_NOP);
- 					CALLBACK_INVOKE(toolsett->vpaint->paint.palette, IDWALK_NOP);
- 				}
- 				if (toolsett->wpaint) {
- 					CALLBACK_INVOKE(toolsett->wpaint->paint.brush, IDWALK_NOP);
- 					CALLBACK_INVOKE(toolsett->wpaint->paint.palette, IDWALK_NOP);
- 				}
- 				if (toolsett->sculpt) {
- 					CALLBACK_INVOKE(toolsett->sculpt->paint.brush, IDWALK_NOP);
- 					CALLBACK_INVOKE(toolsett->sculpt->paint.palette, IDWALK_NOP);
- 					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);
+ 				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);
+ 					if (toolsett->vpaint) {
+ 						CALLBACK_INVOKE(toolsett->vpaint->paint.brush, IDWALK_NOP);
+ 						CALLBACK_INVOKE(toolsett->vpaint->paint.palette, IDWALK_NOP);
+ 					}
+ 					if (toolsett->wpaint) {
+ 						CALLBACK_INVOKE(toolsett->wpaint->paint.brush, IDWALK_NOP);
+ 						CALLBACK_INVOKE(toolsett->wpaint->paint.palette, IDWALK_NOP);
+ 					}
+ 					if (toolsett->sculpt) {
+ 						CALLBACK_INVOKE(toolsett->sculpt->paint.brush, IDWALK_NOP);
+ 						CALLBACK_INVOKE(toolsett->sculpt->paint.palette, IDWALK_NOP);
+ 						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);
+ 					}
  				}
- 			}
  
- 			if (scene->rigidbody_world) {
- 				BKE_rigidbody_world_id_loop(scene->rigidbody_world, library_foreach_rigidbodyworldSceneLooper, &data);
- 			}
+ 				if (scene->rigidbody_world) {
+ 					BKE_rigidbody_world_id_loop(scene->rigidbody_world, library_foreach_rigidbodyworldSceneLooper, &data);
+ 				}
  
- 			CALLBACK_INVOKE(scene->gm.dome.warptext, IDWALK_NOP);
+ 				CALLBACK_INVOKE(scene->gm.dome.warptext, IDWALK_NOP);
  
- 			break;
- 		}
+ 				break;
+ 			}
  
- 		case ID_OB:
- 		{
- 			Object *object = (Object *) id;


@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list