Skip to content

feat: Spine 升级和缩放规则修改 #367

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

Merged
merged 5 commits into from
May 23, 2024
Merged

Conversation

RGCHN
Copy link
Contributor

@RGCHN RGCHN commented May 21, 2024

  1. 升级 spine-core 至 4.2.43
  2. 修改 spine 导入时的像素转换规则

Summary by CodeRabbit

  • New Features

    • Added new asset entities (cloudPot, snowglobe) with their corresponding URLs.
  • Improvements

    • Updated URLs for various assets in the celestial entity.
    • Enhanced SpineVFXItem with a new resize rule for better control over size calculations.
  • Bug Fixes

    • Adjusted assignment and value changes in the api-test demo.
  • Dependencies

    • Updated @galacean/effects-specification to version 1.3.0-alpha.0.
    • Updated @esotericsoftware/spine-core to version 4.2.43.

Copy link
Contributor

coderabbitai bot commented May 21, 2024

Important

Review Skipped

Review was skipped due to path filters

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !pnpm-lock.yaml

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The updates include dependency version changes for effects-core and spine packages, modifications to asset URLs in the spine demo, and adjustments to code logic and properties in various TypeScript files. These changes enhance compatibility, update asset references, and refine functionality, particularly in handling size calculations and asset loading.

Changes

File Path Change Summary
packages/effects-core/package.json Updated dependency on @galacean/effects-specification from 1.2.0 to 1.3.0-alpha.0.
plugin-packages/spine/package.json Updated dependency on @esotericsoftware/spine-core from 4.2.35 to 4.2.43.
plugin-packages/spine/demo/src/api-test.ts Changed files assignment to premultiply and updated 'startSize' value from 3 to 2.
plugin-packages/spine/demo/src/files.ts Updated asset URLs for celestial, added cloudPot and snowglobe entities with respective URLs.
plugin-packages/spine/demo/src/multi-comp.ts Removed three URLs from jsonList and added a comment about data compatibility.
plugin-packages/spine/src/spine-vfx-item.ts Added resizeRule property and modified resize method to use this rule for calculating scaleFactor.

🐰

In code's dance, dependencies rise,
With assets new, and URLs wise.
Sizes shift, rules now align,
Spine's updates, a sign so fine.
Embrace the change, let progress flow,
In this garden, let features grow.

🌸


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 33a1d52 and 4e577ef.
Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !pnpm-lock.yaml
Files selected for processing (6)
  • packages/effects-core/package.json (1 hunks)
  • plugin-packages/spine/demo/src/api-test.ts (2 hunks)
  • plugin-packages/spine/demo/src/files.ts (2 hunks)
  • plugin-packages/spine/demo/src/multi-comp.ts (1 hunks)
  • plugin-packages/spine/package.json (1 hunks)
  • plugin-packages/spine/src/spine-vfx-item.ts (3 hunks)
Files skipped from review due to trivial changes (3)
  • packages/effects-core/package.json
  • plugin-packages/spine/demo/src/multi-comp.ts
  • plugin-packages/spine/package.json
Additional comments not posted (5)
plugin-packages/spine/demo/src/api-test.ts (2)

257-257: Reduction in initial animation size approved.


47-47: Change in texture handling approved.

Verification successful

The change from direct to premultiply for the files variable appears to be correctly integrated in both api-test.ts and simple.ts. The logic checks for the files variable being either premultiply or direct and updates the filetype text accordingly. Additionally, the files variable is used to load and handle file data properly.

  • plugin-packages/spine/demo/src/api-test.ts

    • The files variable is set to premultiply.
    • Conditional checks and file handling logic are in place to manage the premultiply setting.
  • plugin-packages/spine/demo/src/simple.ts

    • The files variable is initially set to direct.
    • Conditional checks and file handling logic are in place to manage both premultiply and direct settings.

No issues were found with the integration of the premultiply setting.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the change from `direct` to `premultiply` integrates well with other parts of the system.

# Test: Search for usage of `files` variable. Expect: Proper handling of the `premultiply` setting.
rg --type python $'files'

Length of output: 55



Script:

#!/bin/bash
# Description: Verify that the change from `direct` to `premultiply` integrates well with other parts of the system.

# Test: Search for usage of `files` variable. Expect: Proper handling of the `premultiply` setting.
rg --type typescript 'files'

Length of output: 63



Script:

#!/bin/bash
# Description: Verify that the change from `direct` to `premultiply` integrates well with other parts of the system.

# Test: Search for usage of `files` variable. Expect: Proper handling of the `premultiply` setting.
rg --type ts 'files'

Length of output: 1730



Script:

#!/bin/bash
# Extract relevant code segments for detailed review.

# Extract code segments from api-test.ts
rg --type ts --context 5 'files' plugin-packages/spine/demo/src/api-test.ts

# Extract code segments from simple.ts
rg --type ts --context 5 'files' plugin-packages/spine/demo/src/simple.ts

Length of output: 2385

plugin-packages/spine/src/spine-vfx-item.ts (1)

Line range hint 35-426: Addition of conditional scaling logic approved.

Verification successful

The resizeRule property is correctly set from spineOptions.resizeRule, and the resize method applies the scaling logic based on this property. The implementation appears to be correct.

  • resizeRule is assigned in plugin-packages/spine/src/spine-vfx-item.ts.
  • The resize method is called within the same file, ensuring the scaling logic is applied.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the new scaling logic correctly applies in different scenarios.

# Test: Check the scaling behavior under different `resizeRule` conditions.
echo "Please manually verify the scaling behavior under different conditions specified by `resizeRule`."

Length of output: 272



Script:

#!/bin/bash
# Search for assignments to the `resizeRule` property
rg --pcre2 '\bresizeRule\s*=\s*' 

# Search for calls to the `resize` method
rg --pcre2 '\bresize\s*\('

Length of output: 2656

plugin-packages/spine/demo/src/files.ts (2)

110-117: Update to celestial entity URLs approved.


196-213: Addition of new entities cloudPot and snowglobe approved.

@yiiqii yiiqii changed the base branch from dev to feat/1.5 May 23, 2024 05:58
@yiiqii yiiqii merged commit 28ae39f into feat/1.5 May 23, 2024
@yiiqii yiiqii deleted the feat/upgrade-spine branch May 23, 2024 07:35
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