xbapps / xbvr

Tool to organize and stream your VR porn library
344 stars 129 forks source link

[Feature Request] Support for multi-axis scripts #1505

Open tbd-vam opened 1 year ago

tbd-vam commented 1 year ago

It would be great if XBVR handled multiple active funscripts attached to a video. While it's possible to add multiple files at once, only one of them can be selected for export. Scripts for multi-axis devices follow a naming pattern: "[script name].[axis].funscript"

make-it-fun commented 11 months ago

The latest version of MultiFunPlayer (MFP), currently in nightly build status, can play multi-axis scripts with XBVR and HereSphere. This hooks into XBVR and will attempt to load all available axes.

However, XBVR needs modifications to properly handle selecting scripts for multiple axes. Currently, "is_selected_script" is set to "true" for a script that has been selected/clicked in XBVR. As "is_selected_script" currently works like a radio button--which when clicked, sets "is_selected_script" to true for the clicked script and false for all other scripts, the variable should probably be changed to a toggle for each script for multi-axis scripts to be selected properly.

There are scenarios where a user wants to keep one main axis ".funscript" file for a 2D device (e.g. TheHandy or SSR1) and a second ".funscript", along with all of the other axes (".sway.funscript", ".roll.funscript", ".twist.funscript", etc) for a multi-axis device. It is even possible that a user could have multiple versions of a multi-axis script. It seams that the easiest way to implement this is to allow the "is_selected_script" to function as a toggle instead of as a radio button. Software can then detect which scripts have been selected for use.

If you wanted to take the logic a little bit further, it might be best to basically allow for a radio button version for each axis.

E.g.

Even better still would be allowing for the selecting of the active single-axis script as well as multi-axis. In this case you could have "is_selected_single_axis_script" and "is_selected_multi_axis_script" variables. This way, the script player can decide which version of the script to run based on the device being used. In other words, you could use the script designed for 2D access with TheHandy/SSR1, and the mult-axis scripts designed for 3D access w/ the SR6/OSR+ or the pending SLR multi-axis app.

tbd-vam commented 11 months ago

Yes, I'm currently using an MFP plugin we put together on Tempest's discord, which loads scripts from XBVR's HereSphere api. As you said, XBVR could improve upon script selection. By convention, multi-axis scripts have matching names with a suffix for the axis. While a user could theoretically pick differently named scripts for each axis, it's seems to be an unlikely use case. Hence, it should be fine to have a select button for scripts without an axis suffix, which sets is_selected_script to true for all matching scripts.

Allowing both a single and multi-axis script to be selected is probably a very niche use-case, too. Who has both types of devices and needs to automate script selection based on which device is plugged in?

make-it-fun commented 11 months ago

First, let's address the scripts. I agree with you, it may be niche. I'm catering to the most important people in the multi-axis word--the script creators--but I think your idea to automatically select all scripts with the same base name based on a single click may actually be the best implementation. Not sure why I didn't think of it :( No need to individually click all of the scripts for multi-axis, just one click should select 'em all and set "is_selected_script".

So agreed, clicking a multi-axis script should add all scripts with the same base filename.

To put it more clearly, clicking any instance of [script_name]

should set is_selected_script to true for [script_name].funscript and [script_name].*.funscript and should set is_selected_script to false for any scripts not named [script_name].*.funscript and [script_name.funscript].

On to MFP, I was also using the plugin, but if you haven't yet, check the latest nightly MFP build (github actions tab). MFP now has built-in MA support and you can add XBVR as a script library. It does a bit more than the plugin and now loads the selected script(s), and I think properly handles scripts that aren't named the same as the scene (similar to how XBVR doesn't require you to rename your files). Just be sure to enable XBVR and then add your script library to the new "Script Repositories" tab in the second section (see below).

image

Don't forget to check the box for recursive directories.

tbd-vam commented 11 months ago

Thanks for the tip. I can't get it to load any script from xbvr, though. There's nothing helpful in the log, either. Just an info "Trying to match scripts to resource..."

make-it-fun commented 11 months ago

You're using the latest?

https://github.com/Yoooi0/MultiFunPlayer/actions

I haven't verified the default behavior as Yoooi was modifying the code to favor is_selected_script. It's possible that now you may have to select a scene for export (click it, make sure it's green). Unlikely, but possible.

I know you can set log mode to "debug" in the main settings -> general tab.

image

I'd check that first, confirm that you've added all script directories to SCRIPT REPOSITORIES -> SCRIPT LIBRARIES, checked the recursive button, enable the XBVR button, set the proper XBVR URL and port, etc. I can try to help if you wanna hit me up on the XBVR discord.