Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Wed, 12 Jul 2017 03:59:13 +0000 (13:59 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 12 Jul 2017 03:59:13 +0000 (13:59 +1000)
intern/cycles/kernel/osl/osl_services.cpp
intern/cycles/kernel/svm/svm_closure.h
source/blender/editors/transform/transform_snap_object.c

index b767c60c61738484226a05294eadf154e946ecd9..1535496c73dc8d0ea088a924a53c97adfdbb7907 100644 (file)
@@ -824,7 +824,7 @@ bool OSLRenderServices::get_background_attribute(KernelGlobals *kg, ShaderData *
 bool OSLRenderServices::get_attribute(OSL::ShaderGlobals *sg, bool derivatives, ustring object_name,
                                       TypeDesc type, ustring name, void *val)
 {
-       if(sg->renderstate == NULL)
+       if(sg == NULL || sg->renderstate == NULL)
                return false;
 
        ShaderData *sd = (ShaderData *)(sg->renderstate);
index 9578fcf26873c95c16fe3d0c47a1dc540aa339a7..7704aa545c86b3a9fe4cfa49c84121f90b50dda5 100644 (file)
@@ -159,7 +159,7 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
 
                        /* diffuse */
                        if(fabsf(average(mixed_ss_base_color)) > CLOSURE_WEIGHT_CUTOFF) {
-                               if(subsurface < CLOSURE_WEIGHT_CUTOFF && diffuse_weight > CLOSURE_WEIGHT_CUTOFF) {
+                               if(subsurface <= CLOSURE_WEIGHT_CUTOFF && diffuse_weight > CLOSURE_WEIGHT_CUTOFF) {
                                        float3 diff_weight = weight * base_color * diffuse_weight;
 
                                        PrincipledDiffuseBsdf *bsdf = (PrincipledDiffuseBsdf*)bsdf_alloc(sd, sizeof(PrincipledDiffuseBsdf), diff_weight);
index 2c5052039d251f9bdc6f98e87b62215e958f6e2c..8378812c4b03be35ec0ee04e843c8ca11eb770e4 100644 (file)
@@ -262,8 +262,7 @@ MINLINE float depth_get(const float co[3], const float ray_start[3], const float
        return dot_v3v3(dvec, ray_dir);
 }
 
-
-static float dist_aabb_to_plane(
+static float UNUSED_FUNCTION(dist_aabb_to_plane)(
         const float bbmin[3], const float bbmax[3],
         const float plane_co[3], const float plane_no[3])
 {
@@ -1654,7 +1653,7 @@ static bool snapDerivedMesh(
         /* read/write args */
         float *ray_depth, float *dist_px,
         /* return args */
-        float r_loc[3], float r_no[3], int *r_index)
+        float r_loc[3], float r_no[3])
 {
        bool retval = false;
 
@@ -1819,7 +1818,7 @@ static bool snapEditMesh(
         /* read/write args */
         float *ray_depth, float *dist_px,
         /* return args */
-        float r_loc[3], float r_no[3], int *r_index)
+        float r_loc[3], float r_no[3])
 {
        bool retval = false;
 
@@ -1978,7 +1977,7 @@ static bool snapObject(
         /* read/write args */
         float *ray_depth, float *dist_px,
         /* return args */
-        float r_loc[3], float r_no[3], int *r_index,
+        float r_loc[3], float r_no[3],
         Object **r_ob, float r_obmat[4][4])
 {
        bool retval = false;
@@ -1991,7 +1990,7 @@ static bool snapObject(
                        retval = snapEditMesh(
                                sctx, snapdata, ob, em, obmat,
                                ray_depth, dist_px,
-                               r_loc, r_no, r_index);
+                               r_loc, r_no);
                }
                else {
                        /* in this case we want the mesh from the editmesh, avoids stale data. see: T45978.
@@ -2007,7 +2006,7 @@ static bool snapObject(
                        retval = snapDerivedMesh(
                                sctx, snapdata, ob, dm, obmat,
                                ray_depth, dist_px,
-                               r_loc, r_no, r_index);
+                               r_loc, r_no);
 
                        dm->release(dm);
                }
@@ -2087,7 +2086,7 @@ static bool snapObjectsRay(
         /* read/write args */
         float *ray_depth, float *dist_px,
         /* return args */
-        float r_loc[3], float r_no[3], int *r_index,
+        float r_loc[3], float r_no[3],
         Object **r_ob, float r_obmat[4][4])
 {
        bool retval = false;
@@ -2099,7 +2098,7 @@ static bool snapObjectsRay(
                retval |= snapObject(
                        sctx, snapdata, sobj->ob, sobj->obmat, sobj->use_obedit,
                        ray_depth, dist_px,
-                       r_loc, r_no, r_index, r_ob, r_obmat);
+                       r_loc, r_no, r_ob, r_obmat);
        }
 
        BLI_freelistN(&obj_list);
@@ -2435,7 +2434,7 @@ bool ED_transform_snap_object_project_view3d_ex(
                return snapObjectsRay(
                        sctx, &snapdata,
                        params->snap_select, params->use_object_edit_cage,
-                       ray_depth, dist_px, r_loc, r_no, r_index, NULL, NULL);
+                       ray_depth, dist_px, r_loc, r_no, NULL, NULL);
        }
 }