Merge branch 'master' into blender2.8
authorBastien Montagne <montagne29@wanadoo.fr>
Fri, 7 Oct 2016 09:50:17 +0000 (11:50 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Fri, 7 Oct 2016 09:50:17 +0000 (11:50 +0200)
1  2 
source/blender/blenkernel/intern/library_query.c

index c8b0900f217773e718f107b058152adc3e8be2dd,08f9c439a7ac0a9981cdf6d0a91f32c6b903f6f5..a7c94bbb8be52c06733dc2a5985ea2009e611229
@@@ -51,7 -51,6 +51,7 @@@
  #include "DNA_mask_types.h"
  #include "DNA_node_types.h"
  #include "DNA_object_force.h"
 +#include "DNA_object_types.h"
  #include "DNA_rigidbody_types.h"
  #include "DNA_scene_types.h"
  #include "DNA_sensor_types.h"
@@@ -64,6 -63,7 +64,6 @@@
  #include "DNA_world_types.h"
  
  #include "BLI_utildefines.h"
 -#include "BLI_listbase.h"
  #include "BLI_ghash.h"
  #include "BLI_linklist_stack.h"
  
@@@ -74,6 -74,7 +74,6 @@@
  #include "BKE_library_query.h"
  #include "BKE_main.h"
  #include "BKE_modifier.h"
 -#include "BKE_particle.h"
  #include "BKE_rigidbody.h"
  #include "BKE_sca.h"
  #include "BKE_sequencer.h"
@@@ -166,6 -167,15 +166,6 @@@ static void library_foreach_constraintO
        FOREACH_FINALIZE_VOID;
  }
  
 -static void library_foreach_particlesystemsObjectLooper(
 -        ParticleSystem *UNUSED(psys), ID **id_pointer, void *user_data, int cd_flag)
 -{
 -      LibraryForeachIDData *data = (LibraryForeachIDData *) user_data;
 -      FOREACH_CALLBACK_INVOKE_ID_PP(data, id_pointer, cd_flag);
 -
 -      FOREACH_FINALIZE_VOID;
 -}
 -
  static void library_foreach_sensorsObjectLooper(
          bSensor *UNUSED(sensor), ID **id_pointer, void *user_data, int cd_flag)
  {
@@@ -392,6 -402,10 +392,6 @@@ void BKE_library_foreach_ID_link(ID *id
                                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);
 -
                                        library_foreach_paint(&data, &toolsett->imapaint.paint);
                                        CALLBACK_INVOKE(toolsett->imapaint.stencil, IDWALK_USER);
                                        CALLBACK_INVOKE(toolsett->imapaint.clone, IDWALK_USER);
                        case ID_OB:
                        {
                                Object *object = (Object *) id;
 -                              ParticleSystem *psys;
  
                                /* Object is special, proxies make things hard... */
                                const int data_cd_flag = data.cd_flag;
                                modifiers_foreachIDLink(object, library_foreach_modifiersForeachIDLink, &data);
                                BKE_constraints_id_loop(&object->constraints, library_foreach_constraintObjectLooper, &data);
  
 -                              for (psys = object->particlesystem.first; psys; psys = psys->next) {
 -                                      BKE_particlesystem_id_loop(psys, library_foreach_particlesystemsObjectLooper, &data);
 -                              }
 -
                                if (object->soft) {
                                        CALLBACK_INVOKE(object->soft->collision_group, IDWALK_NOP);
  
                                break;
                        }
  
 -                      case ID_PA:
 -                      {
 -                              ParticleSettings *psett = (ParticleSettings *) id;
 -                              CALLBACK_INVOKE(psett->dup_group, IDWALK_NOP);
 -                              CALLBACK_INVOKE(psett->dup_ob, IDWALK_NOP);
 -                              CALLBACK_INVOKE(psett->bb_ob, IDWALK_NOP);
 -                              CALLBACK_INVOKE(psett->collision_group, IDWALK_NOP);
 -
 -                              for (i = 0; i < MAX_MTEX; i++) {
 -                                      if (psett->mtex[i]) {
 -                                              library_foreach_mtex(&data, psett->mtex[i]);
 -                                      }
 -                              }
 -
 -                              if (psett->effector_weights) {
 -                                      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;
 -
 -                                      for (state = psett->boids->states.first; state; state = state->next) {
 -                                              for (rule = state->rules.first; rule; rule = rule->next) {
 -                                                      if (rule->type == eBoidRuleType_Avoid) {
 -                                                              BoidRuleGoalAvoid *gabr = (BoidRuleGoalAvoid *)rule;
 -                                                              CALLBACK_INVOKE(gabr->ob, IDWALK_NOP);
 -                                                      }
 -                                                      else if (rule->type == eBoidRuleType_FollowLeader) {
 -                                                              BoidRuleFollowLeader *flbr = (BoidRuleFollowLeader *)rule;
 -                                                              CALLBACK_INVOKE(flbr->ob, IDWALK_NOP);
 -                                                      }
 -                                              }
 -                                      }
 -                              }
 -                              break;
 -                      }
 -
                        case ID_MC:
                        {
                                MovieClip *clip = (MovieClip *) id;
@@@ -879,7 -945,7 +879,7 @@@ bool BKE_library_idtype_can_use_idtype(
                        /* Could be the following, but simpler to just always say 'yes' here. */
  #if 0
                        return ELEM(id_type_used, ID_ME, ID_CU, ID_MB, ID_LT, ID_SPK, ID_AR, ID_LA, ID_CA,  /* obdata */
 -                                                ID_OB, ID_MA, ID_GD, ID_GR, ID_TE, ID_PA, ID_TXT, ID_SO, ID_MC, ID_IM, ID_AC
 +                                                ID_OB, ID_MA, ID_GD, ID_GR, ID_TE, ID_TXT, ID_SO, ID_MC, ID_IM, ID_AC
                                                  /* + constraints, modifiers and game logic ID types... */);
  #else
                        return true;
  #endif
                case ID_BR:
                        return ELEM(id_type_used, ID_BR, ID_IM, ID_PC, ID_TE);
 -              case ID_PA:
 -                      return ELEM(id_type_used, ID_OB, ID_GR, ID_TE);
                case ID_MC:
                        return ELEM(id_type_used, ID_GD, ID_IM);
                case ID_MSK:
@@@ -968,6 -1036,10 +968,10 @@@ static int foreach_libblock_id_users_ca
        if ((GS(self_id->name) == ID_KE) && (((Key *)self_id)->from == *id_p)) {
                return IDWALK_RET_NOP;
        }
+       /* XXX another hack, for similar reasons as above one. */
+       if ((GS(self_id->name) == ID_OB) && (((Object *)self_id)->proxy_from == (Object *)*id_p)) {
+               return IDWALK_RET_NOP;
+       }
  
        if (*id_p && (*id_p == iter->id)) {
  #if 0