[Bf-blender-cvs] [61ee2f0db8e] blender2.8: Merge branch 'master' into blender2.8

Sergey Sharybin noreply at git.blender.org
Thu Nov 15 16:28:42 CET 2018


Commit: 61ee2f0db8ed5ff19f74dd06fb3a3a77f9636ee6
Author: Sergey Sharybin
Date:   Thu Nov 15 16:28:37 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB61ee2f0db8ed5ff19f74dd06fb3a3a77f9636ee6

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/blenkernel/intern/lamp.c
index 2c57a2bdb0a,84a8e11bdc8..1ca794b8a4a
--- a/source/blender/blenkernel/intern/lamp.c
+++ b/source/blender/blenkernel/intern/lamp.c
@@@ -139,14 -157,27 +139,17 @@@ Lamp *BKE_lamp_copy(Main *bmain, const 
  
  Lamp *BKE_lamp_localize(Lamp *la)
  {
- 	/* TODO replace with something like
- 	 * Lamp *la_copy;
- 	 * BKE_id_copy_ex(bmain, &la->id, (ID **)&la_copy, LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT, false);
- 	 * return la_copy;
+ 	/* TODO(bastien): Replace with something like:
  	 *
- 	 * ... Once f*** nodes are fully converted to that too :( */
+ 	 *   Lamp *la_copy;
+ 	 *   BKE_id_copy_ex(bmain, &la->id, (ID **)&la_copy,
+ 	 *                  LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT,
+ 	 *                  false);
+ 	 *   return la_copy;
+ 	 *
+ 	 * NOTE: Only possible once nested node trees are fully converted to that too. */
  
 -	Lamp *lan;
 -	int a;
 -
 -	lan = BKE_libblock_copy_nolib(&la->id, false);
 -
 -	for (a = 0; a < MAX_MTEX; a++) {
 -		if (lan->mtex[a]) {
 -			lan->mtex[a] = MEM_mallocN(sizeof(MTex), __func__);
 -			memcpy(lan->mtex[a], la->mtex[a], sizeof(MTex));
 -		}
 -	}
 +	Lamp *lan = BKE_libblock_copy_nolib(&la->id, false);
  
  	lan->curfalloff = curvemapping_copy(la->curfalloff);
  
diff --cc source/blender/blenkernel/intern/material.c
index 4d764e70ef1,3414d08b8e7..fc0423dc5e5
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@@ -225,22 -273,31 +225,25 @@@ Material *BKE_material_copy(Main *bmain
  /* XXX (see above) material copy without adding to main dbase */
  Material *BKE_material_localize(Material *ma)
  {
- 	/* TODO replace with something like
- 	 * Material *ma_copy;
- 	 * BKE_id_copy_ex(bmain, &ma->id, (ID **)&ma_copy, LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT, false);
- 	 * return ma_copy;
+ 	/* TODO(bastien): Replace with something like:
  	 *
- 	 * ... Once f*** nodes are fully converted to that too :( */
+ 	 *   Material *ma_copy;
+ 	 *   BKE_id_copy_ex(bmain, &ma->id, (ID **)&ma_copy,
+ 	 *                  LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT,
+ 	 *                  false);
+ 	 *   return ma_copy;
+ 	 *
+ 	 * NOTE: Only possible once nested node trees are fully converted to that too. */
  
  	Material *man;
 -	int a;
 -
 -	man = BKE_libblock_copy_nolib(&ma->id, false);
  
 -	/* no increment for texture ID users, in previewrender.c it prevents decrement */
 -	for (a = 0; a < MAX_MTEX; a++) {
 -		if (ma->mtex[a]) {
 -			man->mtex[a] = MEM_mallocN(sizeof(MTex), "copymaterial");
 -			memcpy(man->mtex[a], ma->mtex[a], sizeof(MTex));
 -		}
 -	}
 -
 -	if (ma->ramp_col) man->ramp_col = MEM_dupallocN(ma->ramp_col);
 -	if (ma->ramp_spec) man->ramp_spec = MEM_dupallocN(ma->ramp_spec);
 +	BKE_id_copy_ex(
 +	        NULL, &ma->id, (ID **)&man,
 +	        (LIB_ID_CREATE_NO_MAIN |
 +	         LIB_ID_CREATE_NO_USER_REFCOUNT |
 +	         LIB_ID_COPY_NO_PREVIEW |
 +	         LIB_ID_COPY_NO_ANIMDATA),
 +	        false);
  
  	man->texpaintslot = NULL;
  	man->preview = NULL;
diff --cc source/blender/blenkernel/intern/world.c
index 14a9133f8fb,a44d717bbdd..cb8103588a7
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@@ -142,14 -159,18 +142,17 @@@ World *BKE_world_copy(Main *bmain, cons
  
  World *BKE_world_localize(World *wrld)
  {
- 	/* TODO replace with something like
- 	 * World *wrld_copy;
- 	 * BKE_id_copy_ex(bmain, &wrld->id, (ID **)&wrld_copy, LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT, false);
- 	 * return wrld_copy;
+ 	/* TODO(bastien): Replace with something like:
  	 *
- 	 * ... Once f*** nodes are fully converted to that too :( */
+ 	 *   World *wrld_copy;
+ 	 *   BKE_id_copy_ex(bmain, &wrld->id, (ID **)&wrld_copy,
+ 	 *                  LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT,
+ 	 *                  false);
+ 	 *   return wrld_copy;
+ 	 *
+ 	 * NOTE: Only possible once nested node trees are fully converted to that too. */
  
  	World *wrldn;
 -	int a;
  
  	wrldn = BKE_libblock_copy_nolib(&wrld->id, false);



More information about the Bf-blender-cvs mailing list