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

[Non-Urgent, Feature Request-ish] Is there a way to use macro properties in mathematical expressions? #1287

Open
Patrickode opened this issue Dec 29, 2024 · 2 comments

Comments

@Patrickode
Copy link

Patrickode commented Dec 29, 2024

Background

Without this plugin, the "crossfade" option of a stinger transition's "Audio Fade Style" isn't actually a fade, it's sharp and abrupt, A or B. Therefore, I'm making my background audio fade in/out myself, using Move Transition filters and Advanced Scene Switcher. I'm using the former to fade the audio via a gain filter, rather than manipulating the volume directly with Advanced Scene Switcher, allowing me to set the "default" volume using the audio mixer's sliders and nothing more.

My goal is to take the duration of the fade from the move filter (which I can do by using an ignore entry "Settings Value Matches" condition and then accessing that macro property), subtract that from the transition point which I have stored as a variable, and then delay for that amount of time (to let the stinger transition play out a bit).

Solutions?

I can use macro properties in math expressions indirectly by setting a variable equal to a macro property, and then using said variable in the expression. Since no two scenes should be fading out at the same time, I can just make a "cache" variable and have every macro use that, but allocating variables I don't need to does make my programmer brain a little bit itchy, Since using variables in a math expression requires the variable's name in a ${ }, I'm wondering if it's even possible to put a macro property in there, since there seems to be no method of knowing its name. (If there is a way, perhaps that could be a wiki page?)

Another possible way this might be "solved" is if one could do simple arithmetic on a variable when using it; mathematical expressions are currently only available when setting, as opposed to using. I understand if that's not possible given how things are set up, but also, in this particular use case, that probably wouldn't be enough, since I need to convert the macro property I'm getting from milliseconds to seconds.

@WarmUpTill
Copy link
Owner

Thanks for your suggestion!
At the moment this is not possible, so you have not missed anything :)

I am not sure how I would support directly using macro properties in those input fields.
I will try to think about it.

@Destroy666x
Copy link
Contributor

Destroy666x commented Jan 3, 2025

I'd do it like this: ${this}, ${self}, ${macro} or whatever var that holds info about macro, including properties accessed e.g. as ${this.userName}. Whenever you update macro property, also update the local macro var. 3 problems with that though:

  • unique macro property names are not shown to the user
  • ofc a bit of performance impact compared to now, shouldn't be too bad though?
  • doesn't really fit with how current vars work

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

3 participants