[Bf-blender-cvs] [c2fbf7668df] temp-lanpr-review: LANPR: Remove LANPR_LineLayerComponent struct as it's no more used.

YimingWu noreply at git.blender.org
Sun Nov 24 15:03:39 CET 2019


Commit: c2fbf7668df77b99110932ffc11893697d3d6d3d
Author: YimingWu
Date:   Sun Nov 24 22:02:29 2019 +0800
Branches: temp-lanpr-review
https://developer.blender.org/rBc2fbf7668df77b99110932ffc11893697d3d6d3d

LANPR: Remove LANPR_LineLayerComponent struct as it's no more used.

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

M	release/scripts/startup/bl_ui/properties_render.py
M	source/blender/blenkernel/intern/scene.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/editors/include/ED_lanpr.h
M	source/blender/editors/lanpr/lanpr_cpu.c
M	source/blender/editors/lanpr/lanpr_ops.c
M	source/blender/makesdna/DNA_lanpr_types.h
M	source/blender/makesrna/intern/rna_collection.c
M	source/blender/makesrna/intern/rna_lanpr.c
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index f5d89d55d37..6a89fb007cf 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -801,46 +801,6 @@ class RENDER_PT_lanpr_layer_settings(RenderButtonsPanel, Panel):
         else:
             layout.label(text= "Intersection calculation disabled.")
 
-class RENDER_PT_lanpr_line_components(RenderButtonsPanel, Panel):
-    bl_label = "Including"
-    bl_parent_id = "RENDER_PT_lanpr"
-    bl_options = {'DEFAULT_CLOSED'}
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_LANPR', 'BLENDER_OPENGL', 'BLENDER_EEVEE'}
-
-    @classmethod
-    def poll(cls, context):
-        scene = context.scene
-        lanpr = scene.lanpr
-        active_layer = lanpr.layers.active_layer
-        return scene.render.engine=="BLENDER_LANPR" and active_layer and not lanpr.enable_chaining
-
-    def draw(self, context):
-        layout = self.layout
-        scene = context.scene
-        lanpr = scene.lanpr
-        active_layer = lanpr.layers.active_layer
-
-        layout.operator("scene.lanpr_add_line_component")#, icon = "ZOOMIN")
-        
-        i=0
-        for c in active_layer.components:
-            split = layout.split(factor=0.85)
-            col = split.column()
-            sp2 = col.split(factor=0.4)
-            cl = sp2.column()
-            cl.prop(c,"component_mode", text = "")
-            cl = sp2.column()
-            if c.component_mode == "OBJECT":
-                cl.prop(c,"object_select", text = "")
-            elif c.component_mode == "MATERIAL":
-                cl.prop(c,"material_select", text = "")
-            elif c.component_mode == "COLLECTION":
-                cl.prop(c,"collection_select", text = "")
-            col = split.column()
-            col.operator("scene.lanpr_delete_line_component", text="").index=i
-            i=i+1
-
-
 class RENDER_PT_lanpr_line_normal_effects(RenderButtonsPanel, Panel):
     bl_label = "Normal Based Line Weight"
     bl_parent_id = "RENDER_PT_lanpr"
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index b569c0ed8e2..6258392715f 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -243,7 +243,6 @@ void BKE_lanpr_copy_data(const Scene *from, Scene *to)
 {
   const SceneLANPR *lanpr = &from->lanpr;
   LANPR_LineLayer *ll, *new_ll;
-  LANPR_LineLayerComponent *llc, *new_llc;
 
   to->lanpr.line_layers.first = to->lanpr.line_layers.last = NULL;
   memset(&to->lanpr.line_layers, 0, sizeof(ListBase));
@@ -251,16 +250,9 @@ void BKE_lanpr_copy_data(const Scene *from, Scene *to)
   for (ll = lanpr->line_layers.first; ll; ll = ll->next) {
     new_ll = MEM_callocN(sizeof(LANPR_LineLayer), "Copied Line Layer");
     memcpy(new_ll, ll, sizeof(LANPR_LineLayer));
-    memset(&new_ll->components, 0, sizeof(ListBase));
     new_ll->next = new_ll->prev = NULL;
     new_ll->batch = NULL;
     BLI_addtail(&to->lanpr.line_layers, new_ll);
-    for (llc = ll->components.first; llc; llc = llc->next) {
-      new_llc = MEM_callocN(sizeof(LANPR_LineLayerComponent), "Copied Line Layer Component");
-      memcpy(new_llc, llc, sizeof(LANPR_LineLayerComponent));
-      new_llc->next = new_llc->prev = NULL;
-      BLI_addtail(&new_ll->components, new_llc);
-    }
   }
 
   /*  render_buffer now only accessible from lanpr_share */
@@ -529,16 +521,12 @@ void BKE_lanpr_free_everything(Scene *s)
 {
   SceneLANPR *lanpr = &s->lanpr;
   LANPR_LineLayer *ll;
-  LANPR_LineLayerComponent *llc;
 
 #ifdef WITH_LANPR
   DRW_scene_lanpr_freecache(s);
 #endif
 
   while ((ll = BLI_pophead(&lanpr->line_layers)) != NULL) {
-    while ((llc = BLI_pophead(&ll->components)) != NULL) {
-      MEM_freeN(llc);
-    }
     MEM_freeN(ll);
   }
 }
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index ba26d9c84d7..265e8851347 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6593,11 +6593,6 @@ static void lib_link_scene(FileData *fd, Main *main)
       }
 
       for (LANPR_LineLayer *ll = sce->lanpr.line_layers.first; ll; ll = ll->next) {
-        for (LANPR_LineLayerComponent *llc = ll->components.first; llc; llc = llc->next) {
-          llc->object_select = newlibadr_us(fd, sce->id.lib, llc->object_select);
-          llc->material_select = newlibadr_us(fd, sce->id.lib, llc->material_select);
-          llc->collection_select = newlibadr_us(fd, sce->id.lib, llc->collection_select);
-        }
         ll->normal_control_object = newlibadr_us(fd, sce->id.lib, ll->normal_control_object);
       }
 
@@ -7049,7 +7044,6 @@ static void direct_link_scene(FileData *fd, Scene *sce)
   sce->lanpr.active_layer = newdataadr(fd, sce->lanpr.active_layer);
   link_list(fd, &(sce->lanpr.line_layers));
   for (LANPR_LineLayer *ll = sce->lanpr.line_layers.first; ll; ll = ll->next) {
-    link_list(fd, &ll->components);
     ll->batch = NULL;
     ll->shgrp = NULL;
   }
@@ -10913,17 +10907,6 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)
   }
 
   for (LANPR_LineLayer *ll = sce->lanpr.line_layers.first; ll; ll = ll->next) {
-    for (LANPR_LineLayerComponent *llc = ll->components.first; llc; llc = llc->next) {
-      if (llc->object_select) {
-        expand_doit(fd, mainvar, llc->object_select);
-      }
-      if (llc->material_select) {
-        expand_doit(fd, mainvar, llc->material_select);
-      }
-      if (llc->collection_select) {
-        expand_doit(fd, mainvar, llc->collection_select);
-      }
-    }
     if (ll->normal_control_object) {
       expand_doit(fd, mainvar, ll->normal_control_object);
     }
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 1d78b329b7a..8a8bd8836ad 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2715,9 +2715,6 @@ static void write_scene(WriteData *wd, Scene *sce)
   /* LANPR Line Layers */
   for (LANPR_LineLayer *ll = sce->lanpr.line_layers.first; ll; ll = ll->next) {
     writestruct(wd, DATA, LANPR_LineLayer, 1, ll);
-    for (LANPR_LineLayerComponent *llc = ll->components.first; llc; llc = llc->next) {
-      writestruct(wd, DATA, LANPR_LineLayerComponent, 1, llc);
-    }
   }
 
   write_view3dshading(wd, &sce->display.shading);
diff --git a/source/blender/editors/include/ED_lanpr.h b/source/blender/editors/include/ED_lanpr.h
index 06ffc324081..50ae61d5650 100644
--- a/source/blender/editors/include/ED_lanpr.h
+++ b/source/blender/editors/include/ED_lanpr.h
@@ -565,7 +565,6 @@ bool ED_lanpr_dpix_shader_error(void);
 
 int ED_lanpr_max_occlusion_in_line_layers(struct SceneLANPR *lanpr);
 LANPR_LineLayer *ED_lanpr_new_line_layer(struct SceneLANPR *lanpr);
-LANPR_LineLayerComponent *ED_lanpr_new_line_component(struct SceneLANPR *lanpr);
 
 LANPR_BoundingArea *ED_lanpr_get_point_bounding_area(LANPR_RenderBuffer *rb, double x, double y);
 LANPR_BoundingArea *ED_lanpr_get_point_bounding_area_deep(LANPR_RenderBuffer *rb, double x, double y);
@@ -591,8 +590,6 @@ void SCENE_OT_lanpr_delete_line_layer(struct wmOperatorType *ot);
 void SCENE_OT_lanpr_rebuild_all_commands(struct wmOperatorType *ot);
 void SCENE_OT_lanpr_auto_create_line_layer(struct wmOperatorType *ot);
 void SCENE_OT_lanpr_move_line_layer(struct wmOperatorType *ot);
-void SCENE_OT_lanpr_add_line_component(struct wmOperatorType *ot);
-void SCENE_OT_lanpr_delete_line_component(struct wmOperatorType *ot);
 void SCENE_OT_lanpr_enable_all_line_types(struct wmOperatorType *ot);
 void SCENE_OT_lanpr_update_gp_strokes(struct wmOperatorType *ot);
 void SCENE_OT_lanpr_bake_gp_strokes(struct wmOperatorType *ot);
diff --git a/source/blender/editors/lanpr/lanpr_cpu.c b/source/blender/editors/lanpr/lanpr_cpu.c
index d4e9d6f7a6a..659f283b950 100644
--- a/source/blender/editors/lanpr/lanpr_cpu.c
+++ b/source/blender/editors/lanpr/lanpr_cpu.c
@@ -159,18 +159,6 @@ LANPR_LineLayer *ED_lanpr_new_line_layer(SceneLANPR *lanpr)
 
   return ll;
 }
-LANPR_LineLayerComponent *ED_lanpr_new_line_component(SceneLANPR *lanpr)
-{
-  if (lanpr->active_layer == NULL) {
-    return 0;
-  }
-  LANPR_LineLayer *ll = lanpr->active_layer;
-
-  LANPR_LineLayerComponent *llc = MEM_callocN(sizeof(LANPR_LineLayerComponent), "Line Component");
-  BLI_addtail(&ll->components, llc);
-
-  return llc;
-}
 static int lanpr_add_line_layer_exec(bContext *C, wmOperator *UNUSED(op))
 {
   Scene *scene = CTX_data_scene(C);
@@ -243,43 +231,6 @@ static int lanpr_move_line_layer_exec(bContext *C, wmOperator *op)
 
   return OPERATOR_FINISHED;
 }
-static int lanpr_add_line_component_exec(bContext *C, wmOperator *UNUSED(op))
-{
-  Scene *scene = CTX_data_scene(C);
-  SceneLANPR *lanpr = &scene->lanpr;
-
-  ED_lanpr_new_line_component(lanpr);
-
-  return OPERATOR_FINISHED;
-}
-static int lanpr_delete_line_component_exec(bContext *C, wmOperator *op)
-{
-  Scene *scene = CTX_data_scene(C);
-  SceneLANPR *lanpr = &scene->lanpr;
-  LANPR_LineLayer *ll = lanpr->active_layer;
-  LANPR_LineLayerComponent *llc;
-  int i = 0;
-
-  if (ll == NULL) {
-    return OPERATOR_FINISHED;
-  }
-
-  int index = RNA_int_get(op->ptr, "index");
-
-  for (llc = ll->components.first; llc; llc = llc->next) {
-    if (index == i) {
-      break;
-    }
-    i++;
-  }
-
-  if (llc) {
-    BLI_remlink(&ll->components, llc);
-    MEM_freeN(llc);
-  }
-
-  return OPERATOR_FINISHED;
-}
 
 static int ED_lanpr_rebuild_all_commands_exec(bContext *C, wmOperator *UNUSED(op))
 {
@@ -417,26 +368,6 @@ void SCENE_OT_lanpr_enable_all_line_types(wmOperatorType *ot)
 
   ot->exec = lanpr_enable_all_line_types_exec;
 }
-void SCENE_OT_lanpr_add_line_component(wmOperatorType *ot)
-{
-
-  ot->name = "Add Line Component";
-  ot->description = "Add a new line Component";
-  ot->idname = "SCENE_OT_lanpr_add_line_component";
-
-  ot->exec = lanpr_add_line_component_exec;
-}
-void SCENE_OT_lanpr_delete_line_component(wmOperatorType *ot)
-{
-
-  ot->name = "Delete Line Component";
-  ot->description = "Delete selected line comp

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list