Anyone know of a Script Maker App for Mac OSX?

oh yea, I have the wine app, I’ll give it a shot. hopefully not too glitchy. Thanks!

Let me know if it works I’m planning to maybe move to a mac

Unfortunately I’ve not had much luck with Wine/CrossOver and most of the common Windows scripting tools and players. HandyControl seems to maybe work, but JoyFunScripter crashes immediately and ScriptPlayer crashes straight away, too. A Windows Virtual Machine would be best but that’s complicated as Apple’s moving all of its Macs to Apple Silicon (arm) CPUs so x86 VMs aren’t an option.

The good news is: OFS does run on macOS! It even works with Bluetooth controllers, I just paired my XBox Wireless Controller and it records fine.

There’s bad news though: currently you have to build it yourself from the source code. The compile/build process is quite tricky and currently puts some data files (fonts, lua scripts, etc.) in the wrong place—into OpenFunscripter.app/Contents/MacOS/data/ instead of OpenFunscripter.app/Contents/Resources/data/—so the app crashes when you run it unless/until you manually move that data folder into the right place. It’ll need a pull request on GitHub to the CMakeLists.txt file to fix this, I’ll see what I can do.

The other big sticking point is that building it natively on an Apple Silicon Mac won’t work, you have to force the architecture to emulate an Intel processor when compiling as some of the libraries OFS uses just won’t compile for arm. This can get messy as you’ll need to install the Homebrew package manager, which installs into /usr/local on x86, which gets even messier if you’ve already got that installed natively for arm (as it then installs into /opt/homebrew/)—having two different Homebrew installs isn’t recommended at all. Aren’t CPU architecture transitions fun!

What would be ideal is if I could figure out how to package the app up so it doesn’t need any external dependencies and could be distributed as a single standalone app. Maybe it’s possible to package all of the dynamic libraries from Homebrew (libmpv.dylib, etc.) into the app? But unfortunately I don’t know how any of that stuff works, the whole cmake build process looks complicated and I’m not a C++ programmer so I’m stumped on that for now.

I’ll try to write up a step-by-step guide for building it for Macs, though, hopefully that’ll help enough people to compile it themselves

4 Likes

Just a quick update on this: the excellent @gagax123 accepted my pull request as well as a fix from @Nodude so OFS now compiles and runs nicely on Macs!

I still need to do a write-up on how to build it yourself (as it needs a few things installing from Homebrew and some extra tinkering if you have an Apple Silicon machine), but the good news is it should work “out of the box” now

9 Likes

This is great news. Thanks for the effort! Been struggling scripting frame by frame in funscripter lite which works but is slow and super limited.

Did you even manage to get the motion tracking add-on running? That would be truly amazing.

1 Like

I did try with Motion Tracking Funscript Generator, which should in theory work as it’s all Python, and got it running after building a Mac-friendly requirements.txt, but I couldn’t get the OFS integration working or figure out how to add tracking boxes—click–dragging in the window when manually loading a video into it didn’t seem to do anything. That was as far as I got before giving up, I might try again in a few days.

In the meantime, I did find that Simple scripter in the Handy Playground seems to be able to do motion tracking? I’m not 100% sure how well it exports, but it might work well enough to do the motion tracking in that first and then import into OFS. To try it:

  • Open the site, use the File menu to add your video. Now click Components, then scroll down to “Move net tracking” and tick the Show checkbox, then scroll down and click the Save button.
  • Now in the user interface you should see a big Load moveNet tracker button. Click that (you’ll need to be using Chrome as it won’t work in other browsers). Choose the tracking option (e.g. Torso) and click the Start tracking button and let it do its magic.

That should hopefully give you some data that you can import!

4 Likes

Wow, didn’t know that. Will def try it out. Thanks again

2 Likes

The Handy Simple scripter app is really useful. I found it works well to motion track pov bj videos with a static camera. It only adds 0% and 100% points (right?) but it does speed up the process a lot.

The frame by frame scripting part of the app is also a lot better than Funscripter lite. More keyboard shortcuts, more features, less bugs. I am going to use this from now on, don’t feel I need OFS anymore (if I can’t use its awesome motion tracking addon).

2 Likes

a write-up for installation would be awesome! I tried to run this a while back, but I have no C++ experience.

OK, here are the instructions for compiling OpenFunscripter on a Mac:

Firstly, we need to install the Apple Xcode Command Line Tools
xcode-select –-install

(you’ll need to agree Apple’s terms of service for these. it’ll download and install and may take 10+ minutes depending on how fast your internet & Mac is)

Let’s navigate to your home folder
cd ~

And clone the OFS source code into a folder called OpenFunscripter:
git clone https://github.com/OpenFunscripter/OFS.git OpenFunscripter

Navigate inside it
cd ~/OpenFunscripter

And pull in all its submodules
git submodule update --init

Now navigate into EASTL
cd lib/EASTL

And get its submodules too
git submodule update --init

We need to install Homebrew, which we’ll then use to install cmake and mpv
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Let’s install cmake so we can build things
brew install cmake

If you’re on an Apple Silicon (arm M1) Mac, we need to pretend we’re on an Intel machine so everything actually compiles. (This will open a new bash shell and use Rosetta to emulate an Intel machine – if your Mac prompts you to install Rosetta, do what it says)
For Apple Silicon Macs only:
arch -x86_64 /bin/bash
[opens a new fake-Intel bash shell]

For Apple Silicon Macs only, we need to install homebrew again (sorry). This will hopefully work! It’s very messy to install homebrew twice, as normally homebrew for arm installs to /opt/homebrew/bin/brew, but we have to fudge things for our fake-Intel build so we get fake-intel mpv which OpenFunscript needs)
For Apple Silicon Macs only
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

For Apple Silicon Macs only—first we have to explicitly set a load of exports for the intel version of homebrew, as we’re running in a fake-Intel bash shell where these may not get set automatically and they’ll be needed later for cmake & make, then we run the x86 version of homebrew to install mpv
export HOMEBREW_PREFIX="/usr/local";
export HOMEBREW_CELLAR="/usr/local/Cellar";
export HOMEBREW_REPOSITORY="/usr/local/Homebrew";
export PATH="/usr/local/bin:/usr/local/sbin${PATH+:$PATH}";
export MANPATH="/usr/local/share/man${MANPATH+:$MANPATH}:";
export INFOPATH="/usr/local/share/info:${INFOPATH:-}";
/usr/local/Homebrew/bin/brew install mpv

For Intel Macs only:
brew install mpv

(The above brew install commands will probably take a while depending on how fast your Mac & internet is)

Hopefully that all worked. Now let’s make sure we’re in the right place
cd ~/OpenFunscripter

And build things
cmake -B build
cd build
make

If everything’s gone to plan, you should after quite a few minutes have a nice working OpenFunscripter app! It’s inside the ~/OpenFunscripter/bin folder.

Let’s copy it to your Applications folder
cp -a ~/OpenFunscripter/bin/OpenFunscripter.app /Applications/

And open it from the commandline
open /Applications/OpenFunscripter.app

You should have an open window with OpenFunscripter running!

With a bit of luck, unless I’ve messed something up, these instructions will work for both Intel and Apple Silicon Macs. Get in touch if you’re stuck and I’ll try to help. Good luck!

22 Likes

I have forked OFS and have packaged a compiled app and packaged installer with shell scripts to install the other dependencies. I have tested it on a macbook running 10.15 and a hackintosh running 10.15

@Mongoose & @gagax123 let me know what you need for pull requests.

9 Likes

This is so great, thanks @559lawndart and @Mongoose!

I had built a couple semi-working versions of OFS for Mac for myself, but it was always a bit of a fight with something or other, so I didn’t end up updating it much at all, and the motion tracking was a whole 'nother ball of wax I didn’t want to mess with. I have recently just been running it in Parallels so I could use motion tracking, but I am highly looking forward to that not being necessary!

2 Likes

It’s perhaps worth noting that @559lawndart 's installer script doesn’t check if any of the things it needs are already installed, which is understandable (obviously much easier this way, and checking for compatible versions of all of the different things would be especially tricky, I’m thinking).

Maybe it could check for an existing homebrew installation, though?

@lumbar
Thanks for the complement. I will probably be tinkering with the script a bit.

In regards to your second comment, you are correct in that I didn’t write any checks in the bash script that I created, however all subsequent scripts called have inherent checks in them. To run through:
a. Homebrew is installed first, if it isn’t found then it is installed, if it is then essentially brew update is run instead via Homebrews installation script.
b. wget and git are installed second. (wasn’t entirely necessary, homebrew installs a smaller, condensed version of both I beleive, but both llvm and mpv have many dependencies)
c. llvm and mpv are installed third (the packages OFS requires that aren’t compiled in the build)

wget, git llvm and mpv are installed via brew install. If the packages aren’t installed then they are otherwise homebrew will update them, essentially its brew update --preinstall for homebrew and brew update PackageName for the other 4 and will issue a warning if existing and up to date. After the bash script is run then the packager essentially copies the .app into the Applications folder, and will overwrite any instance found. Essentially running the package will work with any new .app release and somewhat function as an updater.

This is probably the 4th iteration of the script that I wrote. One of the issues I’m resolving is how Installer calls scripts and even though it sets responsibility to the package script service which then calls the preinstall script (function) which then calls my script it isn’t truly maintaining parent status of called scripts and their exit status, but that is probably another topic. Once I get that resolved adding checks isn’t difficult, as far as I know presently, OFS doesn’t have a version limitation on llvm and mpv, but if so I can add that.

Thanks for the thorough reply. Excellent points on some distinctions I missed.


I think I probably realized a more distilled essence of the “pain” I was experiencing:

I think it’s more about concern that I’ll need to re-update all of the dependencies via brew each time I want to install an updated OFS app. I mean, I could probably just pull the built app out of the .pkg, right?

I can definitely understand how it’d be simpler to just run the dependencies script every time, but with all of the dependencies and cleanup, the script run took a good 10 minutes (very rough guess, wasn’t really watching it closely). I’m sure part of that was my homebrew stuff was several months out of date and had a fair bit of extra stuff to clean up after itself.

All of the above is said with the understanding that probably not running the script every time is going to have a bigger impact on you or perhaps OFS’s maintainers, as I’m sure it could impact people asking for help if versions of dependencies start getting out of date, or whatnot. And I find having OFS in general, and a mac build in particular, absolutely more important than dealing with extra waiting every now and then. :smiley:

Thanks again!

On a mac with an M1 chip.
Maybe you can help, @559lawndart @Mongoose
I made it most of the way through your process before getting an error.
In the OpenFunscripter/build directory, running make, I get an error finding a file:
make
[ 1%] Built target glad2
[ 3%] Built target libserialport
[ 13%] Built target lua
[ 15%] Built target imgui
[ 15%] Built target imgui_stdlib
[ 16%] Built target tinyfiledialogs
[ 17%] Built target tracy
[ 18%] Built target ImGuizmo
[ 22%] Built target EASTL
[ 27%] Built target EAThread
[ 27%] Built target EAAssert
[ 33%] Built target EAStdC
[ 33%] Built target SDL2main
[ 84%] Built target SDL2-static
[ 84%] Building CXX object OFS-lib/CMakeFiles/OFS_lib.dir/UI/OFS_Videoplayer.cpp.o
/Users/xxxx/OpenFunscripter/OFS-lib/UI/OFS_Videoplayer.cpp:3:10: fatal error: ‘mpv/client.h’ file not found
#include <mpv/client.h>
^~~~~~~~~~~~~~
1 error generated.
make[2]: *** [OFS-lib/CMakeFiles/OFS_lib.dir/UI/OFS_Videoplayer.cpp.o] Error 1
make[1]: *** [OFS-lib/CMakeFiles/OFS_lib.dir/all] Error 2
make: *** [all] Error 2

@559lawndart
I am not sure how to use your solution. If you have time could you post a few more details / commands to run/install. Thanks.

Wow thank you @Mongoose this is actually working!

Now we just need the motion tracking to work as well :slight_smile:

1 Like

It’s not finding the mpv headers, which to me seems like perhaps you’ve missed switching into x86 Rosetta2 mode and installing homebrew again while pretending to be an Intel machine?

Try the following in a Terminal:

arch -x86_64 /bin/bash
[opens a new fake-Intel bash shell]

in the new fake-Intel shell, we want to nstall the Intel version of Homebrew:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Still in the fake-Intel shell, we now want to install the Intel-homebrew version of mpv (and its libraries & headers), which should fix your missing file issue. We’ll call the Intel version of homebrew directly, just to make sure:
/usr/local/Homebrew/bin/brew install mpv

Now, still in the fake-Intel shell, run the rest of the compilation. This will build the Intel version of OpenFunscripter, which is ok because it’ll run fine through Rosetta2 (and the ARM-native version fails to build anyway):
cd ~/OpenFunscripter
cmake -B build
cd build
make

Hope that works for you!

I did exactly as you said, and got the same error.

When it gives the error I was running /usr/local/Homebrew/bin/brew reinstall mpv in the arch -x86_64 /bin/bash terminal.

When I opened a new terminal and ran /usr/local/Homebrew/bin/brew reinstall mpv ,
then the compile worked fine, and I can now open the app.

Thanks for the help, now to learn how to write a script in the app.

1 Like