[Bf-blender-cvs] [51d9f56f874] master: GPencil: Invert Paste operator and make Paste to Active default

Antonio Vazquez noreply at git.blender.org
Mon Aug 26 15:50:46 CEST 2019


Commit: 51d9f56f874d2aeea0dc8bc256eb9e12d1726187
Author: Antonio Vazquez
Date:   Mon Aug 26 15:46:00 2019 +0200
Branches: master
https://developer.blender.org/rB51d9f56f874d2aeea0dc8bc256eb9e12d1726187

GPencil: Invert Paste operator and make Paste to Active default

Before there were two options: Paste to original layer called "Paste" and Paste to active   layer called "Paste & Merge"

Now, by default the paste is in active layer and the "Paste & Merge" has been renamed "Paste".

For old "Paste", now is called "Paste by Layer" and it's not the default value anymore.

Note: Minor edits to add icons not present in Differential revision.

Differential Revision: https://developer.blender.org/D5591

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

M	intern/cycles/device/device_cpu.cpp
M	intern/cycles/kernel/closure/bsdf_microfacet.h
M	intern/cycles/kernel/closure/bsdf_microfacet_multi.h
M	intern/cycles/kernel/svm/svm_color_util.h
M	intern/cycles/kernel/svm/svm_noise.h
M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/blenloader/intern/readfile.c
M	source/blender/draw/intern/draw_cache_impl_mesh.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/windowmanager/intern/wm_files.c

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

diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp
index c2843a61e6d..b2d923dfdf0 100644
--- a/intern/cycles/device/device_cpu.cpp
+++ b/intern/cycles/device/device_cpu.cpp
@@ -114,12 +114,6 @@ template<typename F> class KernelFunctions {
       architecture_name = "SSE2";
       kernel = kernel_sse2;
     }
-#else
-    {
-      /* Dummy to prevent the architecture if below become
-       * conditional when WITH_CYCLES_OPTIMIZED_KERNEL_SSE2
-       * is not defined. */
-    }
 #endif
 
     if (strcmp(architecture_name, logged_architecture) != 0) {
diff --git a/intern/cycles/kernel/closure/bsdf_microfacet.h b/intern/cycles/kernel/closure/bsdf_microfacet.h
index 2f73434706c..7d7ccfa7774 100644
--- a/intern/cycles/kernel/closure/bsdf_microfacet.h
+++ b/intern/cycles/kernel/closure/bsdf_microfacet.h
@@ -303,7 +303,9 @@ ccl_device int bsdf_microfacet_ggx_setup(MicrofacetBsdf *bsdf)
 
 ccl_device int bsdf_microfacet_ggx_fresnel_setup(MicrofacetBsdf *bsdf, const ShaderData *sd)
 {
-  bsdf->extra->cspec0 = saturate3(bsdf->extra->cspec0);
+  bsdf->extra->cspec0.x = saturate(bsdf->extra->cspec0.x);
+  bsdf->extra->cspec0.y = saturate(bsdf->extra->cspec0.y);
+  bsdf->extra->cspec0.z = saturate(bsdf->extra->cspec0.z);
 
   float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior);
   float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0));
@@ -319,7 +321,9 @@ ccl_device int bsdf_microfacet_ggx_fresnel_setup(MicrofacetBsdf *bsdf, const Sha
 
 ccl_device int bsdf_microfacet_ggx_clearcoat_setup(MicrofacetBsdf *bsdf, const ShaderData *sd)
 {
-  bsdf->extra->cspec0 = saturate3(bsdf->extra->cspec0);
+  bsdf->extra->cspec0.x = saturate(bsdf->extra->cspec0.x);
+  bsdf->extra->cspec0.y = saturate(bsdf->extra->cspec0.y);
+  bsdf->extra->cspec0.z = saturate(bsdf->extra->cspec0.z);
 
   float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior);
   float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0));
@@ -362,7 +366,9 @@ ccl_device int bsdf_microfacet_ggx_aniso_setup(MicrofacetBsdf *bsdf)
 
 ccl_device int bsdf_microfacet_ggx_aniso_fresnel_setup(MicrofacetBsdf *bsdf, const ShaderData *sd)
 {
-  bsdf->extra->cspec0 = saturate3(bsdf->extra->cspec0);
+  bsdf->extra->cspec0.x = saturate(bsdf->extra->cspec0.x);
+  bsdf->extra->cspec0.y = saturate(bsdf->extra->cspec0.y);
+  bsdf->extra->cspec0.z = saturate(bsdf->extra->cspec0.z);
 
   float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior);
   float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0));
diff --git a/intern/cycles/kernel/closure/bsdf_microfacet_multi.h b/intern/cycles/kernel/closure/bsdf_microfacet_multi.h
index 9780dd87415..07be33ee6b5 100644
--- a/intern/cycles/kernel/closure/bsdf_microfacet_multi.h
+++ b/intern/cycles/kernel/closure/bsdf_microfacet_multi.h
@@ -378,8 +378,12 @@ ccl_device int bsdf_microfacet_multi_ggx_common_setup(MicrofacetBsdf *bsdf)
 {
   bsdf->alpha_x = clamp(bsdf->alpha_x, 1e-4f, 1.0f);
   bsdf->alpha_y = clamp(bsdf->alpha_y, 1e-4f, 1.0f);
-  bsdf->extra->color = saturate3(bsdf->extra->color);
-  bsdf->extra->cspec0 = saturate3(bsdf->extra->cspec0);
+  bsdf->extra->color.x = saturate(bsdf->extra->color.x);
+  bsdf->extra->color.y = saturate(bsdf->extra->color.y);
+  bsdf->extra->color.z = saturate(bsdf->extra->color.z);
+  bsdf->extra->cspec0.x = saturate(bsdf->extra->cspec0.x);
+  bsdf->extra->cspec0.y = saturate(bsdf->extra->cspec0.y);
+  bsdf->extra->cspec0.z = saturate(bsdf->extra->cspec0.z);
 
   return SD_BSDF | SD_BSDF_HAS_EVAL | SD_BSDF_NEEDS_LCG;
 }
@@ -564,7 +568,9 @@ ccl_device int bsdf_microfacet_multi_ggx_glass_setup(MicrofacetBsdf *bsdf)
   bsdf->alpha_x = clamp(bsdf->alpha_x, 1e-4f, 1.0f);
   bsdf->alpha_y = bsdf->alpha_x;
   bsdf->ior = max(0.0f, bsdf->ior);
-  bsdf->extra->color = saturate3(bsdf->extra->color);
+  bsdf->extra->color.x = saturate(bsdf->extra->color.x);
+  bsdf->extra->color.y = saturate(bsdf->extra->color.y);
+  bsdf->extra->color.z = saturate(bsdf->extra->color.z);
 
   bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID;
 
@@ -577,8 +583,12 @@ ccl_device int bsdf_microfacet_multi_ggx_glass_fresnel_setup(MicrofacetBsdf *bsd
   bsdf->alpha_x = clamp(bsdf->alpha_x, 1e-4f, 1.0f);
   bsdf->alpha_y = bsdf->alpha_x;
   bsdf->ior = max(0.0f, bsdf->ior);
-  bsdf->extra->color = saturate3(bsdf->extra->color);
-  bsdf->extra->cspec0 = saturate3(bsdf->extra->cspec0);
+  bsdf->extra->color.x = saturate(bsdf->extra->color.x);
+  bsdf->extra->color.y = saturate(bsdf->extra->color.y);
+  bsdf->extra->color.z = saturate(bsdf->extra->color.z);
+  bsdf->extra->cspec0.x = saturate(bsdf->extra->cspec0.x);
+  bsdf->extra->cspec0.y = saturate(bsdf->extra->cspec0.y);
+  bsdf->extra->cspec0.z = saturate(bsdf->extra->cspec0.z);
 
   bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID;
 
diff --git a/intern/cycles/kernel/svm/svm_color_util.h b/intern/cycles/kernel/svm/svm_color_util.h
index 0f571eb7253..3a6a5ba782f 100644
--- a/intern/cycles/kernel/svm/svm_color_util.h
+++ b/intern/cycles/kernel/svm/svm_color_util.h
@@ -255,7 +255,13 @@ ccl_device float3 svm_mix_linear(float t, float3 col1, float3 col2)
 
 ccl_device float3 svm_mix_clamp(float3 col)
 {
-  return saturate3(col);
+  float3 outcol = col;
+
+  outcol.x = saturate(col.x);
+  outcol.y = saturate(col.y);
+  outcol.z = saturate(col.z);
+
+  return outcol;
 }
 
 ccl_device_noinline_cpu float3 svm_mix(NodeMix type, float fac, float3 c1, float3 c2)
diff --git a/intern/cycles/kernel/svm/svm_noise.h b/intern/cycles/kernel/svm/svm_noise.h
index e03ffa2bc9d..dd375af27e5 100644
--- a/intern/cycles/kernel/svm/svm_noise.h
+++ b/intern/cycles/kernel/svm/svm_noise.h
@@ -181,9 +181,9 @@ ccl_device_inline ssef scale3_sse(const ssef &result)
 }
 #endif
 
+#ifndef __KERNEL_SSE2__
 ccl_device_noinline_cpu float perlin(float x, float y, float z)
 {
-#ifndef __KERNEL_SSE2__
   int X;
   float fx = floorfrac(x, &X);
   int Y;
@@ -217,7 +217,10 @@ ccl_device_noinline_cpu float perlin(float x, float y, float z)
 
   /* can happen for big coordinates, things even out to 0.0 then anyway */
   return (isfinite(r)) ? r : 0.0f;
+}
 #else
+ccl_device_noinline float perlin(float x, float y, float z)
+{
   ssef xyz = ssef(x, y, z, 0.0f);
   ssei XYZ;
 
@@ -255,8 +258,8 @@ ccl_device_noinline_cpu float perlin(float x, float y, float z)
   ssef rinfmask = ((r & infmask) == infmask).m128;  // 0xffffffff if r is inf/-inf/nan else 0
   ssef rfinite = andnot(rinfmask, r);               // 0 if r is inf/-inf/nan else r
   return extract<0>(rfinite);
-#endif
 }
+#endif
 
 /* perlin noise in range 0..1 */
 ccl_device float noise(float3 p)
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 6f089f93f00..46e969b3959 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -169,8 +169,8 @@ class GreasePencilStrokeEditPanel:
         layout.label(text="Edit:")
         row = layout.row(align=True)
         row.operator("gpencil.copy", text="Copy")
-        row.operator("gpencil.paste", text="Paste").type = 'COPY'
-        row.operator("gpencil.paste", text="Paste & Merge").type = 'MERGE'
+        row.operator("gpencil.paste", text="Paste").type = 'ACTIVE'
+        row.operator("gpencil.paste", text="Paste by Layer").type = 'LAYER'
 
         col = layout.column(align=True)
         col.operator("gpencil.delete")
@@ -507,8 +507,9 @@ class GPENCIL_MT_pie_tools_more(Menu):
         # gpd = context.gpencil_data
 
         col = pie.column(align=True)
-        col.operator("gpencil.copy", icon='COPYDOWN', text="Copy")
-        col.operator("gpencil.paste", icon='PASTEDOWN', text="Paste")
+        col.operator("gpencil.copy", text="Copy", icon='COPYDOWN')
+        col.operator("gpencil.paste", text="Paste", icon='PASTEDOWN').type = 'ACTIVE'
+        col.operator("gpencil.paste", text="Paste by Layer").type = 'LAYER'
 
         col = pie.column(align=True)
         col.operator("gpencil.select_more", icon='ADD')
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index b684e4aa2dd..22c1a74b7e4 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -4460,8 +4460,8 @@ class VIEW3D_MT_edit_gpencil(Menu):
         layout.operator("gpencil.duplicate_move", text="Duplicate")
         layout.operator("gpencil.stroke_split", text="Split")
         layout.operator("gpencil.copy", text="Copy", icon='COPYDOWN')
-        layout.operator("gpencil.paste", text="Paste", icon='PASTEDOWN').type = 'COPY'
-        layout.operator("gpencil.paste", text="Paste & Merge").type = 'MERGE'
+        layout.operator("gpencil.paste", text="Paste", icon='PASTEDOWN').type = 'ACTIVE'
+        layout.operator("gpencil.paste", text="Paste by Layer").type = 'LAYER'
 
         layout.separator()
 
@@ -6306,8 +6306,8 @@ class VIEW3D_MT_gpencil_edit_context_menu(Menu):
 
         layout.operator("gpencil.duplicate_move", text="Duplicate")
         layout.operator("gpencil.copy", text="Copy", icon='COPYDOWN')
-        layout.operator("gpencil.paste", text="Paste", icon='PASTEDOWN').type = 'COPY'
-        layout.operator("gpencil.paste", text="Paste & Merge").type = 'MERGE'
+        layout.operator("gpencil.paste", text="Paste", icon='PASTEDOWN').type = 'ACTIVE'
+        layout.operator("gpencil.paste", text="Paste by Layer").type = 'LAYER'
         layout.menu("VIEW3D_MT_gpencil_copy_layer")
         layout.operator("gpencil.frame_duplicate", text="Duplicate Active Frame")
         layout.operator("gpencil.frame_duplicate", text="Duplicate Active Frame All Layers").mode = 'ALL'
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 140e67c86c9..2a036d7f4ea 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7859,45 +7859,6 @@ static void lib_link_clipboard_restore(struct IDNameLib_Map *id_map)
   BKE_sequencer_base_recursive_apply(&seqbase_

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list