Cleanup: style, spelling
authorCampbell Barton <ideasman42@gmail.com>
Sat, 7 Sep 2019 11:08:20 +0000 (21:08 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 7 Sep 2019 11:28:05 +0000 (21:28 +1000)
18 files changed:
intern/cycles/kernel/svm/svm_noise.h
release/scripts/modules/bpy_extras/view3d_utils.py
release/scripts/startup/bl_operators/add_mesh_torus.py
release/scripts/startup/bl_ui/space_topbar.py
source/blender/blendthumb/src/BlenderThumb.cpp
source/blender/blenkernel/intern/shrinkwrap.c
source/blender/blenloader/intern/versioning_cycles.c
source/blender/draw/engines/eevee/eevee_shadows_cube.c
source/blender/draw/engines/eevee/eevee_volumes.c
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/transform/transform_convert_sequencer.c
source/blender/imbuf/intern/colormanagement.c
source/blender/makesdna/DNA_screen_types.h
source/blender/render/intern/source/pipeline.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_init_exit.c
tests/python/bl_pyapi_idprop_datablock.py

index 73d9e83ae0fff3aee15e8c2b32f402a00af443d0..8d832247b189d91b43f4e7e174eb2ff4baf04b7f 100644 (file)
@@ -281,7 +281,7 @@ ccl_device_noinline_cpu float perlin_4d(float x, float y, float z, float w)
  *    (v2, v3) is generated by moving v2 and v3 to the first and second
  *    places of the ssef using the shuffle mask <2, 3, 2, 3>. The third and
  *    fourth values are unused.
- * 2. Interplate g0 and g1 along the y axis to get the final value.
+ * 2. Interpolate g0 and g1 along the y axis to get the final value.
  *    g1 is generated by populating an ssef with the second value of g.
  *    Only the first value is important in the final ssef.
  *
index a2e394b270ff0211e0ba3aac6fe4263e14b01978..9e4958802f162d6da63a3513dafed7b6045b39ee 100644 (file)
@@ -47,10 +47,11 @@ def region_2d_to_vector_3d(region, rv3d, coord):
     if rv3d.is_perspective:
         persinv = rv3d.perspective_matrix.inverted()
 
-        out = Vector(((2.0 * coord[0] / region.width) - 1.0,
-                      (2.0 * coord[1] / region.height) - 1.0,
-                      -0.5
-                      ))
+        out = Vector((
+            (2.0 * coord[0] / region.width) - 1.0,
+            (2.0 * coord[1] / region.height) - 1.0,
+            -0.5
+        ))
 
         w = out.dot(persinv[3].xyz) + persinv[3][3]
 
@@ -99,9 +100,11 @@ def region_2d_to_origin_3d(region, rv3d, coord, clamp=None):
         dx = (2.0 * coord[0] / region.width) - 1.0
         dy = (2.0 * coord[1] / region.height) - 1.0
         persinv = persmat.inverted()
-        origin_start = ((persinv.col[0].xyz * dx) +
-                        (persinv.col[1].xyz * dy) +
-                        persinv.translation)
+        origin_start = (
+            (persinv.col[0].xyz * dx) +
+            (persinv.col[1].xyz * dy) +
+            persinv.translation
+        )
 
         if clamp != 0.0:
             if rv3d.view_perspective != 'CAMERA':
@@ -149,17 +152,19 @@ def region_2d_to_location_3d(region, rv3d, coord, depth_location):
         from mathutils.geometry import intersect_line_plane
         viewinv = rv3d.view_matrix.inverted()
         view_vec = viewinv.col[2].copy()
-        return intersect_line_plane(origin_start,
-                                    origin_end,
-                                    depth_location,
-                                    view_vec, 1,
-                                    )
+        return intersect_line_plane(
+            origin_start,
+            origin_end,
+            depth_location,
+            view_vec, 1,
+        )
     else:
         from mathutils.geometry import intersect_point_line
-        return intersect_point_line(depth_location,
-                                    origin_start,
-                                    origin_end,
-                                    )[0]
+        return intersect_point_line(
+            depth_location,
+            origin_start,
+            origin_end,
+        )[0]
 
 
 def location_3d_to_region_2d(region, rv3d, coord, default=None):
@@ -184,8 +189,9 @@ def location_3d_to_region_2d(region, rv3d, coord, default=None):
         width_half = region.width / 2.0
         height_half = region.height / 2.0
 
-        return Vector((width_half + width_half * (prj.x / prj.w),
-                       height_half + height_half * (prj.y / prj.w),
-                       ))
+        return Vector((
+            width_half + width_half * (prj.x / prj.w),
+            height_half + height_half * (prj.y / prj.w),
+        ))
     else:
         return default
index bd727ec3e83e726ec74bd2c6ce6f76d780450d98..316ad152a3278f20148d3f1e6d2ecc2b7dda6195 100644 (file)
@@ -252,10 +252,12 @@ class AddTorus(Operator, object_utils.AddObjectHelper):
             self.major_radius = self.abso_minor_rad + extra_helper
             self.minor_radius = extra_helper
 
-        verts_loc, faces = add_torus(self.major_radius,
-                                     self.minor_radius,
-                                     self.major_segments,
-                                     self.minor_segments)
+        verts_loc, faces = add_torus(
+            self.major_radius,
+            self.minor_radius,
+            self.major_segments,
+            self.minor_segments,
+        )
 
         mesh = bpy.data.meshes.new(data_("Torus"))
 
index f66a363e6ca3cc5c027a6f366caea71f90ce354f..0374a56353225555764b5aaebbe9eaff8d494875 100644 (file)
@@ -563,7 +563,7 @@ class TOPBAR_MT_help(Menu):
 
         show_developer = context.preferences.view.show_developer_ui
 
-        layout.operator("wm.url_open_preset", text="Manual", icon='HELP',).type = 'MANUAL'
+        layout.operator("wm.url_open_preset", text="Manual", icon='HELP').type = 'MANUAL'
 
         layout.operator(
             "wm.url_open", text="Tutorials", icon='URL',
index 94dae437260c0536c4af737cbf18bfeaf5104b97..bfb13d98f45b7d6c68dd85b67346183f77e6781c 100644 (file)
@@ -174,11 +174,13 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE
   char version[4];
   version[3] = '\0';
   _pStream->Read(&version, 3, &BytesRead);
-  if (BytesRead != 3)
+  if (BytesRead != 3) {
     return E_UNEXPECTED;
+  }
   int iVersion = atoi(version);
-  if (iVersion < 250)
+  if (iVersion < 250) {
     return S_FALSE;
+  }
 
   // 32 or 64 bit blend?
   SeekPos.QuadPart = 7;
@@ -208,8 +210,9 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE
         continue;
       }
     }
-    else
+    else {
       break;  // eof
+    }
 
     // Found the block
     SeekPos.QuadPart = BlockOffset + HeaderSize;
@@ -224,8 +227,9 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE
     char *pRGBA = new char[BlockSize];
     _pStream->Read(pRGBA, BlockSize, &BytesRead);
 
-    if (BytesRead != (ULONG)BlockSize)
+    if (BytesRead != (ULONG)BlockSize) {
       return E_UNEXPECTED;
+    }
 
     // Convert to BGRA for Windows
     for (int i = 0; i < BlockSize; i += 4) {
@@ -244,16 +248,18 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE
       if (0 != memcpy_s(&FlippedImage[(height - i - 1) * LineSize],
                         LineSize,
                         &pRGBA[i * LineSize],
-                        LineSize))
+                        LineSize)) {
         return E_UNEXPECTED;
+      }
     }
     delete[] pRGBA;
     pRGBA = FlippedImage;
 
     // Create image
     *phbmp = CreateBitmap(width, height, 1, 32, pRGBA);
-    if (!*phbmp)
+    if (!*phbmp) {
       return E_FAIL;
+    }
     *pdwAlpha = WTSAT_ARGB;  // it's actually BGRA, not sure why this works
 
     // Scale down if required
@@ -297,16 +303,18 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE
           DeleteObject(*phbmp);
           *phbmp = ResizedHBmp;
         }
-        else
+        else {
           DeleteObject(ResizedHBmp);
+        }
 
         pIScaler->Release();
       }
       WICBmp->Release();
       pImgFac->Release();
     }
-    else
+    else {
       hr = S_OK;
+    }
     break;
   }
   return hr;
index 9b9fd33f52dcba2f23f088adcd0dcd22c1d43406..014a2c6d6acae26e95f555ce541c50273b265341 100644 (file)
@@ -1408,7 +1408,7 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd,
     Object *ob_target = DEG_get_evaluated_object(ctx->depsgraph, smd->target);
     calc.target = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob_target, false);
 
-    /* TODO there might be several "bugs" on non-uniform scales matrixs
+    /* TODO there might be several "bugs" with non-uniform scales matrices
      * because it will no longer be nearest surface, not sphere projection
      * because space has been deformed */
     BLI_SPACE_TRANSFORM_SETUP(&calc.local2target, ob, ob_target);
index 52be5b2ce74ce673fe4a609952ce8ef99e2b3cfc..1abf099b4c27c7cd591d703b26cc58da9de7fb03 100644 (file)
@@ -788,7 +788,7 @@ static void update_noise_node_dimensions(bNodeTree *ntree)
  * Since the RNA paths of the properties changed, we also have to update the
  * rna_path of the FCurves if they exist. To do that, we loop over FCurves
  * and check if they control a property of the node, if they do, we update
- * the path to be that of the corrsponding socket in the node or the added
+ * the path to be that of the corresponding socket in the node or the added
  * minimum/maximum node.
  *
  */
index b10c206703a36ae65e23b764c319d3692f48b777..a355e7e0792e63200314658d50ed3123e0283853 100644 (file)
@@ -116,12 +116,12 @@ bool EEVEE_shadows_cube_setup(EEVEE_LightsInfo *linfo, const EEVEE_Light *evli,
     /**
      * Anti-Aliasing jitter: Add random rotation.
      *
-     * The 2.0 factor is because texel angular size is not even across the cubemap,
+     * The 2.0 factor is because texel angular size is not even across the cube-map,
      * so we make the rotation range a bit bigger.
      * This will not blur the shadow even if the spread is too big since we are just
-     * rotating the shadow cubemap.
+     * rotating the shadow cube-map.
      * Note that this may be a rough approximation an may not converge to a perfectly
-     * smooth shadow (because sample distribution is quite non-uniform) but is enought
+     * smooth shadow (because sample distribution is quite non-uniform) but is enough
      * in practice.
      **/
     /* NOTE: this has implication for spotlight rendering optimization
@@ -202,11 +202,13 @@ void EEVEE_shadows_draw_cubemap(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata,
   for (int j = 0; j < 6; j++) {
     /* Optimization: Only render the needed faces. */
     /* Skip all but -Z face. */
-    if (evli->light_type == LA_SPOT && j != 5 && spot_angle_fit_single_face(evli))
+    if (evli->light_type == LA_SPOT && j != 5 && spot_angle_fit_single_face(evli)) {
       continue;
+    }
     /* Skip +Z face. */
-    if (evli->light_type != LA_LOCAL && j == 4)
+    if (evli->light_type != LA_LOCAL && j == 4) {
       continue;
+    }
     /* TODO(fclem) some cube sides can be invisible in the main views. Cull them. */
     // if (frustum_intersect(g_data->cube_views[j], main_view))
     //   continue;
@@ -220,4 +222,4 @@ void EEVEE_shadows_draw_cubemap(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata,
   }
 
   BLI_BITMAP_SET(&linfo->sh_cube_update[0], cube_index, false);
-}
\ No newline at end of file
+}
index 8a2576e174d94c9dda62b73de252afd91399487c..1ff14f8323199a16ac0958c55a5a2c2ddb0fc409 100644 (file)
@@ -605,7 +605,7 @@ void EEVEE_volumes_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
   if ((effects->enabled_effects & EFFECT_VOLUMETRIC) != 0) {
     DRW_stats_group_start("Volumetrics");
 
-    /* We sample the shadowmaps using shadow sampler. We need to enable Comparison mode.
+    /* We sample the shadow-maps using shadow sampler. We need to enable Comparison mode.
      * TODO(fclem) avoid this by using sampler objects.*/
     GPU_texture_bind(sldata->shadow_cube_pool, 0);
     GPU_texture_compare_mode(sldata->shadow_cube_pool, true);
index 4a552fb37449eecda60bafa65a7c4c7327814fb1..d872356a083e6f901ebb4aace49327eaee315113 100644 (file)
@@ -1121,15 +1121,18 @@ static void cursor_draw_tiling_preview(const uint gpuattr,
       start[dim] = (bbMin[dim] - orgLoc[dim] - radius) / step[dim];
       end[dim] = (bbMax[dim] - orgLoc[dim] + radius) / step[dim];
     }
-    else
+    else {
       start[dim] = end[dim] = 0;
+    }
   }
   copy_v3_v3_int(cur, start);
   for (cur[0] = start[0]; cur[0] <= end[0]; cur[0]++) {
     for (cur[1] = start[1]; cur[1] <= end[1]; cur[1]++) {
       for (cur[2] = start[2]; cur[2] <= end[2]; cur[2]++) {
-        if (!cur[0] && !cur[1] && !cur[2])
-          continue; /* skip tile at orgLoc, this was already handled before all others */
+        if (!cur[0] && !cur[1] && !cur[2]) {
+          /* skip tile at orgLoc, this was already handled before all others */
+          continue;
+        }
         tile_pass++;
         for (dim = 0; dim < 3; dim++) {
           location[dim] = cur[dim] * step[dim] + orgLoc[dim];
index 7b79ee7aeb4d1115a0b704d996fac562eef5a3fa..86b6ebe3ffacb3509154ddbd887a562fb399eb5e 100644 (file)
@@ -160,7 +160,7 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count
         /* Meta's can only directly be moved between channels since they
          * don't have their start and length set directly (children affect that)
          * since this Meta is nested we don't need any of its data in fact.
-         * BKE_sequence_calc() will update its settings when run on the toplevel meta */
+         * BKE_sequence_calc() will update its settings when run on the top-level meta. */
         *flag = 0;
         *count = 0;
         *recursive = true;
index 36af7ab2571bddd75395fe4f1f244b70acd9272c..1b911226c6f0cb55e2c0e4fba3768f6eb6e0eb80 100644 (file)
@@ -3961,8 +3961,7 @@ static void update_glsl_display_processor(const ColorManagedViewSettings *view_s
 
     /* We're using curve mapping's address as a cache ID,
      * so we need to make sure re-allocation gives new address here.
-     * We do this by allocating new curve mapping before freeing ol one.
-     */
+     * We do this by allocating new curve mapping before freeing old one. */
     if (use_curve_mapping) {
       new_curve_mapping = BKE_curvemapping_copy(view_settings->curve_mapping);
     }
index aab71c15e44b2f0a2def03b749fbfdbeb1086440..bf491e2eaea8ff349ad5bcbac383f2eb797c8633 100644 (file)
@@ -458,16 +458,18 @@ enum {
 #ifdef DNA_DEPRECATED_ALLOW
   AREA_TEMP_INFO = (1 << 3), /* versioned to make slot reusable */
 #endif
-  /* update size of regions within the area */
+  /** Update size of regions within the area. */
   AREA_FLAG_REGION_SIZE_UPDATE = (1 << 3),
   AREA_FLAG_ACTIVE_TOOL_UPDATE = (1 << 4),
   //  AREA_FLAG_UNUSED_5           = (1 << 5),
-  /* used to check if we should switch back to prevspace (of a different type) */
+  /** Used to check if we should switch back to prevspace (of a different type). */
   AREA_FLAG_TEMP_TYPE = (1 << 6),
-  /* for temporary fullscreens (file browser, image editor render)
-   * that are opened above user set fullscreens */
+  /**
+   * For temporary full-screens (file browser, image editor render)
+   * that are opened above user set full-screens.
+   */
   AREA_FLAG_STACKED_FULLSCREEN = (1 << 7),
-  /* update action zones (even if the mouse is not intersecting them) */
+  /** Update action zones (even if the mouse is not intersecting them). */
   AREA_FLAG_ACTIONZONES_UPDATE = (1 << 8),
 };
 
index b4d0c2147f2d7a1237410f8f3108ab221d1e67f6..04fcaf206d4ff28ea1dd32e5ba750207b6121373 100644 (file)
@@ -1637,7 +1637,7 @@ static void do_render_seq(Render *re)
         BKE_stamp_info_from_imbuf(rr, ibuf_arr[view_id]);
       }
 
-      if (recurs_depth == 0) { /* with nested scenes, only free on toplevel... */
+      if (recurs_depth == 0) { /* With nested scenes, only free on top-level. */
         Editing *ed = re->pipeline_scene_eval->ed;
         if (ed) {
           BKE_sequencer_free_imbuf(re->pipeline_scene_eval, &ed->seqbase, true);
index 2e3abfd9944af7f54e656a852583f9234d890c7f..828c337d64d91f053f82735b9e49f60e7a4c3844 100644 (file)
@@ -2397,7 +2397,7 @@ static int wm_handler_fileselect_do(bContext *C,
               CTX_wm_window_set(C, ctx_win);  // wm_window_close() NULLs.
               /* Some operators expect a drawable context (for EVT_FILESELECT_EXEC) */
               wm_window_make_drawable(wm, ctx_win);
-              /* Ensure correct cursor positon, otherwise, popups may close immediately after
+              /* Ensure correct cursor position, otherwise, popups may close immediately after
                * opening (UI_BLOCK_MOVEMOUSE_QUIT) */
               wm_get_cursor_position(ctx_win, &ctx_win->eventstate->x, &ctx_win->eventstate->y);
               wm->winactive = ctx_win; /* Reports use this... */
index 2b89426f083baee43c29e6986f9b8f881ae3262a..a2e7f7fe9353475fe1906df136f4b45dba766b94 100644 (file)
@@ -2408,7 +2408,10 @@ void WM_OT_revert_mainfile(wmOperatorType *ot)
   ot->name = "Revert";
   ot->idname = "WM_OT_revert_mainfile";
   ot->description = "Reload the saved file";
+
   ot->invoke = WM_operator_confirm;
+  ot->exec = wm_revert_mainfile_exec;
+  ot->poll = wm_revert_mainfile_poll;
 
   RNA_def_boolean(ot->srna,
                   "use_scripts",
@@ -2416,9 +2419,6 @@ void WM_OT_revert_mainfile(wmOperatorType *ot)
                   "Trusted Source",
                   "Allow .blend file to execute scripts automatically, default available from "
                   "system preferences");
-
-  ot->exec = wm_revert_mainfile_exec;
-  ot->poll = wm_revert_mainfile_poll;
 }
 
 /** \} */
@@ -2463,8 +2463,8 @@ void WM_OT_recover_last_session(wmOperatorType *ot)
   ot->name = "Recover Last Session";
   ot->idname = "WM_OT_recover_last_session";
   ot->description = "Open the last closed file (\"" BLENDER_QUIT_FILE "\")";
-  ot->invoke = WM_operator_confirm;
 
+  ot->invoke = WM_operator_confirm;
   ot->exec = wm_recover_last_session_exec;
 }
 
@@ -2506,8 +2506,8 @@ void WM_OT_recover_auto_save(wmOperatorType *ot)
   ot->idname = "WM_OT_recover_auto_save";
   ot->description = "Open an automatically saved file to recover it";
 
-  ot->exec = wm_recover_auto_save_exec;
   ot->invoke = wm_recover_auto_save_invoke;
+  ot->exec = wm_recover_auto_save_exec;
 
   WM_operator_properties_filesel(ot,
                                  FILE_TYPE_BLENDER,
index bdc89f2bf2b722c355a792079cafbf066259b468..1e3c8a0aedd4470479817808b04faa8f993bec40 100644 (file)
@@ -288,8 +288,8 @@ void WM_init(bContext *C, int argc, const char **argv)
   const bool use_data = true;
   const bool use_userdef = true;
 
-  /* Studiolights needs to be init before we read the homefile, otherwise the versioning cannot
-   * find the default studiolight.*/
+  /* Studio-lights needs to be init before we read the home-file,
+   * otherwise the versioning cannot find the default studio-light. */
   BKE_studiolight_init();
 
   wm_homefile_read(C,
index 5bb2155187c2dfc256bcbd95c1fdbed287f54223..c020f920eb272eafbec317985d064e2ff35afa41 100644 (file)
@@ -232,8 +232,7 @@ def test_restrictions1():
         bl_context = "render"
 
         def draw(self, context):
-            self.layout.prop_search(context.scene, "prop", bpy.data,
-                                    "objects")
+            self.layout.prop_search(context.scene, "prop", bpy.data, "objects")
             self.layout.template_ID(context.scene, "prop1")
             self.layout.prop_search(context.scene, "prop2", bpy.data, "node_groups")