GPv3: Updated Box and Circle, new Semicircle primitives #129068
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#129068
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "CharlieJolly/blender:gp-semicircle"
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 exapnds GP primitives:
Shift - constrains points to 8 way directions.
Ctrl - snaps points to existing control points.
Notes:
For Semicircle:
M - flips direction of arc when extruding. It can also flip segments when cursor is near the control point.
Shift - constrains control points to [-1,1] range.
For Box/Circle:
This can now be rotated correctly.
B - changes mode to toggle quad mode. Corners can be dragged independently.
Shift - constrains control points.
Issues:
* No end caps showing in panelNew box mode:
New circle mode:
Sinister image:
WIP: GPv3: Add Semicircle primitiveto WIP: GPv3: Add Constraints and Semicircle primitiveOverall I like the tool, I do think that the
Filp
/F
keybind should also work after your done extruding, and be flip the currently hovered over point.@ -1635,6 +1636,7 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False)
"builtin.box",
"builtin.circle",
"builtin.polyline",
"builtin.semicircle",
Make sure to also add
"builtin.semicircle"
tobrush_basic_grease_pencil_paint_settings
inproperties_paint_common.py
@ -135,1 +138,4 @@
float2 start_drag_position_2d;
float2 end_drag_position_2d;
bool reverse;
Probably should add a comment explaining that this is for extruding.
Renamed
reverse_extrude
@ -136,0 +139,4 @@
float2 start_drag_position_2d;
float2 end_drag_position_2d;
bool reverse;
bool flip;
Maybe rename
flip
toflipped
? same forreverse
@ -137,2 +145,4 @@
};
/* Copied directly from v3 private function in mesh_fair.cc but using float 2 parameters. */
static float2 calc_circumcenter_2d(const float2 v1, const float2 v2, const float2 v3)
This whole function need to be rewritten to use only float2 work only in 2 dimensions.
@ -308,0 +439,4 @@
}
else {
const float2 center_pos = calc_circumcenter_2d(A, B, CP);
float2 CEN = float2(center_pos.x, center_pos.y);
Why does this exists?
And if it should then it should be
const
@ -308,0 +446,4 @@
float flip = angle_cp >= 0.0f ? 1.0f : -1.0f;
const float dist_cp_mp = math::distance(CP, MP);
const float dist_a_mp = math::distance(A, MP);
flip *= dist_a_mp > dist_cp_mp ? -1.0f : 1.0f;
I think
flip
should be a boolean andconst
on one line.e.i. something like
const bool flip = (angle_cp >= 0.0f) ^ (dist_a_mp > dist_cp_mp);
@ -308,0 +458,4 @@
for (const int i : IndexRange(subdivision + 1)) {
const float t = theta_step * i + angle_offset;
const float x = radius * cos(t);
const float y = radius * sin(t);
Should calulcate both in one line some like
const float xy = radius * float2(cos(t), sin(t));
@ -1070,0 +1402,4 @@
std::reverse(ptd.control_points.begin(), ptd.control_points.end());
std::reverse(ptd.temp_control_points.begin(), ptd.temp_control_points.end());
ptd.reverse = false;
ptd.flip = ptd.flip ? false : true;
ptd.flip = !ptd.flip;
WIP: GPv3: Add Constraints and Semicircle primitiveto WIP: GPv3: Add Constraints, updated Box and Circle, and Semicircle primitiveWIP: GPv3: Add Constraints, updated Box and Circle, and Semicircle primitiveto WIP: GPv3: Updated Box and Circle, new Semicircle primitivesWIP: GPv3: Updated Box and Circle, new Semicircle primitivesto GPv3: Updated Box and Circle, new Semicircle primitivesSome small changes.
@ -136,3 +171,4 @@
ViewOpsData *vod;
};
static float2 calc_circumcenter_2d(float2 a, float2 b, float2 c)
a, b and c should be
const
@ -143,0 +181,4 @@
const float bc1 = ba[1] * dca - ca[1] * dba;
const float bc2 = -ba[0] * dca + ca[0] * dba;
const float cba = ba[1] * ca[0] - ca[1] * ba[0];
const float2 center = float2(a[0] + 0.5f * bc1 / cba, a[1] + 0.5f * bc2 / cba);
I think they should combined.
const float2 center = a + 0.5f * float2(bc1, bc2) / cba;
@ -387,0 +578,4 @@
const float t = i / float(new_points_num);
const float a = t * math::numbers::pi * 2.0f;
const float2 uv = float2(math::sin(a), math::cos(a)) * 0.5f + 0.5f;
float2 pos = corners[0] * (1 - uv[0]) * (1 - uv[1]);
Make sure to use
1.0f
rather then 1 for floats.i.e
float2 pos = corners[0] * (1.0f - uv[0]) * (1.0f - uv[1]);
@ -924,0 +1366,4 @@
if (ptd.type == PrimitiveType::Semicircle) {
const float2 start = point_2d_from_temp_index(ptd, ptd.active_control_point_index + 1);
const float2 end = point_2d_from_temp_index(ptd, ptd.active_control_point_index - 1);
float2 mp = math::midpoint(start, end);
Use
const
if possible.Checkout
From your project repository, check out a new branch and test the changes.