Merge commit '212a8d9e5ae7' into blender2.8
authorDalai Felinto <dfelinto@gmail.com>
Wed, 15 Nov 2017 09:11:01 +0000 (07:11 -0200)
committerDalai Felinto <dfelinto@gmail.com>
Wed, 15 Nov 2017 09:40:27 +0000 (07:40 -0200)
Considerable non-trivial merge conflict fixes.

1  2 
intern/cycles/blender/blender_object.cpp
intern/cycles/blender/blender_sync.h
source/blender/makesrna/intern/makesrna.c

index a25ae278058a031b457b480c0185a570e93ba727,f02d54961126babded56f933ccbb038896e0952c..ee153b8602d0ff134c2ea8da748279ecfef04915
@@@ -112,7 -112,7 +112,8 @@@ static uint object_ray_visibility(BL::O
  void BlenderSync::sync_light(BL::Object& b_parent,
                               int persistent_id[OBJECT_PERSISTENT_ID_SIZE],
                               BL::Object& b_ob,
 -                             BL::DupliObject& b_dupli_ob,
 +                             BL::Object& b_ob_instance,
++                             int random_id,
                               Transform& tfm,
                               bool *use_portal)
  {
  
        light->max_bounces = get_int(clamp, "max_bounces");
  
 -      if(b_dupli_ob) {
 -              light->random_id = b_dupli_ob.random_id();
++      if(b_ob != b_ob_instance) {
++              light->random_id = random_id;
+       }
+       else {
+               light->random_id = hash_int_2d(hash_string(b_ob.name().c_str()), 0);
+       }
        if(light->type == LIGHT_AREA)
                light->is_portal = get_boolean(clamp, "is_portal");
        else
@@@ -280,16 -278,8 +288,17 @@@ Object *BlenderSync::sync_object(BL::De
        /* light is handled separately */
        if(object_is_light(b_ob)) {
                /* don't use lamps for excluded layers used as mask layer */
 -              if(!motion && !((layer_flag & render_layer.holdout_layer) && (layer_flag & render_layer.exclude_layer)))
 -                      sync_light(b_parent, persistent_id, b_ob, b_dupli_ob, tfm, use_portal);
 +              if(!motion && !((layer_flag & render_layer.holdout_layer) &&
 +                              (layer_flag & render_layer.exclude_layer)))
 +              {
 +                      sync_light(b_parent,
 +                                 persistent_id,
 +                                 b_ob,
 +                                 b_ob_instance,
++                                 b_dupli_iter->random_id(),
 +                                 tfm,
 +                                 use_portal);
 +              }
  
                return NULL;
        }
index 544836f097933b8858fe98a6dc766ae0ba0bf6fe,e7b71ae9310ec9f93dd122c3ea3d6b6fd0029f5b..88f7ea7975c22ac886f576cc3e3d355265e91f36
@@@ -133,7 -131,7 +133,8 @@@ private
        void sync_light(BL::Object& b_parent,
                        int persistent_id[OBJECT_PERSISTENT_ID_SIZE],
                        BL::Object& b_ob,
 -                      BL::DupliObject& b_dupli_ob,
 +                      BL::Object& b_ob_instance,
++                      int random_id,
                        Transform& tfm,
                        bool *use_portal);
        void sync_background_light(bool use_portal);
index 720f7324bdb3c0c82b7ffffd9a3ef3f0a83487ba,2c558e56412a64b808010db852f7c5a06371da88..6c6407789a0e9f37b4baf950de0e5cd178deb31f
@@@ -3704,6 -3700,6 +3704,9 @@@ static const char *cpp_classes = "
  "     operator void*() { return ptr.data; }\n"
  "     operator bool() { return ptr.data != NULL; }\n"
  "\n"
++"     bool operator==(const Pointer &other) { return ptr.data == other.ptr.data; }\n"
++"     bool operator!=(const Pointer &other) { return ptr.data != other.ptr.data; }\n"
++"\n"
  "     PointerRNA ptr;\n"
  "};\n"
  "\n"