Merge branch 'master' into blender2.8
authorSybren A. Stüvel <sybren@stuvel.eu>
Wed, 8 Feb 2017 12:10:16 +0000 (13:10 +0100)
committerSybren A. Stüvel <sybren@stuvel.eu>
Wed, 8 Feb 2017 12:10:16 +0000 (13:10 +0100)
# Conflicts:
# source/blender/blenloader/intern/writefile.c

17 files changed:
1  2 
release/scripts/startup/bl_ui/space_view3d.py
source/blender/alembic/intern/abc_exporter.cc
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/sound.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/armature/editarmature_sketch.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/space_view3d/view3d_ruler.c
source/blender/editors/space_view3d/view3d_walk.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/transform/transform_snap_object.c
source/blender/modifiers/intern/MOD_displace.c
source/blender/modifiers/intern/MOD_explode.c
source/blenderplayer/bad_level_call_stubs/stubs.c

index bc567edd7ad7989418415ba5df0a7432848f8552,f467010f08717194be5745f77d74c4df9f76b5f3..16d73557bb0b08bcae7c02ddac2c0ea8782b2cf3
@@@ -2469,28 -2397,9 +2398,24 @@@ static void write_textures(WriteData *w
        mywrite_flush(wd);
  }
  
 +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)
  {
-       Material *ma;
-       int a;
-       ma = idbase->first;
-       while (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_previews(wd, ma->preview);
 +
 +                      write_material_engines_settings(wd, &ma->engines_settings);
                }
-               ma = ma->id.next;
        }
  }
  
@@@ -2644,86 -2539,9 +2557,70 @@@ 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;
 +                          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, CollectionOverride, &lc->overrides);
 +
 +              write_collection_engine_settings(wd, &lc->engine_settings);
 +
 +              write_layer_collections(wd, &lc->layer_collections);
 +      }
 +}
 +
 +static void write_render_engines_settings(WriteData *wd, ListBase *lb)
 +{
 +      for (RenderEngineSettings *res = lb->first; res; res = res->next) {
 +              writestruct(wd, DATA, RenderEngineSettings, 1, res);
 +
 +              if (STREQ(res->name, RE_engine_id_BLENDER_CLAY)) {
 +                      writestruct(wd, DATA, RenderEngineSettingsClay, 1, res->data);
 +              }
 +              else {
 +                      /* No engine matched */
 +                      /* error: don't know how to write this file */
 +              }
 +      }
 +}
 +
  static void write_scenes(WriteData *wd, ListBase *scebase)
  {
-       Scene *sce;
-       BaseLegacy *base;
-       Editing *ed;
-       Sequence *seq;
-       MetaStack *ms;
-       Strip *strip;
-       TimeMarker *marker;
-       TransformOrientation *ts;
-       SceneRenderLayer *srl;
-       SceneRenderView *srv;
-       ToolSettings *tos;
-       FreestyleModuleConfig *fmc;
-       FreestyleLineSet *fls;
-       SceneLayer *sl;
-       sce = scebase->first;
-       while (sce) {
+       for (Scene *sce = scebase->first; sce; sce = sce->id.next) {
                /* write LibData */
                writestruct(wd, ID_SCE, Scene, 1, sce);
                write_iddata(wd, &sce->id);
                write_keyingsets(wd, &sce->keyingsets);
  
                /* direct data */
-               base = sce->base.first;
-               while (base) {
 -              for (Base *base = sce->base.first; base; base = base->next) {
 -                      writestruct(wd, DATA, Base, 1, base);
++              for (BaseLegacy *base = sce->base.first; base; base = base->next) {
 +                      writestruct(wd, DATA, BaseLegacy, 1, base);
-                       base = base->next;
                }
  
-               tos = sce->toolsettings;
+               ToolSettings *tos = sce->toolsettings;
                writestruct(wd, DATA, ToolSettings, 1, tos);
                if (tos->vpaint) {
                        writestruct(wd, DATA, VPaint, 1, tos->vpaint);
  
                write_previews(wd, sce->preview);
                write_curvemapping_curves(wd, &sce->r.mblur_shutter_curve);
 +              write_scene_collection(wd, sce->collection);
 +
-               for (sl = sce->render_layers.first; sl; sl = sl->next) {
++              for (SceneLayer *sl = sce->render_layers.first; sl; sl = sl->next) {
 +                      writestruct(wd, DATA, SceneLayer, 1, sl);
 +                      writelist(wd, DATA, Base, &sl->object_bases);
 +                      write_layer_collections(wd, &sl->layer_collections);
 +              }
 +
 +              write_render_engines_settings(wd, &sce->engines_settings);
 +
-               sce = sce->id.next;
        }
  
        mywrite_flush(wd);
@@@ -3101,10 -2890,8 +2979,10 @@@ static void write_screens(WriteData *wd
                writestruct(wd, ID_SCRN, bScreen, 1, sc);
                write_iddata(wd, &sc->id);
  
 +              write_previews(wd, sc->preview);
 +
                /* direct data */
-               for (sv = sc->vertbase.first; sv; sv = sv->next) {
+               for (ScrVert *sv = sc->vertbase.first; sv; sv = sv->next) {
                        writestruct(wd, DATA, ScrVert, 1, sv);
                }
  
                                else if (sl->spacetype == SPACE_INFO) {
                                        writestruct(wd, DATA, SpaceInfo, 1, sl);
                                }
-                               sl = sl->next;
 +                              else if (sl->spacetype == SPACE_COLLECTIONS) {
 +                                      writestruct(wd, DATA, SpaceCollections, 1, sl);
 +                              }
                        }
                }
-               sc = sc->id.next;
        }
  
        mywrite_flush(wd);