GPv3: Smooth modifier #116975
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#116975
Loading…
Reference in New Issue
No description provided.
Delete Branch "ChengduLittleA/blender:gp3-mod-smooth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Smooth modifier ported to Grease Pencil 3.0
Used the common stroke filtering functions and panel UI.
Exposed
smooth_curve_attribute()
fromgrease_pencil_edit.cc
to achieve the smoothing effect. It will not be the exact same result as the old algorithm.@ -0,0 +134,4 @@
}
IndexMaskMemory memory;
const IndexMask strokes = ed::greasepencil::retrieve_editable_and_selected_strokes(
I might be wrong here but
retrieve_editable_strokes
looks more correct here.Assuming modifier is expected to work on "each editable" curve and not only the "selected" curve.
Ah I guess so... I think @LukasTonne is working on some common functions in #116946 which includes
get_drawings_for_write()
. Which makes more sense. This one at the moment is mostly a placeholder for now.WIP: GPv3: Smooth modifierto GPv3: Smooth modifierI tried the modifier and overall it seems to work fine, the only thing I found is that filtering by Layer doesn't work
Ah indeed. I just found out that
get_filtered_stroke_mask
only filters material, had to useget_filtered_layer_mask
together. Will fix these.Some more cleanup comments
@ -1129,12 +1129,12 @@ static int add_material_from_template(Main &bmain, Object &ob, const ColorTempla
return index;
}
static bke::CurvesGeometry create_drawing_data(const Span<float3> positions,
This shouldn't be in this PR.
@ -0,0 +109,4 @@
const bool smooth_radius = (mmd.flag & MOD_GREASE_PENCIL_SMOOTH_MOD_THICKNESS);
const bool smooth_opacity = (mmd.flag & MOD_GREASE_PENCIL_SMOOTH_MOD_STRENGTH);
if (iterations <= 0 || influence <= 0) {
influence <= 0.0f
@ -0,0 +181,4 @@
}
if (changed) {
drawing.tag_positions_changed();
This can just be put after
positions.finish();
. And you can remove thechanged
variable.@ -0,0 +194,4 @@
if (!geometry_set->has_grease_pencil()) {
return;
}
GreasePencil *grease_pencil = geometry_set->get_grease_pencil_for_write();
Use a reference here
Some more comments
@ -7666,7 +7673,6 @@ static void rna_def_modifier_grease_pencil_opacity(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
Add this line back
@ -7683,3 +7689,3 @@
rna_def_modifier_grease_pencil_layer_filter(srna);
rna_def_modifier_grease_pencil_material_filter(
srna, "rna_GreasePencilOpacityModifier_material_filter_set");
srna, "rna_GreasePencilSmoothModifier_material_filter_set");
This looks wrong, maybe a search/replace error?
yes, name changed in wrong function
@ -7686,2 +7691,3 @@
srna, "rna_GreasePencilSmoothModifier_material_filter_set");
rna_def_modifier_grease_pencil_vertex_group(
srna, "rna_GreasePencilOpacityModifier_vertex_group_name_set");
srna, "rna_GreasePencilSmoothModifier_vertex_group_name_set");
Same as above
@ -17,6 +17,8 @@ set(INC
../render
../windowmanager
../../../intern/eigen
../gpencil_modifiers_legacy
I think these two can be removed.
@ -0,0 +163,4 @@
false,
opacities.span);
opacities.finish();
drawing.tag_positions_changed();
No need to tag the positions, when we just changed the opacities.
@ -0,0 +177,4 @@
false,
radii.span);
radii.finish();
drawing.tag_positions_changed();
Same as above.
@ -0,0 +256,4 @@
/*struct_size*/ sizeof(GreasePencilSmoothModifierData),
/*srna*/ &RNA_GreasePencilSmoothModifier,
/*type*/ ModifierTypeType::OnlyDeform,
/*flags*/ eModifierTypeFlag_AcceptsGreasePencil,
This should be
It might be beneficial to include a (brief) explanation of how this differs -- in preparation of users reporting this, so we can distinguish expected vs. unexpected differences
@lichtwerk We will have to test it to see if there are any differences. I don't expect it to be different actually. The algorithm should be the same.
Otherwise it should be documented in #114419
@blender-bot build
Found one unused variable. Otherwise looks correct to me :)
@ -0,0 +117,4 @@
return;
}
bool changed = false;
this is unused :)
Buildbot found some formatting problem.
make format
will fix them: https://builder.blender.org/admin/#/builders/210/builds/346Cleaned up like what it's shown in #117281.
@blender-bot build
Looks good to me!