Skip to content

Add more Lua functions for TAStudio markers #4335

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

YoshiRulz
Copy link
Member

@YoshiRulz YoshiRulz commented May 27, 2025

Based on #4272 by @c7fab (thank you, and please let us know if this is insufficient for your use case).

@YoshiRulz YoshiRulz added this to the 2.10.1 milestone May 27, 2025
@YoshiRulz YoshiRulz requested a review from vadosnaprimer May 27, 2025 14:37
@YoshiRulz YoshiRulz linked an issue May 27, 2025 that may be closed by this pull request
@c7fab
Copy link
Contributor

c7fab commented Jun 3, 2025

At first glance it looks those functions can do everything that was possible with my PR.

@SuuperW
Copy link
Contributor

SuuperW commented Jun 28, 2025

I think it would be good to handle the case where the specified branch doesn't exist. So that tastudio.getmarker(0, 500) doesn't throw an exception. Maybe print a message saying no such branch exists, or maybe just return nil like when there is no marker on the given frame.

@SuuperW
Copy link
Contributor

SuuperW commented Jun 28, 2025

Actually, branches have an Id that can be obtained with tastudio.getbranches and this is used instead of an index in tastudio.getbranchinput. This seems like it could be useful as branch indexes can change by deleting one. Should this new function use the Id too?

Existing function tastudio.setbranchtext uses an index, not an id. So it's already not consistent in the API.

@vadosnaprimer
Copy link
Contributor

Please provide a summary for dummmies, I don't have the capacity to remember how this is different from all the previous variants and I can't review it by looking at the technical side.

@YoshiRulz
Copy link
Member Author

YoshiRulz commented Jul 4, 2025

diff between force push
current API proposal
I implemented Suuper's suggestions of taking branch UUIDs as params and throwing less.
And to encourage people to use UUIDs more, I've also added get_branch_index_by_id so they can be used with existing index-based functions.

@SuuperW
Copy link
Contributor

SuuperW commented Jul 4, 2025

throwing less

I don't really like the idea of using the current marker set when the given branch ID doesn't exist.

I also think that the documentation given to users should specify what happens when the input is invalid.

@vadosnaprimer vadosnaprimer removed their request for review July 4, 2025 19:46
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.

TAStudio branches/markers lua functions
4 participants