[Bf-blender-cvs] [b8cb26eff9a] temp-lanpr-staging: LANPR: Fix some code style based on recommendations.

YimingWu noreply at git.blender.org
Wed Sep 4 08:16:14 CEST 2019


Commit: b8cb26eff9ad5a0ef402ca1954f41d0777784f6a
Author: YimingWu
Date:   Wed Sep 4 14:13:49 2019 +0800
Branches: temp-lanpr-staging
https://developer.blender.org/rBb8cb26eff9ad5a0ef402ca1954f41d0777784f6a

LANPR: Fix some code style based on recommendations.

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

M	source/blender/blenkernel/intern/library_query.c
M	source/blender/editors/include/ED_lanpr.h
M	source/blender/editors/lanpr/lanpr_cpu.c
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/CMakeLists.txt
M	source/blender/makesrna/intern/rna_collection.c

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

diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c
index ca3da0d89c7..c36d5b27b54 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -493,6 +493,8 @@ static void library_foreach_ID_link(Main *bmain,
           CALLBACK_INVOKE(child->collection, IDWALK_CB_USER);
         }
 
+        CALLBACK_INVOKE(scene->master_collection->lanpr.target, IDWALK_CB_USER);
+
         ViewLayer *view_layer;
         for (view_layer = scene->view_layers.first; view_layer; view_layer = view_layer->next) {
           CALLBACK_INVOKE(view_layer->mat_override, IDWALK_CB_USER);
diff --git a/source/blender/editors/include/ED_lanpr.h b/source/blender/editors/include/ED_lanpr.h
index d7ac527d50e..b5130c90aa5 100644
--- a/source/blender/editors/include/ED_lanpr.h
+++ b/source/blender/editors/include/ED_lanpr.h
@@ -568,8 +568,8 @@ void tmat_make_perspective_matrix_44d(
     double (*mProjection)[4], real fFov_rad, real fAspect, real zMin, real zMax);
 
 int lanpr_count_this_line(LANPR_RenderLine *rl, LANPR_LineLayer *ll);
-long lanpr_count_leveled_edge_segment_count(ListBase *LineList, LANPR_LineLayer *ll);
-long lanpr_count_intersection_segment_count(LANPR_RenderBuffer *rb);
+int lanpr_count_leveled_edge_segment_count(ListBase *LineList, LANPR_LineLayer *ll);
+int lanpr_count_intersection_segment_count(LANPR_RenderBuffer *rb);
 void *lanpr_make_leveled_edge_vertex_array(LANPR_RenderBuffer *rb,
                                            ListBase *LineList,
                                            float *vertexArray,
diff --git a/source/blender/editors/lanpr/lanpr_cpu.c b/source/blender/editors/lanpr/lanpr_cpu.c
index 4fb90dac6b2..fcc5cbb010f 100644
--- a/source/blender/editors/lanpr/lanpr_cpu.c
+++ b/source/blender/editors/lanpr/lanpr_cpu.c
@@ -2789,12 +2789,12 @@ int lanpr_count_this_line(LANPR_RenderLine *rl, LANPR_LineLayer *ll)
     return AndResult;
   }
 }
-long lanpr_count_leveled_edge_segment_count(ListBase *LineList, LANPR_LineLayer *ll)
+int lanpr_count_leveled_edge_segment_count(ListBase *LineList, LANPR_LineLayer *ll)
 {
   LinkData *lip;
   LANPR_RenderLine *rl;
   LANPR_RenderLineSegment *rls;
-  long Count = 0;
+  int Count = 0;
   for (lip = LineList->first; lip; lip = lip->next) {
     rl = lip->data;
     if (!lanpr_count_this_line(rl, ll)) {
@@ -2817,10 +2817,10 @@ long lanpr_count_leveled_edge_segment_count(ListBase *LineList, LANPR_LineLayer
   }
   return Count;
 }
-long lanpr_count_intersection_segment_count(LANPR_RenderBuffer *rb)
+int lanpr_count_intersection_segment_count(LANPR_RenderBuffer *rb)
 {
   LANPR_RenderLine *rl;
-  long Count = 0;
+  int Count = 0;
   for (rl = rb->intersection_lines.first; rl; rl = rl->next) {
     Count++;
   }
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index a350908760b..1a13d7e150f 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -393,8 +393,8 @@ typedef enum eStereo3dInterlaceType {
  * this is used for NodeImageFile and IMAGE_OT_save_as operator too.
  *
  * note: its a bit strange that even though this is an image format struct
- *  the imtype can still be used to select video formats.
- *  RNA ensures these enum's are only selectable for render output.
+ * the imtype can still be used to select video formats.
+ * RNA ensures these enum's are only selectable for render output.
  */
 typedef struct ImageFormatData {
   /**
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 05408f1a41a..89fa80e6dd6 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -25,74 +25,74 @@ endif()
 
 # files rna_access.c rna_define.c makesrna.c intentionally excluded.
 set(DEFSRC
-	rna_ID.c
-	rna_action.c
-	rna_animation.c
-	rna_animviz.c
-	rna_armature.c
-	rna_boid.c
-	rna_brush.c
-	rna_cachefile.c
-	rna_camera.c
-	rna_cloth.c
-	rna_collection.c
-	rna_color.c
-	rna_constraint.c
-	rna_context.c
-	rna_curve.c
-	rna_depsgraph.c
-	rna_dynamicpaint.c
-	rna_fcurve.c
-	rna_fluidsim.c
-	rna_gpencil.c
-	rna_gpencil_modifier.c
-	rna_image.c
-	rna_key.c
-	rna_lattice.c
-	rna_layer.c
-	rna_light.c
-	rna_lightprobe.c
-	rna_linestyle.c
-	rna_lanpr.c
-	rna_main.c
-	rna_mask.c
-	rna_material.c
-	rna_mesh.c
-	rna_meta.c
-	rna_modifier.c
-	rna_movieclip.c
-	rna_nla.c
-	rna_nodetree.c
-	rna_object.c
-	rna_object_force.c
-	rna_packedfile.c
-	rna_palette.c
-	rna_particle.c
-	rna_pose.c
-	rna_render.c
-	rna_rigidbody.c
-	rna_rna.c
-	rna_scene.c
-	rna_screen.c
-	rna_sculpt_paint.c
-	rna_sequencer.c
-	rna_shader_fx.c
-	rna_smoke.c
-	rna_sound.c
-	rna_space.c
-	rna_speaker.c
-	rna_test.c
-	rna_text.c
-	rna_texture.c
-	rna_timeline.c
-	rna_tracking.c
-	rna_ui.c
-	rna_userdef.c
-	rna_vfont.c
-	rna_wm.c
-	rna_wm_gizmo.c
-	rna_workspace.c
-	rna_world.c
+  rna_ID.c
+  rna_action.c
+  rna_animation.c
+  rna_animviz.c
+  rna_armature.c
+  rna_boid.c
+  rna_brush.c
+  rna_cachefile.c
+  rna_camera.c
+  rna_cloth.c
+  rna_collection.c
+  rna_color.c
+  rna_constraint.c
+  rna_context.c
+  rna_curve.c
+  rna_depsgraph.c
+  rna_dynamicpaint.c
+  rna_fcurve.c
+  rna_fluidsim.c
+  rna_gpencil.c
+  rna_gpencil_modifier.c
+  rna_image.c
+  rna_key.c
+  rna_lattice.c
+  rna_layer.c
+  rna_light.c
+  rna_lightprobe.c
+  rna_linestyle.c
+  rna_lanpr.c
+  rna_main.c
+  rna_mask.c
+  rna_material.c
+  rna_mesh.c
+  rna_meta.c
+  rna_modifier.c
+  rna_movieclip.c
+  rna_nla.c
+  rna_nodetree.c
+  rna_object.c
+  rna_object_force.c
+  rna_packedfile.c
+  rna_palette.c
+  rna_particle.c
+  rna_pose.c
+  rna_render.c
+  rna_rigidbody.c
+  rna_rna.c
+  rna_scene.c
+  rna_screen.c
+  rna_sculpt_paint.c
+  rna_sequencer.c
+  rna_shader_fx.c
+  rna_smoke.c
+  rna_sound.c
+  rna_space.c
+  rna_speaker.c
+  rna_test.c
+  rna_text.c
+  rna_texture.c
+  rna_timeline.c
+  rna_tracking.c
+  rna_ui.c
+  rna_userdef.c
+  rna_vfont.c
+  rna_wm.c
+  rna_wm_gizmo.c
+  rna_workspace.c
+  rna_world.c
 )
 
 set(APISRC
diff --git a/source/blender/makesrna/intern/rna_collection.c b/source/blender/makesrna/intern/rna_collection.c
index 723d8c7ffc9..052e317bd4a 100644
--- a/source/blender/makesrna/intern/rna_collection.c
+++ b/source/blender/makesrna/intern/rna_collection.c
@@ -370,9 +370,9 @@ static void rna_def_collection_lanpr(BlenderRNA *brna, StructRNA *srna)
   PropertyRNA *prop;
 
   static const EnumPropertyItem rna_collection_lanpr_usage[] = {
-      {0, "INCLUDE", 0, "Include", "Include the collection into LANPR calculation"},
-      {1, "OCCLUSION_ONLY", 0, "Occlusion Only", "Only use the collction to produce occlusion"},
-      {2, "EXCLUDE", 0, "Exclude", "Don't use this collection in LANPR"},
+      {COLLECTION_LANPR_INCLUDE, "INCLUDE", 0, "Include", "Collection will produce feature lines"},
+      {COLLECTION_LANPR_OCCLUSION_ONLY, "OCCLUSION_ONLY", 0, "Occlusion Only", "Only use the collection to produce occlusion"},
+      {COLLECTION_LANPR_EXCLUDE, "EXCLUDE", 0, "Exclude", "Don't use this collection in LANPR"},
       {0, NULL, 0, NULL, NULL}};
 
   srna = RNA_def_struct(brna, "CollectionLANPR", NULL);
@@ -408,11 +408,11 @@ static void rna_def_collection_lanpr(BlenderRNA *brna, StructRNA *srna)
   prop = RNA_def_property(srna, "force", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_default(prop, 0);
   RNA_def_property_ui_text(
-      prop, "Force", "Force object who has LANPR modifiers to follow the rule");
+      prop, "Force", "Force object that has LANPR modifiers to follow collection usage flag");
 
   prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
   RNA_def_property_pointer_sdna(prop, NULL, "target");
-  RNA_def_property_ui_text(prop, "Target", "GPencil object to put the stroke result");
+  RNA_def_property_ui_text(prop, "Target", "Grease Pencil object to put the stroke result");
   RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_GPencil_object_poll");
   RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);



More information about the Bf-blender-cvs mailing list