Commit: 8c45d279c9f04937b46f969cdf5ec5b2b8765eaa
Author: Antonio Vazquez
Date:   Wed Jul 4 12:53:14 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB8c45d279c9f04937b46f969cdf5ec5b2b8765eaa

Merge branch 'blender2.8' into greasepencil-object

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

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



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

diff --cc source/blender/blenkernel/intern/object.c
index 80ff1ed8276,61d38a4e937..dc41ec2df31
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@@ -868,46 -830,17 +862,52 @@@ Object *BKE_object_add_from
        return ob;
  }
  
 +/**
 + * Add a new object, but assign the given datablock as the ob->data
 + * for the newly created object.
 + *
 + * \param data The datablock to assign as ob->data for the new object.
 + *             This is assumed to be of the correct type.
 + * \param do_id_user If true, id_us_plus() will be called on data when
 + *                 assigning it to the object.
 + */
 +Object *BKE_object_add_for_data(
 +        Main *bmain, ViewLayer *view_layer,
 +        int type, const char *name, ID *data, bool do_id_user)
 +{
 +      Object *ob;
 +      Base *base;
 +      LayerCollection *layer_collection;
 +
 +      /* same as object_add_common, except we don't create new ob->data */
 +      ob = BKE_object_add_only_object(bmain, type, name);
 +      ob->data = data;
 +      if (do_id_user) id_us_plus(data);
 +
 +      BKE_view_layer_base_deselect_all(view_layer);
 +      DEG_id_tag_update_ex(bmain, &ob->id, OB_RECALC_OB | OB_RECALC_DATA | 
OB_RECALC_TIME);
 +
 +      layer_collection = BKE_layer_collection_get_active(view_layer);
 +      BKE_collection_object_add(bmain, layer_collection->collection, ob);
 +
 +      base = BKE_view_layer_base_find(view_layer, ob);
 +      BKE_view_layer_base_select(view_layer, base);
 +
 +      return ob;
 +}
 +
 +
- SoftBody *copy_softbody(const SoftBody *sb, const int flag)
+ void BKE_object_copy_softbody(struct Object *ob_dst, const struct Object 
*ob_src, const int flag)
  {
+       SoftBody *sb = ob_src->soft;
        SoftBody *sbn;
+       bool tagged_no_main = ob_dst->id.tag & LIB_TAG_NO_MAIN;
  
-       if (sb == NULL) return(NULL);
+       ob_dst->softflag = ob_src->softflag;
+       if (sb == NULL) {
+               ob_dst->soft = NULL;
+               return;
+       }
  
        sbn = MEM_dupallocN(sb);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to