[Bf-blender-cvs] [722451e146] blender2.8: Merge branch 'master' into blender2.8

Bastien Montagne noreply at git.blender.org
Fri Mar 17 11:00:57 CET 2017


Commit: 722451e146d08c1db44ee1265518795684831184
Author: Bastien Montagne
Date:   Fri Mar 17 11:00:41 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB722451e146d08c1db44ee1265518795684831184

Merge branch 'master' into blender2.8

Conflicts:
	source/blender/blenloader/intern/writefile.c

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



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

diff --cc source/blender/blenloader/intern/writefile.c
index 2ffa2f9f64,57be237be6..f21003b66a
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@@ -2312,187 -2286,153 +2286,170 @@@ static void write_mesh(WriteData *wd, M
  		}
  	}
  
- 	mywrite_flush(wd);
+ 	if (vlayers && vlayers != vlayers_buff) {
+ 		MEM_freeN(vlayers);
+ 	}
+ 	if (elayers && elayers != elayers_buff) {
+ 		MEM_freeN(elayers);
+ 	}
+ 	if (flayers && flayers != flayers_buff) {
+ 		MEM_freeN(flayers);
+ 	}
+ 	if (llayers && llayers != llayers_buff) {
+ 		MEM_freeN(llayers);
+ 	}
+ 	if (players && players != players_buff) {
+ 		MEM_freeN(players);
+ 	}
  }
  
- static void write_lattices(WriteData *wd, ListBase *idbase)
+ static void write_lattice(WriteData *wd, Lattice *lt)
  {
- 	for (Lattice *lt = idbase->first; lt; lt = lt->id.next) {
- 		if (lt->id.us > 0 || wd->current) {
- 			/* write LibData */
- 			writestruct(wd, ID_LT, Lattice, 1, lt);
- 			write_iddata(wd, &lt->id);
+ 	if (lt->id.us > 0 || wd->current) {
+ 		/* write LibData */
+ 		writestruct(wd, ID_LT, Lattice, 1, lt);
+ 		write_iddata(wd, &lt->id);
  
- 			/* write animdata */
- 			if (lt->adt) {
- 				write_animdata(wd, lt->adt);
- 			}
+ 		/* write animdata */
+ 		if (lt->adt) {
+ 			write_animdata(wd, lt->adt);
+ 		}
  
- 			/* direct data */
- 			writestruct(wd, DATA, BPoint, lt->pntsu * lt->pntsv * lt->pntsw, lt->def);
+ 		/* direct data */
+ 		writestruct(wd, DATA, BPoint, lt->pntsu * lt->pntsv * lt->pntsw, lt->def);
  
- 			write_dverts(wd, lt->pntsu * lt->pntsv * lt->pntsw, lt->dvert);
- 		}
+ 		write_dverts(wd, lt->pntsu * lt->pntsv * lt->pntsw, lt->dvert);
  	}
- 
- 	mywrite_flush(wd);
  }
  
- static void write_images(WriteData *wd, ListBase *idbase)
+ static void write_image(WriteData *wd, Image *ima)
  {
- 	for (Image *ima = idbase->first; ima; ima = ima->id.next) {
- 		if (ima->id.us > 0 || wd->current) {
- 			ImagePackedFile *imapf;
+ 	if (ima->id.us > 0 || wd->current) {
+ 		ImagePackedFile *imapf;
  
- 			/* Some trickery to keep forward compatibility of packed images. */
- 			BLI_assert(ima->packedfile == NULL);
- 			if (ima->packedfiles.first != NULL) {
- 				imapf = ima->packedfiles.first;
- 				ima->packedfile = imapf->packedfile;
- 			}
+ 		/* Some trickery to keep forward compatibility of packed images. */
+ 		BLI_assert(ima->packedfile == NULL);
+ 		if (ima->packedfiles.first != NULL) {
+ 			imapf = ima->packedfiles.first;
+ 			ima->packedfile = imapf->packedfile;
+ 		}
  
- 			/* write LibData */
- 			writestruct(wd, ID_IM, Image, 1, ima);
- 			write_iddata(wd, &ima->id);
+ 		/* write LibData */
+ 		writestruct(wd, ID_IM, Image, 1, ima);
+ 		write_iddata(wd, &ima->id);
  
- 			for (imapf = ima->packedfiles.first; imapf; imapf = imapf->next) {
- 				writestruct(wd, DATA, ImagePackedFile, 1, imapf);
- 				if (imapf->packedfile) {
- 					PackedFile *pf = imapf->packedfile;
- 					writestruct(wd, DATA, PackedFile, 1, pf);
- 					writedata(wd, DATA, pf->size, pf->data);
- 				}
+ 		for (imapf = ima->packedfiles.first; imapf; imapf = imapf->next) {
+ 			writestruct(wd, DATA, ImagePackedFile, 1, imapf);
+ 			if (imapf->packedfile) {
+ 				PackedFile *pf = imapf->packedfile;
+ 				writestruct(wd, DATA, PackedFile, 1, pf);
+ 				writedata(wd, DATA, pf->size, pf->data);
  			}
+ 		}
  
- 			write_previews(wd, ima->preview);
+ 		write_previews(wd, ima->preview);
  
- 			for (ImageView *iv = ima->views.first; iv; iv = iv->next) {
- 				writestruct(wd, DATA, ImageView, 1, iv);
- 			}
- 			writestruct(wd, DATA, Stereo3dFormat, 1, ima->stereo3d_format);
- 
- 			ima->packedfile = NULL;
+ 		for (ImageView *iv = ima->views.first; iv; iv = iv->next) {
+ 			writestruct(wd, DATA, ImageView, 1, iv);
  		}
- 	}
+ 		writestruct(wd, DATA, Stereo3dFormat, 1, ima->stereo3d_format);
  
- 	mywrite_flush(wd);
+ 		ima->packedfile = NULL;
+ 	}
  }
  
- static void write_textures(WriteData *wd, ListBase *idbase)
+ static void write_texture(WriteData *wd, Tex *tex)
  {
- 	for (Tex *tex = idbase->first; tex; tex = tex->id.next) {
- 		if (tex->id.us > 0 || wd->current) {
- 			/* write LibData */
- 			writestruct(wd, ID_TE, Tex, 1, tex);
- 			write_iddata(wd, &tex->id);
+ 	if (tex->id.us > 0 || wd->current) {
+ 		/* write LibData */
+ 		writestruct(wd, ID_TE, Tex, 1, tex);
+ 		write_iddata(wd, &tex->id);
  
- 			if (tex->adt) {
- 				write_animdata(wd, tex->adt);
- 			}
+ 		if (tex->adt) {
+ 			write_animdata(wd, tex->adt);
+ 		}
  
- 			/* direct data */
- 			if (tex->coba) {
- 				writestruct(wd, DATA, ColorBand, 1, tex->coba);
- 			}
- 			if (tex->type == TEX_ENVMAP && tex->env) {
- 				writestruct(wd, DATA, EnvMap, 1, tex->env);
- 			}
- 			if (tex->type == TEX_POINTDENSITY && tex->pd) {
- 				writestruct(wd, DATA, PointDensity, 1, tex->pd);
- 				if (tex->pd->coba) {
- 					writestruct(wd, DATA, ColorBand, 1, tex->pd->coba);
- 				}
- 				if (tex->pd->falloff_curve) {
- 					write_curvemapping(wd, tex->pd->falloff_curve);
- 				}
- 			}
- 			if (tex->type == TEX_VOXELDATA) {
- 				writestruct(wd, DATA, VoxelData, 1, tex->vd);
- 			}
- 			if (tex->type == TEX_OCEAN && tex->ot) {
- 				writestruct(wd, DATA, OceanTex, 1, tex->ot);
+ 		/* direct data */
+ 		if (tex->coba) {
+ 			writestruct(wd, DATA, ColorBand, 1, tex->coba);
+ 		}
+ 		if (tex->type == TEX_ENVMAP && tex->env) {
+ 			writestruct(wd, DATA, EnvMap, 1, tex->env);
+ 		}
+ 		if (tex->type == TEX_POINTDENSITY && tex->pd) {
+ 			writestruct(wd, DATA, PointDensity, 1, tex->pd);
+ 			if (tex->pd->coba) {
+ 				writestruct(wd, DATA, ColorBand, 1, tex->pd->coba);
  			}
- 
- 			/* nodetree is integral part of texture, no libdata */
- 			if (tex->nodetree) {
- 				writestruct(wd, DATA, bNodeTree, 1, tex->nodetree);
- 				write_nodetree(wd, tex->nodetree);
+ 			if (tex->pd->falloff_curve) {
+ 				write_curvemapping(wd, tex->pd->falloff_curve);
  			}
+ 		}
+ 		if (tex->type == TEX_VOXELDATA) {
+ 			writestruct(wd, DATA, VoxelData, 1, tex->vd);
+ 		}
+ 		if (tex->type == TEX_OCEAN && tex->ot) {
+ 			writestruct(wd, DATA, OceanTex, 1, tex->ot);
+ 		}
  
- 			write_previews(wd, tex->preview);
+ 		/* nodetree is integral part of texture, no libdata */
+ 		if (tex->nodetree) {
+ 			writestruct(wd, DATA, bNodeTree, 1, tex->nodetree);
+ 			write_nodetree_nolib(wd, tex->nodetree);
  		}
- 	}
  
- 	mywrite_flush(wd);
+ 		write_previews(wd, tex->preview);
+ 	}
  }
  
 +static void write_material_engines_settings(WriteData *wd, ListBase *lb)
 +{
 +	for (MaterialEngineSettings *res = lb->first; res; res = res->next) {
 +		writestruct(wd, DATA, MaterialEngineSettings, 1, res);
 +
 +		if (STREQ(res->name, RE_engine_id_BLENDER_CLAY)) {
 +			writestruct(wd, DATA, MaterialEngineSettingsClay, 1, res->data);
 +		}
 +		else {
 +			/* No engine matched */
 +			/* error: don't know how to write this file */
 +		}
 +	}
 +}
 +
- static void write_materials(WriteData *wd, ListBase *idbase)
+ static void write_material(WriteData *wd, Material *ma)
  {
- 	for (Material *ma = idbase->first; ma; ma = ma->id.next) {
- 		if (ma->id.us > 0 || wd->current) {
- 			/* write LibData */
- 			writestruct(wd, ID_MA, Material, 1, ma);
- 			write_iddata(wd, &ma->id);
+ 	if (ma->id.us > 0 || wd->current) {
+ 		/* write LibData */
+ 		writestruct(wd, ID_MA, Material, 1, ma);
+ 		write_iddata(wd, &ma->id);
  
- 			if (ma->adt) {
- 				write_animdata(wd, ma->adt);
- 			}
+ 		if (ma->adt) {
+ 			write_animdata(wd, ma->adt);
+ 		}
  
- 			for (int a = 0; a < MAX_MTEX; a++) {
- 				if (ma->mtex[a]) {
- 					writestruct(wd, DATA, MTex, 1, ma->mtex[a]);
- 				}
+ 		for (int a = 0; a < MAX_MTEX; a++) {
+ 			if (ma->mtex[a]) {
+ 				writestruct(wd, DATA, MTex, 1, ma->mtex[a]);
  			}
+ 		}
  
- 			if (ma->ramp_col) {
- 				writestruct(wd, DATA, ColorBand, 1, ma->ramp_col);
- 			}
- 			if (ma->ramp_spec) {
- 				writestruct(wd, DATA, ColorBand, 1, ma->ramp_spec);
- 			}
+ 		if (ma->ramp_col) {
+ 			writestruct(wd, DATA, ColorBand, 1, ma->ramp_col);
+ 		}
+ 		if (ma->ramp_spec) {
+ 			writestruct(wd, DATA, ColorBand, 1, ma->ramp_spec);
+ 		}
  
- 			/* nodetree is integral part of material, no libdata */
- 			if (ma->nodetree) {
- 				writestruct(wd, DATA, bNodeTree, 1, ma->nodetree);
- 				write_nodetree(wd, ma->nodetree);
- 			}
+ 		/* nodetree is integral part of material, no libdata */
+ 		if (ma->nodetree) {
+ 			writestruct(wd, DATA, bNodeTree, 1, ma->nodetree);
+ 			write_nodetree_nolib(wd, ma->nodetree);
+ 		}
  
- 			write_previews(wd, ma->preview);
+ 		write_previews(wd, ma->preview);
 +
- 			write_material_engines_settings(wd, &ma->engines_settings);
- 		}
++		write_material_engines_settings(wd, &ma->engines_settings);
  	}
  }
  
@@@ -2602,343 -2536,253 +2553,328 @@@ static void write_paint(WriteData *wd, 
  	}
  }
  
 +static void write_scene_collection(WriteData *wd, SceneCollection *sc)
 +{
 +	writestruct(wd, DATA, SceneCollection, 1, sc);
 +
 +	writelist(wd, DATA, LinkData, &sc->objects);
 +	writelist(wd, DATA, LinkData, &sc->filter_objects);
 +
 +	for (SceneCollection *nsc = sc->scene_collections.first; nsc; nsc = nsc->next) {
 +		write_scene_collection(wd, nsc);
 +	}
 +}
 +
 +static void write_collection_engine_settings(WriteData *wd, ListBase *lb)
 +{
 +	for (CollectionEngineSettings *ces = lb->first; ces; ces = ces->next) {
 +		writestruct(wd, DATA, CollectionEngineSettings, 1, ces);
 +
 +		for (CollectionEngineProperty *prop = ces->properties.first; prop; prop = prop->next) {
 +			switch (prop->type) {
 +			    case COLLECTION_PROP_TYPE_FLOAT:
 +				    writestruct(wd, DATA, CollectionEnginePropertyFloat, 1, prop);
 +				    break;
 +			    case COLLECTION_PROP_TYPE_INT:
 +				    writestruct(wd, DATA, CollectionEnginePropertyInt, 1, prop);
 +				    break;
 +			    case COLLECTION_PROP_TYPE_BOOL:
 +				    writestruct(wd, DATA, CollectionEnginePropertyBool, 1, prop);
 +				    break;
 +			    default:
 +				    ; /* error: don't know how to write this file */
 +			}
 +		}
 +	}
 +}
 +
 +static void write_layer_collections(WriteData *wd, ListBase *lb)
 +{
 +	for (LayerCollection *lc = lb->first; lc; lc = lc->next) {
 +		writestruct(wd, DATA, LayerCollection, 1, lc);
 +
 +		writelist(wd, DATA, LinkData, &lc->object_bases);
 +		writelist(wd, DATA, Colle

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list