Commit: 6112cde3f90e4e0f2ba5fc37150efcd239b97250
Author: Campbell Barton
Date:   Thu Jan 11 10:14:34 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB6112cde3f90e4e0f2ba5fc37150efcd239b97250

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/blenkernel/BKE_world.h
index ea0cd125b06,dfa367afeb2..b69c14535c6
--- a/source/blender/blenkernel/BKE_world.h
+++ b/source/blender/blenkernel/BKE_world.h
@@@ -38,17 -38,11 +38,17 @@@ struct World
  
  void BKE_world_free(struct World *sc);
  void BKE_world_init(struct World *wrld);
- struct World *add_world(struct Main *bmian, const char *name);
+ struct World *BKE_world_add(struct Main *bmian, const char *name);
  void BKE_world_copy_data(struct Main *bmain, struct World *wrld_dst, const 
struct World *wrld_src, const int flag);
  struct World *BKE_world_copy(struct Main *bmain, const struct World *wrld);
- struct World *localize_world(struct World *wrld);
+ struct World *BKE_world_localize(struct World *wrld);
  void BKE_world_make_local(struct Main *bmain, struct World *wrld, const bool 
lib_local);
  
 +/* Evaluation. */
 +
 +struct EvaluationContext;
 +
 +void BKE_world_eval(const struct EvaluationContext *eval_ctx, struct World 
*world);
 +
  #endif
  
diff --cc source/blender/editors/render/render_preview.c
index 83beb7da1ce,c2532ba033e..1d6aefcb48c
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@@ -277,62 -269,6 +277,62 @@@ static Scene *preview_get_scene(Main *p
        return pr_main->scene.first;
  }
  
 +static const char *preview_layer_name(const char pr_type)
 +{
 +      switch (pr_type) {
 +              case MA_FLAT:
 +                      return "Flat";
 +              case MA_SPHERE:
 +                      return "Sphere";
 +              case MA_CUBE:
 +                      return "Cube";
 +              case MA_MONKEY:
 +                      return "Monkey";
 +              case MA_SPHERE_A:
 +                      return "World Sphere";
 +              case MA_TEXTURE:
 +                      return "Texture";
 +              case MA_LAMP:
 +                      return "Lamp";
 +              case MA_SKY:
 +                      return "Sky";
 +              case MA_HAIR:
 +                      return "Hair";
 +              case MA_ATMOS:
 +                      return "Atmosphere";
 +              default:
 +                      BLI_assert(!"Unknown preview type");
 +                      return "";
 +      }
 +}
 +
 +static void set_preview_layer(ViewLayer *view_layer, char pr_type)
 +{
 +      LayerCollection *lc;
 +      const char *collection_name = preview_layer_name(pr_type);
 +
 +      for (lc = view_layer->layer_collections.first; lc; lc = lc->next) {
 +              if (STREQ(lc->scene_collection->name, collection_name)) {
 +                      lc->flag = COLLECTION_VIEWPORT | COLLECTION_RENDER;
 +              }
 +              else {
 +                      lc->flag = COLLECTION_DISABLED;
 +              }
 +      }
 +}
 +
 +static World *preview_get_localized_world(ShaderPreview *sp, World *world)
 +{
 +      if (world == NULL) {
 +              return NULL;
 +      }
 +      if (sp->worldcopy != NULL) {
 +              return sp->worldcopy;
 +      }
-       sp->worldcopy = localize_world(world);
++      sp->worldcopy = BKE_world_localize(world);
 +      BLI_addtail(&sp->pr_main->world, sp->worldcopy);
 +      return sp->worldcopy;
 +}
  
  /* call this with a pointer to initialize preview scene */
  /* call this with NULL to restore assigned ID pointers in preview scene */

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to