[Bf-blender-cvs] [6548752986b] cycles-x: Merge branch 'master' into cycles-x

Brecht Van Lommel noreply at git.blender.org
Thu Aug 5 18:00:34 CEST 2021


Commit: 6548752986bde2ee805d49031952a7ff9da130fe
Author: Brecht Van Lommel
Date:   Thu Aug 5 17:57:16 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB6548752986bde2ee805d49031952a7ff9da130fe

Merge branch 'master' into cycles-x

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



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

diff --cc source/blender/blenloader/intern/versioning_cycles.c
index 0e2e6705524,90e6b43f02e..5795448118c
--- a/source/blender/blenloader/intern/versioning_cycles.c
+++ b/source/blender/blenloader/intern/versioning_cycles.c
@@@ -1602,16 -1607,34 +1608,47 @@@ void do_versions_after_linking_cycles(M
      }
    }
  
 +  if (!MAIN_VERSION_ATLEAST(bmain, 300, 0)) {
 +    /* Removal of NLM denoiser. */
 +    for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
 +      IDProperty *cscene = cycles_properties_from_ID(&scene->id);
 +
 +      if (cscene) {
 +        if (cycles_property_int(cscene, "denoiser", DENOISER_NLM) == DENOISER_NLM) {
 +          cycles_property_int_set(cscene, "denoiser", DENOISER_OPENIMAGEDENOISE);
 +        }
 +      }
 +    }
 +  }
++
+   /* Move visibility from Cycles to Blender. */
+   if (!MAIN_VERSION_ATLEAST(bmain, 300, 17)) {
+     LISTBASE_FOREACH (Object *, object, &bmain->objects) {
+       IDProperty *cvisibility = cycles_visibility_properties_from_ID(&object->id);
+       int flag = 0;
+ 
+       if (cvisibility) {
+         flag |= cycles_property_boolean(cvisibility, "camera", true) ? 0 : OB_HIDE_CAMERA;
+         flag |= cycles_property_boolean(cvisibility, "diffuse", true) ? 0 : OB_HIDE_DIFFUSE;
+         flag |= cycles_property_boolean(cvisibility, "glossy", true) ? 0 : OB_HIDE_GLOSSY;
+         flag |= cycles_property_boolean(cvisibility, "transmission", true) ? 0 :
+                                                                              OB_HIDE_TRANSMISSION;
+         flag |= cycles_property_boolean(cvisibility, "scatter", true) ? 0 : OB_HIDE_VOLUME_SCATTER;
+         flag |= cycles_property_boolean(cvisibility, "shadow", true) ? 0 : OB_HIDE_SHADOW;
+       }
+ 
+       IDProperty *cobject = cycles_properties_from_ID(&object->id);
+       if (cobject) {
+         flag |= cycles_property_boolean(cobject, "is_holdout", false) ? OB_HOLDOUT : 0;
+         flag |= cycles_property_boolean(cobject, "is_shadow_catcher", false) ? OB_SHADOW_CATCHER :
+                                                                                0;
+       }
+ 
+       if (object->type == OB_LAMP) {
+         flag |= OB_HIDE_CAMERA | OB_SHADOW_CATCHER;
+       }
+ 
+       object->visibility_flag |= flag;
+     }
+   }
  }



More information about the Bf-blender-cvs mailing list