GPv3: Preparation for retrieving falloff factor in multi frame editing mode #118108
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#118108
Loading…
Reference in New Issue
No description provided.
Delete Branch "SietseB/blender:gpv3-calculate-multi-frame-falloff"
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?
This PR prepares GPv3 for calculating falloff factors when working in
multi frame editing mode.
The falloff popover is added to the UI.
A
float multi_frame_falloff
is added toMutableDrawingInfo
. Thisis a factor from 0.0 to 1.0f.
A
retrieve_editable_drawings_with_falloff()
is added to the utilityfunctions, which retrieves the falloff factor for each drawing when
multi frame falloff is enabled.
For technical reasons the return type of
retrieve_editable_drawings()
and friends is changed fromArray<MutableDrawingInfo>
toVector<MutableDrawingInfo>
.Array as return type could give undefined results.
GPv3: Preperation for retrieving falloff factor in multi frame editing modeto GPv3: Preparation for retrieving falloff factor in multi frame editing mode@blender-bot build
Some cleanup comments.
@ -7993,14 +8001,13 @@ class VIEW3D_PT_gpencil_multi_frame(Panel):
layout = self.layout
tool_settings = context.tool_settings
gpd = context.gpencil_data
Hm this would change the old grease pencil panel. It's probably better to create a new
VIEW3D_PT_grease_pencil_multi_frame
panel to seperate the two.@ -187,0 +191,4 @@
const int max_frame,
const CurveMapping *falloff_curve)
{
float falloff, frame_factor = 0.5f;
In the new style guide (https://developer.blender.org/docs/handbook/guidelines/c_cpp/#variable-scope) we want to avoid variables with a larger scope than they need.
@ -187,0 +199,4 @@
/* Frame right of the center frame. */
if (frame_number > center_frame) {
frame_factor = 0.5f * float(center_frame - min_frame) / (frame_number - min_frame);
->
const float frame_factor
@ -187,0 +200,4 @@
/* Frame right of the center frame. */
if (frame_number > center_frame) {
frame_factor = 0.5f * float(center_frame - min_frame) / (frame_number - min_frame);
falloff = BKE_curvemapping_evaluateF(falloff_curve, 0, frame_factor);
Instead of assigning to
falloff
, justreturn
here.@ -187,0 +203,4 @@
falloff = BKE_curvemapping_evaluateF(falloff_curve, 0, frame_factor);
}
/* Frame left of the center frame. */
else if (frame_number < center_frame) {
This can be just an
if
when we return above.@ -187,0 +208,4 @@
falloff = BKE_curvemapping_evaluateF(falloff_curve, 0, frame_factor + 0.5f);
}
/* Frame at center. */
else {
This
else
just becomes areturn
.Code looks good to me now, thanks :)
@blender-bot build