Skip to content

Merge origin/main into origin/feat/2.5#1026

Merged
yiiqii merged 14 commits into
feat/2.5from
main
Jun 6, 2025
Merged

Merge origin/main into origin/feat/2.5#1026
yiiqii merged 14 commits into
feat/2.5from
main

Conversation

@yiiqii

@yiiqii yiiqii commented Jun 6, 2025

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes

    • Resolved issues with invalid particle hit testing and 3D mesh components modifying original data.
    • Fixed problems related to spine and particle mask handling.
  • New Features

    • Added stencil mask drawing support for particle systems and spine components.
  • Chores

    • Updated package versions to 2.4.6 across multiple packages.
    • Updated changelog files with details for versions 2.4.5 and 2.4.6.
    • Changed default fallback Player version in tests to 2.4.5.

yiiqii and others added 14 commits May 12, 2025 19:28
Merge origin/main into origin/dev
Merge origin/main into origin/dev
Merge origin/main into origin/dev
Merge origin/main into origin/dev
* fix: spine and particle mask

* style: import

---------

Co-authored-by: yiiqii <yfj5tzl2005@sina.com>
fix: 3d mesh component modifies the original data
fix: particle hitTest is invalid
Merge origin/dev into origin/main
@yiiqii
yiiqii requested a review from wumaolinmaoan June 6, 2025 07:07
@coderabbitai

coderabbitai Bot commented Jun 6, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This update adds two new patch releases (2.4.5 and 2.4.6) to the changelogs and updates package versions across multiple packages. It modifies the Maskable interface and implements its drawStencilMask method in both ParticleSystem and SpineComponent. The fromData method in ModelMeshComponent is revised to avoid mutating the original input data.

Changes

File(s) Summary
CHANGELOG.md, CHANGELOG-zh_CN.md Added entries for versions 2.4.5 and 2.4.6 with details on fixes.
packages/effects-core/package.json
packages/effects-helper/package.json
packages/effects-threejs/package.json
packages/effects-webgl/package.json
packages/effects/package.json
plugin-packages/alipay-downgrade/package.json
plugin-packages/downgrade/package.json
plugin-packages/editor-gizmo/package.json
plugin-packages/model/package.json
plugin-packages/multimedia/package.json
plugin-packages/orientation-transformer/package.json
plugin-packages/rich-text/package.json
plugin-packages/spine/package.json
plugin-packages/stats/package.json
Bumped package versions from 2.4.4 to 2.4.6.
packages/effects-core/src/material/types.ts Changed Maskable interface: drawStencilMask is now a method signature instead of a function property.
packages/effects-core/src/plugins/particle/particle-system.ts ParticleSystem now implements Maskable and adds drawStencilMask; minor control flow simplification.
plugin-packages/spine/src/spine-component.ts SpineComponent now implements Maskable and adds drawStencilMask.
plugin-packages/model/src/plugin/model-item.ts fromData in ModelMeshComponent now clones input data instead of mutating it directly.
web-packages/test/case/src/common/test-controller.ts Updated default old Player version from '2.2.2' to '2.4.5'.

Sequence Diagram(s)

sequenceDiagram
  participant Renderer
  participant ParticleSystem
  participant SpineComponent

  Note over ParticleSystem,SpineComponent: Both implement Maskable interface

  Renderer->>ParticleSystem: drawStencilMask(renderer)
  ParticleSystem->>ParticleSystem: Save colorMask states
  ParticleSystem->>ParticleSystem: Set colorMask to false
  ParticleSystem->>Renderer: Render meshes (stencil mask)
  ParticleSystem->>ParticleSystem: Restore colorMask states

  Renderer->>SpineComponent: drawStencilMask(renderer)
  SpineComponent->>SpineComponent: Check active/content
  SpineComponent->>SpineComponent: Save colorMask states
  SpineComponent->>SpineComponent: Set colorMask to false
  SpineComponent->>Renderer: Render meshGroups (stencil mask)
  SpineComponent->>SpineComponent: Restore colorMask states
Loading

Possibly related PRs

Suggested reviewers

  • wumaolinmaoan
  • RGCHN

Poem

In the meadow of code, new patches bloom bright,
Maskable rabbits now hop in the light.
Stencil masks drawn with careful delight,
Old data untouched, all bugs out of sight.
With version bumps high, the changelogs recite—
"Hop forward, dear friends, for the future is right!"
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
CHANGELOG-zh_CN.md (1)

11-17: Approve changelog entry for 2.4.6
Accurately documents the new patch release and its fixes.

Nitpick: capitalize "3D"
Consider updating "3d mesh component" to "3D mesh component" for consistency.

🧰 Tools
🪛 LanguageTool

[grammar] ~16-~16: Did you mean “3D”(= three-dimensional) or “3rd” (= third)?
Context: ...untime/pull/1023) @wumaolinmaoan - Fix: 3d mesh component modifies the original da...

(THREE_D)

CHANGELOG.md (1)

10-16: Approve changelog entry for 2.4.6
Lists the patch release date and fixes accurately.

Nitpick: capitalize "3D"
Change "3d mesh component" to "3D mesh component" in the fix description.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8d0ce41 and d0070a8.

📒 Files selected for processing (21)
  • CHANGELOG-zh_CN.md (1 hunks)
  • CHANGELOG.md (1 hunks)
  • packages/effects-core/package.json (1 hunks)
  • packages/effects-core/src/material/types.ts (1 hunks)
  • packages/effects-core/src/plugins/particle/particle-system.ts (3 hunks)
  • packages/effects-helper/package.json (1 hunks)
  • packages/effects-threejs/package.json (1 hunks)
  • packages/effects-webgl/package.json (1 hunks)
  • packages/effects/package.json (1 hunks)
  • plugin-packages/alipay-downgrade/package.json (1 hunks)
  • plugin-packages/downgrade/package.json (1 hunks)
  • plugin-packages/editor-gizmo/package.json (1 hunks)
  • plugin-packages/model/package.json (1 hunks)
  • plugin-packages/model/src/plugin/model-item.ts (1 hunks)
  • plugin-packages/multimedia/package.json (1 hunks)
  • plugin-packages/orientation-transformer/package.json (1 hunks)
  • plugin-packages/rich-text/package.json (1 hunks)
  • plugin-packages/spine/package.json (1 hunks)
  • plugin-packages/spine/src/spine-component.ts (3 hunks)
  • plugin-packages/stats/package.json (1 hunks)
  • web-packages/test/case/src/common/test-controller.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
packages/effects-core/src/material/types.ts (1)
packages/effects-core/src/render/renderer.ts (1)
  • Renderer (13-146)
plugin-packages/spine/src/spine-component.ts (3)
packages/effects-core/src/components/renderer-component.ts (3)
  • RendererComponent (10-45)
  • material (25-27)
  • material (28-34)
packages/effects-core/src/material/types.ts (1)
  • Maskable (98-100)
packages/effects-core/src/render/renderer.ts (1)
  • Renderer (13-146)
🪛 LanguageTool
CHANGELOG-zh_CN.md

[grammar] ~16-~16: Did you mean “3D”(= three-dimensional) or “3rd” (= third)?
Context: ...untime/pull/1023) @wumaolinmaoan - Fix: 3d mesh component modifies the original da...

(THREE_D)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (24)
packages/effects/package.json (1)

3-3: Version bumped to 2.4.6
Aligns this package with the coordinated 2.4.6 release documented in the changelogs.

plugin-packages/stats/package.json (1)

3-3: Version bumped to 2.4.6
Consistent with the synchronized release across all effects plugins and matches the changelog entry.

packages/effects-core/package.json (1)

3-3: Version bumped to 2.4.6
Correctly updates the core package to the new release version; changelog reflects these fixes.

packages/effects-helper/package.json (1)

3-3: Version bumped to 2.4.6
Helper package now matches the coordinated 2.4.6 release lineup.

plugin-packages/rich-text/package.json (1)

3-3: Version bumped to 2.4.6
Rich-text plugin version aligns with the overall 2.4.6 release across the monorepo.

plugin-packages/orientation-transformer/package.json (1)

3-3: Version bumped to 2.4.6
The update aligns this plugin with the coordinated 2.4.6 release across all packages.

packages/effects-webgl/package.json (1)

3-3: Version bumped to 2.4.6
This version update matches the cross-package release—no other changes detected.

packages/effects-threejs/package.json (1)

3-3: Version bumped to 2.4.6
Consistent with the 2.4.6 release cycle; dependencies remain unchanged.

plugin-packages/editor-gizmo/package.json (1)

3-3: Version bumped to 2.4.6
Aligns the editor-gizmo plugin with the overall release version.

plugin-packages/downgrade/package.json (1)

3-3: Version bumped to 2.4.6
The downgrade plugin version is in sync with the rest of the ecosystem.

plugin-packages/alipay-downgrade/package.json (1)

3-3: Version update looks good.

The version bump to 2.4.6 is consistent with the coordinated release across all packages.

plugin-packages/model/src/plugin/model-item.ts (1)

122-134: Excellent fix to prevent data mutation.

The updated fromData method correctly addresses the issue where the original input data was being modified. Creating a new object with spread syntax and properly resolving references ensures the original data remains immutable while maintaining the same functionality.

This is a good defensive programming practice that prevents unexpected side effects.

plugin-packages/model/package.json (1)

3-3: Version update is consistent with the release.

The version bump to 2.4.6 aligns with the functional fixes implemented in this package.

plugin-packages/spine/package.json (1)

3-3: Version update aligns with the coordinated release.

The version bump to 2.4.6 is consistent with the other packages and the stencil mask improvements mentioned in the release notes.

plugin-packages/multimedia/package.json (1)

3-3: Approve version bump to 2.4.6
Aligns with the updated patch releases across related packages.

web-packages/test/case/src/common/test-controller.ts (1)

7-7: Verify fallback oldVersion alignment
The default oldVersion is set to '2.4.5'. Should this be bumped to '2.4.6' to reflect the latest patch release?

CHANGELOG-zh_CN.md (1)

18-23: Approve changelog entry for 2.4.5
Correctly adds the 2.4.5 release details above the existing entries.

CHANGELOG.md (1)

17-22: Approve changelog entry for 2.4.5
Accurately inserts the 2.4.5 fixes at the top of the changelog.

packages/effects-core/src/material/types.ts (1)

99-99: LGTM! Interface method signature improvement.

The change from a function property to a method signature is more conventional for TypeScript interfaces and aligns better with the implementations in the other files.

plugin-packages/spine/src/spine-component.ts (3)

4-4: LGTM! Proper import addition.

Correctly added Maskable to the imports to support the interface implementation.


60-60: LGTM! Interface implementation added.

The SpineComponent now properly implements the Maskable interface, enabling it to participate in stencil masking operations.


201-224: LGTM! Correct stencil masking implementation.

The drawStencilMask method correctly implements stencil masking by:

  1. Validating component state (isActiveAndEnabled and content existence)
  2. Temporarily disabling color mask on all materials to prevent color buffer writes
  3. Rendering content to write only to the stencil buffer
  4. Restoring original color mask states

This follows the proper pattern for stencil masking operations.

packages/effects-core/src/plugins/particle/particle-system.ts (2)

156-156: LGTM! Interface implementation added.

The ParticleSystem now properly implements the Maskable interface, enabling particle systems to participate in stencil masking operations.


502-524: LGTM! Consistent stencil masking implementation.

The drawStencilMask method correctly implements stencil masking following the same pattern as SpineComponent:

  1. Validates component state with isActiveAndEnabled check
  2. Temporarily disables color mask on all renderer mesh materials
  3. Renders meshes individually to write only to the stencil buffer
  4. Restores original color mask states using proper indexing

The implementation is consistent and handles particle system stencil masking correctly.

@yiiqii
yiiqii merged commit 582ebbe into feat/2.5 Jun 6, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Oct 17, 2025
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.

2 participants