Skip to content
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

Need a new function to reverse effects #15

Open
colaaaaaa123 opened this issue May 5, 2024 · 2 comments
Open

Need a new function to reverse effects #15

colaaaaaa123 opened this issue May 5, 2024 · 2 comments

Comments

@colaaaaaa123
Copy link

Thank you for sharing your work!
The library has been very helpful to me in converting and scaling fxr files :D Recently, I've been trying to modify 671132.fxr for Sakura Dance in SDT, changing its trajectory from "left to right" to "right to left," but I'm having trouble editing Action 34 (Spawner Rotation)'s rotation speed. I'm not very good at English, so I appreciate it if you could help me with that. Thanks!

@EvenTorset
Copy link
Owner

This may be a bit too specific to add a new function for, but I might still look into what it would take to get something like this working later at some point. Right now, a lot of the actions related to rotation and movement are using an older system in the library because they haven't changed between any of the supported games, and so they didn't need to be updated to the newer system, which the main purpose of is supporting different forms for different games. The newer system also makes editing existing effects a lot easier compared to the old, so I don't really want to add any new functions that interacts with the old system. I'm planning to update all of the actions using the old system soon-ish, but it's not a priority right now.

For this specific case, however, you can change the way it rotates with something like this:

for (const effect of fxr.root.walkEffects()) if (effect instanceof BasicEffect) {
  if (effect.nodeMovement.type === ActionType.NodeSpin) {
    effect.nodeMovement.properties1[2].scale(-1)
  }
}

This goes through all effects in the FXR to check if the node movement action is action 34 (NodeSpin), and if it is, it just flips the sign on the Y rotation speed to make it spin the opposite direction.

@colaaaaaa123
Copy link
Author

Thank you. Without the efforts of tool authors, there would be no mod authors like us. Thank you very much

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

No branches or pull requests

2 participants