[Bf-blender-cvs] [52ef81f8481] lanpr-under-gp: LineArt: data copying and mofifier UI for vgroup.
YimingWu
noreply at git.blender.org
Fri Oct 2 07:40:29 CEST 2020
Commit: 52ef81f8481c48f0ec2a8a94fe19c4913d5a2d97
Author: YimingWu
Date: Fri Oct 2 13:38:32 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rB52ef81f8481c48f0ec2a8a94fe19c4913d5a2d97
LineArt: data copying and mofifier UI for vgroup.
===================================================================
M source/blender/editors/include/ED_lineart.h
M source/blender/editors/lineart/lineart_chain.c
M source/blender/editors/lineart/lineart_cpu.c
M source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
M source/blender/makesdna/DNA_gpencil_modifier_types.h
M source/blender/makesrna/intern/rna_gpencil_modifier.c
===================================================================
diff --git a/source/blender/editors/include/ED_lineart.h b/source/blender/editors/include/ED_lineart.h
index 11c3c2ac6b0..f910e777a29 100644
--- a/source/blender/editors/include/ED_lineart.h
+++ b/source/blender/editors/include/ED_lineart.h
@@ -161,6 +161,7 @@ typedef struct LineartRenderLineChainItem {
char line_type;
char occlusion;
unsigned char transparency_mask;
+ size_t index;
} LineartRenderLineChainItem;
typedef struct LineartChainRegisterEntry {
diff --git a/source/blender/editors/lineart/lineart_chain.c b/source/blender/editors/lineart/lineart_chain.c
index eee5d8f63c6..e1041691fc2 100644
--- a/source/blender/editors/lineart/lineart_chain.c
+++ b/source/blender/editors/lineart/lineart_chain.c
@@ -126,7 +126,8 @@ static LineartRenderLineChainItem *lineart_chain_append_point(LineartRenderBuffe
float *normal,
char type,
int level,
- unsigned char transparency_mask)
+ unsigned char transparency_mask,
+ size_t index)
{
LineartRenderLineChainItem *rlci;
@@ -146,6 +147,7 @@ static LineartRenderLineChainItem *lineart_chain_append_point(LineartRenderBuffe
rlci->gpos[0] = gx;
rlci->gpos[1] = gy;
rlci->gpos[2] = gz;
+ rlci->index = index;
copy_v3_v3(rlci->normal, normal);
rlci->line_type = type & LRT_EDGE_FLAG_ALL_TYPE;
rlci->occlusion = level;
@@ -167,7 +169,8 @@ static LineartRenderLineChainItem *lineart_chain_push_point(LineartRenderBuffer
float *normal,
char type,
int level,
- unsigned char transparency_mask)
+ unsigned char transparency_mask,
+ size_t index)
{
LineartRenderLineChainItem *rlci;
@@ -182,6 +185,7 @@ static LineartRenderLineChainItem *lineart_chain_push_point(LineartRenderBuffer
rlci->gpos[0] = gx;
rlci->gpos[1] = gy;
rlci->gpos[2] = gz;
+ rlci->index = index;
copy_v3_v3(rlci->normal, normal);
rlci->line_type = type & LRT_EDGE_FLAG_ALL_TYPE;
rlci->occlusion = level;
@@ -246,7 +250,8 @@ void ED_lineart_chain_feature_lines(LineartRenderBuffer *rb)
N,
rl->flags,
rls->occlusion,
- rls->transparency_mask);
+ rls->transparency_mask,
+ new_rv->index);
while (ba && (new_rl = lineart_line_get_connected(ba, new_rv, &new_rv, rl->flags))) {
new_rl->flags |= LRT_EDGE_FLAG_CHAIN_PICKED;
@@ -282,7 +287,8 @@ void ED_lineart_chain_feature_lines(LineartRenderBuffer *rb)
N,
new_rl->flags,
rls->occlusion,
- rls->transparency_mask);
+ rls->transparency_mask,
+ new_rv->index);
last_occlusion = rls->occlusion;
last_transparency = rls->transparency_mask;
}
@@ -308,7 +314,8 @@ void ED_lineart_chain_feature_lines(LineartRenderBuffer *rb)
N,
new_rl->flags,
last_occlusion,
- last_transparency);
+ last_transparency,
+ new_rv->index);
last_occlusion = rls->occlusion;
last_transparency = rls->transparency_mask;
}
@@ -322,7 +329,8 @@ void ED_lineart_chain_feature_lines(LineartRenderBuffer *rb)
N,
new_rl->flags,
last_occlusion,
- last_transparency);
+ last_transparency,
+ new_rv->index);
}
ba = ED_lineart_get_point_bounding_area_deep(rb, new_rv->fbcoord[0], new_rv->fbcoord[1]);
}
@@ -362,7 +370,8 @@ void ED_lineart_chain_feature_lines(LineartRenderBuffer *rb)
N,
rl->flags,
rls->occlusion,
- rls->transparency_mask);
+ rls->transparency_mask,
+ rl->l->index);
last_occlusion = rls->occlusion;
}
lineart_chain_append_point(rb,
@@ -375,7 +384,8 @@ void ED_lineart_chain_feature_lines(LineartRenderBuffer *rb)
N,
rl->flags,
last_occlusion,
- last_transparency);
+ last_transparency,
+ rl->r->index);
/* step 3: grow right */
ba = ED_lineart_get_point_bounding_area_deep(rb, rl->r->fbcoord[0], rl->r->fbcoord[1]);
@@ -427,7 +437,8 @@ void ED_lineart_chain_feature_lines(LineartRenderBuffer *rb)
N,
new_rl->flags,
last_occlusion,
- last_transparency);
+ last_transparency,
+ new_rv->index);
}
}
else if (new_rv == new_rl->r) {
@@ -452,7 +463,8 @@ void ED_lineart_chain_feature_lines(LineartRenderBuffer *rb)
N,
new_rl->flags,
rls->occlusion,
- rls->transparency_mask);
+ rls->transparency_mask,
+ new_rv->index);
last_occlusion = rls->occlusion;
last_transparency = rls->transparency_mask;
}
@@ -466,7 +478,8 @@ void ED_lineart_chain_feature_lines(LineartRenderBuffer *rb)
N,
new_rl->flags,
last_occlusion,
- last_transparency);
+ last_transparency,
+ new_rv->index);
}
ba = ED_lineart_get_point_bounding_area_deep(rb, new_rv->fbcoord[0], new_rv->fbcoord[1]);
}
@@ -627,7 +640,8 @@ void ED_lineart_chain_split_for_fixed_occlusion(LineartRenderBuffer *rb)
rlci->normal,
rlci->line_type,
fixed_occ,
- fixed_mask);
+ fixed_mask,
+ rlci->index);
new_rlc->object_ref = rlc->object_ref;
new_rlc->type = rlc->type;
rlc = new_rlc;
@@ -932,7 +946,8 @@ void ED_lineart_chain_split_angle(LineartRenderBuffer *rb, float angle_threshold
rlci->normal,
rlci->line_type,
rlc->level,
- rlci->transparency_mask);
+ rlci->transparency_mask,
+ rlci->index);
new_rlc->object_ref = rlc->object_ref;
new_rlc->type = rlc->type;
new_rlc->level = rlc->level;
diff --git a/source/blender/editors/lineart/lineart_cpu.c b/source/blender/editors/lineart/lineart_cpu.c
index 2571d678292..dfa1e497b74 100644
--- a/source/blender/editors/lineart/lineart_cpu.c
+++ b/source/blender/editors/lineart/lineart_cpu.c
@@ -1509,7 +1509,7 @@ static void lineart_geometry_object_load(Depsgraph *dg,
FreestyleEdge *fe;
Object *orig_ob;
int CanFindFreestyle = 0;
- int i;
+ size_t i;
Mesh *use_mesh;
int usage = override_usage ? override_usage : ob->lineart.usage;
@@ -1612,6 +1612,7 @@ static void lineart_geometry_object_load(Depsgraph *dg,
for (i = 0; i < bm->totvert; i++) {
v = BM_vert_at_index(bm, i);
lineart_vert_transform(v, i, orv, new_mv, new_mvp);
+ orv[i].index = i;
}
rl = orl;
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index cbe002b0751..d89f4751397 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -376,7 +376,7 @@ static void occlusion_panel_draw(const bContext *C, Panel *panel)
{
PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, NULL);
- uiLayout *layout = panel->layout;
+ uiLayout *layout = panel->layout, *sub;
uiLayoutSetPropSep(layout, true);
@@ -420,13 +420,31 @@ static void occlusion_panel_draw(const bContext *C, Panel *panel)
}
}
+static void vgroup_panel_draw(const bContext *C, Panel *panel)
+{
+ PointerRNA ob_ptr;
+ PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, &ob_ptr);
+
+ uiLayout *layout = panel->layout, *row;
+
+ uiLayoutSetPropSep(layout, true);
+
+ row = uiLayoutRow(layout, true);
+ uiItemR(row, ptr, "source_vertex_group", 0, "Source", ICON_GROUP_VERTEX);
+ uiItemR(row, ptr, "invert_source_vertex_group", UI_ITEM_R_TOGGLE, "", ICON_ARROW_LEFTRIGHT);
+
+ uiItemPointerR(layout, ptr, "vertex_group", &ob_ptr, "vertex_groups", "Target", ICON_NONE);
+}
+
static void panelRegister(ARegionType *region_type)
{
PanelType *panel_type = gpencil_modifier_panel_register(
region_type, eGp
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list