[Bf-blender-cvs] [90137bbfa46] soc-2019-npr: Fix chaining occlusion error and formatted source files.

YimingWu noreply at git.blender.org
Mon Jun 3 10:31:53 CEST 2019


Commit: 90137bbfa46e79add94f68b05144c434f401c51b
Author: YimingWu
Date:   Mon Jun 3 15:24:15 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rB90137bbfa46e79add94f68b05144c434f401c51b

Fix chaining occlusion error and formatted source files.

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

M	intern/ghost/intern/GHOST_ContextCGL.mm
M	intern/ghost/intern/GHOST_SystemCocoa.mm
M	source/blender/collada/AnimationImporter.cpp
M	source/blender/collada/AnimationImporter.h
M	source/blender/collada/ArmatureImporter.cpp
M	source/blender/collada/BCAnimationCurve.cpp
M	source/blender/collada/BCAnimationCurve.h
M	source/blender/collada/BCMath.h
M	source/blender/collada/BCSampleData.cpp
M	source/blender/collada/ControllerExporter.cpp
M	source/blender/draw/engines/gpencil/gpencil_engine.c
M	source/blender/draw/engines/lanpr/lanpr_access.c
M	source/blender/draw/engines/lanpr/lanpr_access.h
M	source/blender/draw/engines/lanpr/lanpr_all.h
M	source/blender/draw/engines/lanpr/lanpr_chain.c
M	source/blender/draw/engines/lanpr/lanpr_data_types.h
M	source/blender/draw/engines/lanpr/lanpr_engine.c
M	source/blender/draw/engines/lanpr/lanpr_ops.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencilstroke.c
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesrna/intern/rna_gpencil.c
M	source/blender/makesrna/intern/rna_modifier.c

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

diff --git a/intern/ghost/intern/GHOST_ContextCGL.mm b/intern/ghost/intern/GHOST_ContextCGL.mm
index 12c340ffe97..0fca41306a6 100644
--- a/intern/ghost/intern/GHOST_ContextCGL.mm
+++ b/intern/ghost/intern/GHOST_ContextCGL.mm
@@ -34,7 +34,8 @@
 
 static void ghost_fatal_error_dialog(const char *msg)
 {
-  @autoreleasepool {
+  @autoreleasepool
+  {
     NSString *message = [NSString stringWithFormat:@"Error opening window:\n%s", msg];
 
     NSAlert *alert = [[NSAlert alloc] init];
@@ -337,7 +338,8 @@ static const OSType METAL_CORE_VIDEO_PIXEL_FORMAT = kCVPixelFormatType_32BGRA;
 
 void GHOST_ContextCGL::metalInit()
 {
-  @autoreleasepool {
+  @autoreleasepool
+  {
     id<MTLDevice> device = m_metalLayer.device;
 
     // Create a command queue for blit/present operation
@@ -532,7 +534,8 @@ void GHOST_ContextCGL::metalUpdateFramebuffer()
 
 void GHOST_ContextCGL::metalSwapBuffers()
 {
-  @autoreleasepool {
+  @autoreleasepool
+  {
     updateDrawingContext();
     glFlush();
 
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 376ebfa2a21..80a521a7ca5 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1358,7 +1358,8 @@ bool GHOST_SystemCocoa::handleOpenDocumentRequest(void *filepathStr)
 
   // Check open windows if some changes are not saved
   if (m_windowManager->getAnyModifiedState()) {
-    @autoreleasepool {
+    @autoreleasepool
+    {
       NSAlert *alert = [[NSAlert alloc] init];
       NSString *title = [NSString stringWithFormat:@"Opening %@", [filepath lastPathComponent]];
       NSString *text = @"Current document has not been saved.\nDo you really want to proceed?";
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index ef6c81efff7..be748110fb9 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -1376,7 +1376,7 @@ void AnimationImporter::add_bone_animation_sampled(Object *ob,
     for (int i = 0; i < totcu; i++) {
       if (i < 4) {
         add_bezt(newcu[i], fra, qref.quat()[i]);
-	  }
+      }
       else if (i < 7) {
         add_bezt(newcu[i], fra, loc[i - 4]);
       }
@@ -1842,7 +1842,7 @@ Object *AnimationImporter::translate_animation_OLD(
   if (is_rotation || is_matrix) {
     if (is_joint) {
       bPoseChannel *chan = BKE_pose_channel_find_name(ob->pose, bone_name);
-      chan->rotmode = (is_matrix)? ROT_MODE_QUAT : ROT_MODE_EUL;
+      chan->rotmode = (is_matrix) ? ROT_MODE_QUAT : ROT_MODE_EUL;
     }
     else {
       ob->rotmode = (is_matrix) ? ROT_MODE_QUAT : ROT_MODE_EUL;
diff --git a/source/blender/collada/AnimationImporter.h b/source/blender/collada/AnimationImporter.h
index c62ffdbafd3..0043dad7116 100644
--- a/source/blender/collada/AnimationImporter.h
+++ b/source/blender/collada/AnimationImporter.h
@@ -195,7 +195,10 @@ class AnimationImporter : private TransformReader, public AnimationImporterBase
 
   int setAnimType(const COLLADAFW::Animatable *prop, int type, int addition);
 
-  void modify_fcurve(std::vector<FCurve *> *curves, const char *rna_path, int array_index, int scale=1);
+  void modify_fcurve(std::vector<FCurve *> *curves,
+                     const char *rna_path,
+                     int array_index,
+                     int scale = 1);
   void unused_fcurve(std::vector<FCurve *> *curves);
   // prerequisites:
   // animlist_map - map animlist id -> animlist
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index de8b8aab93c..e79a97c890f 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -523,7 +523,7 @@ void ArmatureImporter::create_armature_bones(Main *bmain, std::vector<Object *>
     ED_armature_from_edit(bmain, armature);
     ED_armature_edit_free(armature);
 
-	set_bone_transformation_type(node, ob_arm);
+    set_bone_transformation_type(node, ob_arm);
 
     int index = std::find(ob_arms.begin(), ob_arms.end(), ob_arm) - ob_arms.begin();
     if (index == 0) {
diff --git a/source/blender/collada/BCAnimationCurve.cpp b/source/blender/collada/BCAnimationCurve.cpp
index 2295821aaf8..1ea63508965 100644
--- a/source/blender/collada/BCAnimationCurve.cpp
+++ b/source/blender/collada/BCAnimationCurve.cpp
@@ -174,7 +174,7 @@ const std::string BCAnimationCurve::get_animation_name(Object *ob) const
       }
       else {
         const char *boneName = BLI_str_quoted_substrN(fcurve->rna_path, "pose.bones[");
-        name = (boneName) ? id_name(ob)+"_"+std::string(boneName) : "";
+        name = (boneName) ? id_name(ob) + "_" + std::string(boneName) : "";
       }
     } break;
 
@@ -338,10 +338,8 @@ const bool BCAnimationCurve::is_transform_curve() const
 const bool BCAnimationCurve::is_rotation_curve() const
 {
   std::string channel_type = this->get_channel_type();
-  return (channel_type == "rotation"
-	      || channel_type == "rotation_euler"
-	      || channel_type == "rotation_quaternion"
-	  );
+  return (channel_type == "rotation" || channel_type == "rotation_euler" ||
+          channel_type == "rotation_quaternion");
 }
 
 const float BCAnimationCurve::get_value(const float frame)
diff --git a/source/blender/collada/BCAnimationCurve.h b/source/blender/collada/BCAnimationCurve.h
index 1b97ea4a0ba..33533258dc2 100644
--- a/source/blender/collada/BCAnimationCurve.h
+++ b/source/blender/collada/BCAnimationCurve.h
@@ -120,7 +120,7 @@ class BCAnimationCurve {
   const std::string get_animation_name(Object *ob) const; /* xxx: this is collada specific */
   const std::string get_channel_target() const;
   const std::string get_channel_type() const;
-  const std::string get_channel_posebone() const; // returns "" if channel is not a bone channel
+  const std::string get_channel_posebone() const;  // returns "" if channel is not a bone channel
 
   const int get_channel_index() const;
   const int get_subindex() const;
diff --git a/source/blender/collada/BCMath.h b/source/blender/collada/BCMath.h
index cc2ce7ce315..bb62f6c179a 100644
--- a/source/blender/collada/BCMath.h
+++ b/source/blender/collada/BCMath.h
@@ -54,7 +54,6 @@ class BCQuat {
   }
 
   void rotate_to(Matrix &mat_to);
-
 };
 
 class BCMatrix {
diff --git a/source/blender/collada/BCSampleData.cpp b/source/blender/collada/BCSampleData.cpp
index 2443ef9fcaa..7e23a2de00f 100644
--- a/source/blender/collada/BCSampleData.cpp
+++ b/source/blender/collada/BCSampleData.cpp
@@ -55,7 +55,7 @@ const bool BCSample::get_value(std::string channel_target, const int array_index
       if (bname == bone->name) {
         matrix = it->second;
         break;
-	  }
+      }
     }
   }
   else {
diff --git a/source/blender/collada/ControllerExporter.cpp b/source/blender/collada/ControllerExporter.cpp
index b574635217c..bfec387a199 100644
--- a/source/blender/collada/ControllerExporter.cpp
+++ b/source/blender/collada/ControllerExporter.cpp
@@ -444,7 +444,7 @@ void ControllerExporter::add_bind_shape_mat(Object *ob)
   // UnitConverter::mat4_to_dae_double(bind_mat, ob->obmat);
   UnitConverter::mat4_to_dae_double(bind_mat, f_obmat);
   if (this->export_settings.get_limit_precision()) {
-	  BCMatrix::sanitize(bind_mat, LIMITTED_PRECISION);
+    BCMatrix::sanitize(bind_mat, LIMITTED_PRECISION);
   }
 
   addBindShapeTransform(bind_mat);
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 6d48f40ee61..3466ea721b5 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -1038,15 +1038,15 @@ void GPENCIL_draw_scene(void *ved)
         stl->storage->no_depth_composition = gpd->no_depth;
 
         /* draw mix pass */
-        if(gpd->no_depth){
-            DRW_pass_state_remove(psl->mix_pass,DRW_STATE_WRITE_DEPTH|DRW_STATE_DEPTH_LESS);
-          }
+        if (gpd->no_depth) {
+          DRW_pass_state_remove(psl->mix_pass, DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS);
+        }
 
         DRW_draw_pass(psl->mix_pass);
 
         /* restore */
-        if(gpd->no_depth){
-          DRW_pass_state_add(psl->mix_pass,DRW_STATE_WRITE_DEPTH|DRW_STATE_DEPTH_LESS);
+        if (gpd->no_depth) {
+          DRW_pass_state_add(psl->mix_pass, DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS);
         }
 
         /* disable select flag */
diff --git a/source/blender/draw/engines/lanpr/lanpr_access.c b/source/blender/draw/engines/lanpr/lanpr_access.c
index 417974234aa..85c9327d99f 100644
--- a/source/blender/draw/engines/lanpr/lanpr_access.c
+++ b/source/blender/draw/engines/lanpr/lanpr_access.c
@@ -25,262 +25,257 @@
 #include "lanpr_all.h"
 #include "lanpr_access.h"
 
-static BMVert* split_edge_and_move(BMesh *bm, BMEdge *edge, const float new_pos[3]){
-	//Split edge one time and move the created vert to new_pos
-	BMVert *vert;
+static BMVert *split_edge_and_move(BMesh *bm, BMEdge *edge, const float new_pos[3])
+{
+  // Split edge one time and move the created vert to new_pos
+  BMVert *vert;
 
-	vert = bmesh_kernel_split_edge_make_vert(bm, edge->v1, edge, NULL);
+  vert = bmesh_kernel_split_edge_make_vert(bm, edge->v1, edge, NULL);
 
-	copy_v3_v3(vert->co, new_pos);
+  copy_v3_v3(vert->co, new_pos);
 
-	return vert;
+  return vert;
 }
 
 void lanpr_generate_gpencil_geometry(
-        GpencilModifierData *md, Depsgraph *depsgraph,
-        Object *ob, bGPDlayer *gpl, bGPDframe *gpf)
+    GpencilModifierData *md, Depsgraph *depsgraph, Object *ob, bGPDlayer *gpl, bGPDframe *gpf)
 {
-	StrokeGpencilModifierData *gpmd = (StrokeGpencilModifierData *)md;
-	Scene *scene = DEG_get_evaluated_scene(depsgraph);
-	LANPR_RenderBuffer *rb = scene->lanpr.render_buffer;
-
-	if( gpmd->object == NULL ){
-		printf("NULL object!\n");
-    	return;
-	}
-
-	if( rb == NULL ){
-		printf("NULL LANPR rb!\n");
-		return;
-	}
-
-	int color_idx = 0;
-	int tot_points = 0;
-	short thickness = 1;
+  StrokeGpencilModifierData *gpmd = (StrokeGpencilModifierData *)md;
+  Scene *scene = DEG_get_evaluated_scene(depsgraph);
+  LANPR_RenderBuffer *rb = scene->lanpr.render_buffer;
 
-	float mat[4][4];
+  if (gpmd->object == NULL) {

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list