[Bf-blender-cvs] [ac56bf75c00] lanpr-under-gp: Refactor: (Continue files for last commit)
YimingWu
noreply at git.blender.org
Sat Jun 27 08:32:53 CEST 2020
Commit: ac56bf75c002a42e2b13279288f5c876864962f5
Author: YimingWu
Date: Sat Jun 27 14:32:47 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rBac56bf75c002a42e2b13279288f5c876864962f5
Refactor: (Continue files for last commit)
===================================================================
M release/scripts/startup/bl_ui/properties_collection.py
M release/scripts/startup/bl_ui/properties_lanpr.py
M release/scripts/startup/bl_ui/properties_render.py
M source/blender/blenkernel/intern/scene.c
M source/blender/editors/lanpr/lanpr_chain.c
M source/blender/editors/lanpr/lanpr_cpu.c
M source/blender/editors/lanpr/lanpr_intern.h
M source/blender/editors/lanpr/lanpr_ops.c
M source/blender/editors/lanpr/lanpr_util.c
M source/blender/editors/render/render_update.c
M source/blender/editors/util/ed_util.c
M source/blender/makesrna/intern/rna_scene.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py
index 3713b394b62..84310b68086 100644
--- a/release/scripts/startup/bl_ui/properties_collection.py
+++ b/release/scripts/startup/bl_ui/properties_collection.py
@@ -30,7 +30,7 @@ class CollectionButtonsPanel:
return (context.engine in cls.COMPAT_ENGINES)
-def lanpr_make_line_type_entry(col, line_type, text_disp, expand, search_from):
+def lineart_make_line_type_entry(col, line_type, text_disp, expand, search_from):
col.prop(line_type, "use", text=text_disp)
if line_type.use and expand:
col.prop_search(line_type, "layer", search_from, "layers", icon='GREASEPENCIL')
@@ -108,11 +108,11 @@ class COLLECTION_PT_lanpr_collection(CollectionButtonsPanel, Panel):
layout.prop_search(lanpr, 'target_material', lanpr.target.data, "materials", icon='SHADING_TEXTURE')
expand = not lanpr.use_same_style
- lanpr_make_line_type_entry(layout, lanpr.contour, "Contour", expand, lanpr.target.data)
- lanpr_make_line_type_entry(layout, lanpr.crease, "Crease", expand, lanpr.target.data)
- lanpr_make_line_type_entry(layout, lanpr.material, "Material", expand, lanpr.target.data)
- lanpr_make_line_type_entry(layout, lanpr.edge_mark, "Edge Mark", expand, lanpr.target.data)
- lanpr_make_line_type_entry(layout, lanpr.intersection, "Intersection", expand, lanpr.target.data)
+ lineart_make_line_type_entry(layout, lanpr.contour, "Contour", expand, lanpr.target.data)
+ lineart_make_line_type_entry(layout, lanpr.crease, "Crease", expand, lanpr.target.data)
+ lineart_make_line_type_entry(layout, lanpr.material, "Material", expand, lanpr.target.data)
+ lineart_make_line_type_entry(layout, lanpr.edge_mark, "Edge Mark", expand, lanpr.target.data)
+ lineart_make_line_type_entry(layout, lanpr.intersection, "Intersection", expand, lanpr.target.data)
classes = (
COLLECTION_PT_collection_flags,
diff --git a/release/scripts/startup/bl_ui/properties_lanpr.py b/release/scripts/startup/bl_ui/properties_lanpr.py
index 6bb42ec75ba..e6d253418d5 100644
--- a/release/scripts/startup/bl_ui/properties_lanpr.py
+++ b/release/scripts/startup/bl_ui/properties_lanpr.py
@@ -25,7 +25,7 @@ class LanprButtonsPanel:
bl_context = "lanpr"
COMPAT_ENGINES = { 'BLENDER_LANPR' }
-def lanpr_make_line_type_entry(col, line_type, text_disp, expand, search_from):
+def lineart_make_line_type_entry(col, line_type, text_disp, expand, search_from):
col.prop(line_type, "use", text=text_disp)
if line_type.use and expand:
col.prop_search(line_type, "layer", search_from, "layers", icon='GREASEPENCIL')
@@ -66,10 +66,10 @@ class OBJECT_PT_lanpr_settings(LanprButtonsPanel, Panel):
layout.prop_search(obl, 'target_material', obl.target.data, "materials", icon='SHADING_TEXTURE')
expand = not obl.use_same_style
- lanpr_make_line_type_entry(layout, obl.contour, "Contour", expand, obl.target.data)
- lanpr_make_line_type_entry(layout, obl.crease, "Crease", expand, obl.target.data)
- lanpr_make_line_type_entry(layout, obl.material, "Material", expand, obl.target.data)
- lanpr_make_line_type_entry(layout, obl.edge_mark, "Edge Mark", expand, obl.target.data)
+ lineart_make_line_type_entry(layout, obl.contour, "Contour", expand, obl.target.data)
+ lineart_make_line_type_entry(layout, obl.crease, "Crease", expand, obl.target.data)
+ lineart_make_line_type_entry(layout, obl.material, "Material", expand, obl.target.data)
+ lineart_make_line_type_entry(layout, obl.edge_mark, "Edge Mark", expand, obl.target.data)
class OBJECT_PT_lanpr(LanprButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index 94bf3ccd601..fbd8e5a5963 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -731,23 +731,23 @@ class RENDER_PT_lanpr(RenderButtonsPanel, Panel):
c.enabled = has_camera
if not lanpr.auto_update:
- c.operator("scene.lanpr_calculate", icon='FILE_REFRESH')
+ c.operator("scene.lineart_calculate", icon='FILE_REFRESH')
- layout.operator("scene.lanpr_auto_create_line_layer", text = "Default", icon = "ADD")
+ layout.operator("scene.lineart_auto_create_line_layer", text = "Default", icon = "ADD")
row=layout.row()
row.template_list("LANPR_UL_linesets", "", lanpr, "layers", lanpr.layers, "active_layer_index", rows=4)
col=row.column(align=True)
if active_layer:
- col.operator("scene.lanpr_add_line_layer", icon="ADD", text='')
- col.operator("scene.lanpr_delete_line_layer", icon="REMOVE", text='')
+ col.operator("scene.lineart_add_line_layer", icon="ADD", text='')
+ col.operator("scene.lineart_delete_line_layer", icon="REMOVE", text='')
col.separator()
- col.operator("scene.lanpr_move_line_layer",icon='TRIA_UP', text='').direction = "UP"
- col.operator("scene.lanpr_move_line_layer",icon='TRIA_DOWN', text='').direction = "DOWN"
+ col.operator("scene.lineart_move_line_layer",icon='TRIA_UP', text='').direction = "UP"
+ col.operator("scene.lineart_move_line_layer",icon='TRIA_DOWN', text='').direction = "DOWN"
col.separator()
else:
- col.operator("scene.lanpr_add_line_layer", icon="ADD", text='')
+ col.operator("scene.lineart_add_line_layer", icon="ADD", text='')
-def lanpr_make_line_type(expand,layout,line_type,label):
+def lineart_make_line_type(expand,layout,line_type,label):
layout.prop(line_type, "use", text=label)
if expand and line_type.use:
c = layout.column(align=True)
@@ -784,13 +784,13 @@ class RENDER_PT_lanpr_layer_settings(RenderButtonsPanel, Panel):
col.prop(active_layer, "color")
col.prop(active_layer, "thickness", text="Main Thickness")
- lanpr_make_line_type(expand,layout,active_layer.contour,"Contour")
- lanpr_make_line_type(expand,layout,active_layer.crease,"Crease")
- lanpr_make_line_type(expand,layout,active_layer.edge_mark,"EdgeMark")
- lanpr_make_line_type(expand,layout,active_layer.material_separate,"Material")
+ lineart_make_line_type(expand,layout,active_layer.contour,"Contour")
+ lineart_make_line_type(expand,layout,active_layer.crease,"Crease")
+ lineart_make_line_type(expand,layout,active_layer.edge_mark,"EdgeMark")
+ lineart_make_line_type(expand,layout,active_layer.material_separate,"Material")
if lanpr.use_intersections:
- lanpr_make_line_type(expand,layout,active_layer.intersection,"Intersection")
+ lineart_make_line_type(expand,layout,active_layer.intersection,"Intersection")
else:
layout.label(text= "Intersection calculation disabled.")
@@ -848,8 +848,8 @@ class RENDER_PT_lanpr_gpencil(RenderButtonsPanel, Panel):
layout.prop(lanpr,"auto_update", text='Auto Update')
layout.prop(lanpr,"gpencil_overwrite", text='Overwrite')
if not lanpr.auto_update:
- layout.operator("scene.lanpr_update_gp_strokes", icon='FILE_REFRESH', text='Update Grease Pencil Targets')
- layout.operator("scene.lanpr_bake_gp_strokes", icon='RENDER_ANIMATION', text='Bake All Frames')
+ layout.operator("scene.lineart_update_gp_strokes", icon='FILE_REFRESH', text='Update Grease Pencil Targets')
+ layout.operator("scene.lineart_bake_gp_strokes", icon='RENDER_ANIMATION', text='Bake All Frames')
class RENDER_PT_lanpr_options(RenderButtonsPanel, Panel):
bl_label = "Settings"
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 78784a6cc81..fcd332677bf 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -247,7 +247,7 @@ static void BKE_lanpr_copy_data(const Scene *from, Scene *to)
BLI_addtail(&to->lanpr.line_layers, new_ll);
}
- /* render_buffer now only accessible from lanpr_share */
+ /* render_buffer now only accessible from lineart_share */
}
static void scene_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int flag)
diff --git a/source/blender/editors/lanpr/lanpr_chain.c b/source/blender/editors/lanpr/lanpr_chain.c
index 82eb096d020..30b13c55048 100644
--- a/source/blender/editors/lanpr/lanpr_chain.c
+++ b/source/blender/editors/lanpr/lanpr_chain.c
@@ -46,23 +46,22 @@
#define LANPR_OTHER_RV(rl, rv) ((rv) == (rl)->l ? (rl)->r : (rl)->l)
-static LANPR_RenderLine *lanpr_get_connected_render_line(LANPR_BoundingArea *ba,
- LANPR_RenderVert *rv,
- LANPR_RenderVert **new_rv,
- int match_flag)
+static eLineArtRenderLine *lineart_get_connected_render_line(eLineArtBoundingArea *ba,
+ eLineArtRenderVert *rv,
+ eLineArtRenderVert **new_rv,
+ int match_flag)
{
LinkData *lip;
- LANPR_RenderLine *nrl;
+ eLineArtRenderLine *nrl;
for (lip = ba->linked_lines.first; lip; lip = lip->next) {
nrl = lip->data;
- if ((!(nrl->flags & LANPR_EDGE_FLAG_ALL_TYPE)) ||
- (nrl->flags & LANPR_EDGE_FLAG_CHAIN_PICKED)) {
+ if ((!(nrl->flags & LRT_EDGE_FLAG_ALL_TYPE)) || (nrl->flags & LRT_EDGE_FLAG_CHAIN_PICKED)) {
continue;
}
- if (match_flag && ((nrl->flags & LANPR_EDGE_FLAG_ALL_TYPE) & match_flag) == 0) {
+ if (match_flag && ((nrl->flags & LRT_EDGE_FLAG_ALL_TYPE) & match_flag) == 0) {
continue;
}
@@ -71,7 +70,7 @@ static LANPR_RenderLine *lanpr_get_connected_render_line(LANPR_BoundingA
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list