GPv3: Outline modifier #118911
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#118911
Loading…
Reference in New Issue
No description provided.
Delete Branch "LukasTonne/blender:gp3-outline-modifier"
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?
Port of GPv2 outline modifier.
TODO
OutlineGpencilModifierData::thickness
.keep_shape
option (offset perimeter toward the curve by 1 radius)outline_material
to the resulting strokes.OutlineGpencilModifierData::object
. This object is not used for anything else.(Not the best feature, but we'll keep it for GPv2 compatibility)
OutlineGpencilModifierData::sample_length
.For resampling there is
geometry::resample_to_length
now.WIP: GPv3: Outline modifierto GPv3: Outline modifier@blender-bot build
Wow, that's a solid chunk of work! From skimming the code, I'm guessing it's much faster than the original :)
@ -0,0 +121,4 @@
namespace array_utils {
template<typename T>
inline void rotate_group_to_group(const OffsetIndices<int> src_offsets,
I'm concerned about the increase in binary size as we add more uses of
convert_to_static_type
and more attribute types. Especially for something like a legacy modifier where performance isn't the greatest concern, and where performance will probably be vastly better than the old modifier anyway, it doesn't feel worth it.The alternative would be building the full
Array<int>
index map from dst to src, then usingarray_utils::gather
instead of this template.I can do it with
gather_attributes
, but unfortunately this does not work for in-place rotation of buffers: one half of the buffer is moved first, overwriting part of the other half before it gets copied. Therotate
function takes care to swap elements to allow in-place rotation. I'll have to create a full copy of the curves geometry, which is probably acceptable in this case because it's a somewhat clumsy legacy feature that isn't expected to be very performant.@ -0,0 +674,4 @@
using bke::greasepencil::Layer;
using modifier::greasepencil::LayerDrawingInfo;
auto *omd = reinterpret_cast<GreasePencilOutlineModifierData *>(md);
const auto *
andconst GreasePencilOutlineModifierData
@ -0,0 +707,4 @@
PointerRNA ob_ptr;
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr);
// auto *omd = static_cast<GreasePencilOutlineModifierData *>(ptr->data);
Unused
Tested, generally works great, but consistently crashes when drawing with modifier on with no existing strokes. This is a case for every frame.
If modifier is set to Off, stroke is drawn and then turned On, you can continue drawing without issues.
@frogstomp @LukasTonne I suspect that the case where a stroke has a single point is not properly handled.
Looks like
gather_attributes
does not like empty domains, it ends up trying to write to the last entry in an empty offsets array. This should probably get a lower-level fix to makegather_attributes
more robust, but i'll add an early exit to avoid the case.Start and end caps currently "flicker" while drawing or changing modifier settings, like the direction flips randomly.
EDIT: fixed.
@blender-bot build
@blender-bot build
@blender-bot build
@blender-bot build
Previously reported bugs are now fixed, found one more.
Crash with flat caps, steps to reproduce:
Got some cleanup comments.
@ -0,0 +108,4 @@
ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Grease Pencil Outline Modifier");
}
static bke::CurvesGeometry reorder_cyclic_curve_points(const bke::CurvesGeometry &src_curves,
I can't quite decipher what this function does. Would be helpful if there was some comment at the top.
@ -0,0 +128,4 @@
return;
}
const int shift_raw = curve_offsets[curve_i];
const int shift = shift_raw >= 0 ? shift_raw % points.size() :
And what this shift is.
@ -0,0 +153,4 @@
static int find_closest_point(const Span<float3> positions, const float3 &target)
{
if (positions.is_empty()) {
return -1;
I think this can just return 0, so that we can directly use the index instead of the
closest_i >= 0 ? closest_i : 0;
.@blender-bot build
@blender-bot build
@ -0,0 +152,4 @@
* source indices are not ordered. */
bke::CurvesGeometry dst_curves(src_curves);
bke::MutableAttributeAccessor dst_attributes = dst_curves.attributes_for_write();
bke::gather_attributes(src_attributes, bke::AttrDomain::Point, {}, {}, indices, dst_attributes);
Looks like this is losing curve attributes?
Sorry, never mind, I read this wrong!
Curves are copied in their entirety first, then point attributes get rewritten:
bke::CurvesGeometry dst_curves(src_curves)
. It's fine, couldn't find anything wrong in testing either, custom attributes from a preceding GN modifier get propagated correctly on curve and point domains.