Skip to content

Spacing type radio button for repeat and circular repeat node #2674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

Ripper53
Copy link
Contributor

@Ripper53 Ripper53 commented May 26, 2025

Closes #2551

  1. Added Spacing radio parameter to Repeat node, containing Span, Envelope, Pitch, and Gap options for spacing. See issue for how they must be spaced.
  2. Added Angle Pitch float parameter and Spacing radio parameter for Circular Repeat node. The Span option uses the calculations which already existed, the Pitch option rotates the next instance around the radius of the imaginary circle according to the Angle Pitch parameter and places the shape there.
  3. Added a unit macro attribute. Given string parameter is displayed as a unit type for the parameter.
  4. Added a step macro attribute. Given integer parameter is used as the step value for the parameter (ex. the arrow buttons on a number input increment/decrement by step amount).
  5. Added a display_decimal_places macro attribute. Given positive integer parameter is used to know how many decimal places to display for the number input if they are not 0.

Usage for macros:

#[unit(" px")]
#[step(2.)]
#[display_decimal_places(1)]
num: f64

@Ripper53 Ripper53 marked this pull request as ready for review May 26, 2025 19:36
@Ripper53 Ripper53 marked this pull request as draft May 30, 2025 02:57
@Ripper53 Ripper53 marked this pull request as ready for review May 30, 2025 04:14
@Keavon
Copy link
Member

Keavon commented Jun 9, 2025

!build

Copy link

github-actions bot commented Jun 9, 2025

📦 Build Complete for bb5b448
https://21f936f1.graphite.pages.dev

@Keavon
Copy link
Member

Keavon commented Jun 9, 2025

Finally got to code review, sorry it's taken a while. I was busy doing a sizable refactor to how the vector nodes handle their repeat transforms. This affected the two nodes you've worked on here, so I just synced up your branch and resolved the merge conflicts. However, I commented out the Circular Repeat changes which require a bit more thought to get working, and I hope you can take it from here after the following feedback which pertains to my observations before I synced with master using the build link, as you left the code last, in the comment above.

Repeat node:

  • It appears that you have altered the behavior for now the Angle parameter works. Instead of twisting the whole repeated array of shapes, it now goes linearly but spins each shape. This is not desirable, the old behavior is.
  • Please order the radio buttons as: Envelope, Span, Pitch, Gap.
  • "Gap" mode causes an offset in the Y axis even if I set "Direction" to purely an X value, with Y at 0. I believe we discussed this topic in Discord, unless I'm confusing it with a different mode.

Circular Repeat node:

  • Let's fix this up after the commented out parts before I can spend the time to write feedback on it yet.

Other notes:

  • Please break out the code dealing with the new parameter widget attributes and submit those in a separate PR. I'd like to get those merged independently and sooner. It is easier to review the two bits separately.
  • Please take a moment to leave a comment in this PR's linked issue, Spacing type radio button for repeat and circular repeat node #2674, so that I can assign that issue to you for tracking purposes. I don't have permission to assign it until you've commented in the thread.

Thank you, and it's nice to see this coming along!

@Keavon Keavon marked this pull request as draft June 9, 2025 02:57
@Ripper53
Copy link
Contributor Author

Macros split into their own PR: #2706

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add options to the 'Repeat' node for the spacing with envelope/span/pitch/gap
2 participants