[Bf-blender-cvs] [050e6bdea7e] lanpr-under-gp: Merge remote-tracking branch 'origin/master' into lanpr-under-gp

YimingWu noreply at git.blender.org
Sun Jun 7 16:29:10 CEST 2020


Commit: 050e6bdea7e6541d09804146b62f5df05d5c3ffa
Author: YimingWu
Date:   Sun Jun 7 20:09:56 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rB050e6bdea7e6541d09804146b62f5df05d5c3ffa

Merge remote-tracking branch 'origin/master' into lanpr-under-gp

# Conflicts:
#	source/blender/blenloader/intern/readfile.c
#	source/blender/blenloader/intern/writefile.c
#	source/blender/makesrna/intern/rna_collection.c

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



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

diff --cc source/blender/blenloader/intern/readfile.c
index c9027eae296,f7f18d98e73..9c82a05f390
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -6454,18 -6339,16 +6340,18 @@@ static void direct_link_collection(Blen
  
  #ifdef USE_COLLECTION_COMPAT_28
    /* This runs before the very first doversion. */
-   collection->collection = newdataadr(fd, collection->collection);
+   BLO_read_data_address(reader, &collection->collection);
    if (collection->collection != NULL) {
-     direct_link_scene_collection(fd, collection->collection);
+     direct_link_scene_collection(reader, collection->collection);
    }
  
-   collection->view_layer = newdataadr(fd, collection->view_layer);
+   BLO_read_data_address(reader, &collection->view_layer);
    if (collection->view_layer != NULL) {
-     direct_link_view_layer(fd, collection->view_layer);
+     direct_link_view_layer(reader, collection->view_layer);
    }
  #endif
 +
-   collection->lanpr = newdataadr(fd, collection->lanpr);
++  BLO_read_data_address(reader, &collection->lanpr);
  }
  
  static void lib_link_collection_data(FileData *fd, Library *lib, Collection *collection)
@@@ -7244,16 -7084,10 +7127,17 @@@ static void direct_link_scene(BlendData
    }
    EEVEE_lightcache_info_update(&sce->eevee);
  
-   sce->lanpr.active_layer = newdataadr(fd, sce->lanpr.active_layer);
-   link_list(fd, &(sce->lanpr.line_layers));
++  BLO_read_data_address(reader, &sce->lanpr.active_layer);
++  BLO_read_list(reader, &(sce->lanpr.line_layers));
 +  for (LANPR_LineLayer *ll = sce->lanpr.line_layers.first; ll; ll = ll->next) {
 +    ll->batch = NULL;
 +    ll->shgrp = NULL;
 +  }
-   direct_link_view3dshading(fd, &sce->display.shading);
 +
-   sce->layer_properties = newdataadr(fd, sce->layer_properties);
-   IDP_DirectLinkGroup_OrFree(&sce->layer_properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
+   direct_link_view3dshading(reader, &sce->display.shading);
+ 
+   BLO_read_data_address(reader, &sce->layer_properties);
+   IDP_DirectLinkGroup_OrFree(&sce->layer_properties, reader);
  }
  
  /** \} */
diff --cc source/blender/blenloader/intern/writefile.c
index bc36497dd9f,205184e6e7c..b8bdf1a25c6
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@@ -110,6 -110,6 +110,7 @@@
  #include "DNA_gpencil_types.h"
  #include "DNA_hair_types.h"
  #include "DNA_key_types.h"
++#include "DNA_lanpr_types.h"
  #include "DNA_lattice_types.h"
  #include "DNA_layer_types.h"
  #include "DNA_light_types.h"
@@@ -2501,17 -2479,13 +2480,17 @@@ static void write_collection_nolib(Blen
    }
  
    LISTBASE_FOREACH (CollectionChild *, child, &collection->children) {
-     writestruct(wd, DATA, CollectionChild, 1, child);
+     BLO_write_struct(writer, CollectionChild, child);
    }
 +
 +  if (collection->lanpr != NULL) {
-     writestruct(wd, DATA, CollectionLANPR, 1, collection->lanpr);
++    writestruct(writer->wd, DATA, CollectionLANPR, 1, collection->lanpr);
 +  }
  }
  
- static void write_collection(WriteData *wd, Collection *collection, const void *id_address)
+ static void write_collection(BlendWriter *writer, Collection *collection, const void *id_address)
  {
-   if (collection->id.us > 0 || wd->use_memfile) {
+   if (collection->id.us > 0 || BLO_write_is_undo(writer)) {
      /* Clean up, important in undo case to reduce false detection of changed datablocks. */
      collection->flag &= ~COLLECTION_HAS_OBJECT_CACHE;
      collection->tag = 0;
@@@ -2854,17 -2827,12 +2832,16 @@@ static void write_scene(BlendWriter *wr
    }
  
    /* Eevee Lightcache */
-   if (sce->eevee.light_cache_data && !wd->use_memfile) {
-     writestruct(wd, DATA, LightCache, 1, sce->eevee.light_cache_data);
-     write_lightcache(wd, sce->eevee.light_cache_data);
+   if (sce->eevee.light_cache_data && !BLO_write_is_undo(writer)) {
+     BLO_write_struct(writer, LightCache, sce->eevee.light_cache_data);
+     write_lightcache(writer, sce->eevee.light_cache_data);
    }
  
 +  /* LANPR Line Layers */
 +  for (LANPR_LineLayer *ll = sce->lanpr.line_layers.first; ll; ll = ll->next) {
-     writestruct(wd, DATA, LANPR_LineLayer, 1, ll);
++    writestruct(writer->wd, DATA, LANPR_LineLayer, 1, ll);
 +  }
- 
-   write_view3dshading(wd, &sce->display.shading);
+   write_view3dshading(writer, &sce->display.shading);
  
    /* Freed on doversion. */
    BLI_assert(sce->layer_properties == NULL);
diff --cc source/blender/makesrna/intern/rna_collection.c
index 18468323cfe,fbc2b871026..21ff7d0ad99
--- a/source/blender/makesrna/intern/rna_collection.c
+++ b/source/blender/makesrna/intern/rna_collection.c
@@@ -630,17 -474,7 +628,19 @@@ void RNA_def_collections(BlenderRNA *br
    RNA_def_property_ui_text(prop, "Disable in Renders", "Globally disable in renders");
    RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_flag_update");
  
 +  prop = RNA_def_property(srna, "configure_lanpr", PROP_BOOLEAN, PROP_NONE);
 +  RNA_def_property_boolean_funcs(
 +      prop, "rna_Collection_lanpr_configure_get", "rna_Collection_lanpr_configure_set");
 +  RNA_def_property_ui_text(prop, "Configure", "Configure this collection for LANPR");
 +  RNA_def_property_update(prop, NC_SCENE, NULL);
 +
 +  rna_def_collection_lanpr(brna);
 +
 +  prop = RNA_def_property(srna, "lanpr", PROP_POINTER, PROP_NONE);
 +  RNA_def_property_struct_type(prop, "CollectionLANPR");
 +  RNA_def_property_ui_text(prop, "LANPR", "LANPR settings for the collection");
++
+   RNA_define_lib_overridable(false);
  }
  
  #endif



More information about the Bf-blender-cvs mailing list