Discover the process to compile a plugin for TV Paint. This tutorial is for Windows. BUT in the SDK archive there is the necessary files for macOS, send me an email if you need the TV Paint SDK.
IMPORTANT: Due to internal changes in the GUI of TV Paint 12.0 and newer, the SDK doesn't work properly anymore, no plugin can be used 😞
See this forum thread to get more info
But if you are here to build a plugin to TV Paint (up to version 11.7), EVEN if you cannot buy new licenses for TV Paint 11 / 11.5 / 11.7, yes this is bad...
For this you will need:
- Lot of energy.
- Love from your beloved one, your family, or your close friends.
- A TV Paint plugin source code (CPP + CMakeLists.txt).
- Time, you always need time.
If you have a recent version of Visual Studio, open the Visual Studio Installer from the Windows Start menu and verify that the C++ workload is checked. If it's not installed, then check the box and select the Modify button in the installer.
You can also install the Desktop development with C++ workload without a full Visual Studio IDE installation. From the Visual Studio Downloads page, scroll down until you see Tools for Visual Studio under the All Downloads section and select the download for Build Tools for Visual Studio 2022.
This will launch the Visual Studio Installer, which will bring up a dialog showing the available Visual Studio Build Tools workloads. Check the Desktop development with C++ workload and select Install.
Note: You can use the C++ toolset from Visual Studio Build Tools along with Visual Studio Code to compile, build, and verify any C++ codebase as long as you also have a valid Visual Studio license (either Community, Pro, or Enterprise) that you are actively using to develop that C++ codebase.
To use MSVC from a command line or VS Code, you must run from a Developer Command Prompt for Visual Studio. An ordinary shell such as PowerShell, Bash, or the Windows command prompt does not have the necessary path environment variables set.
To open the Developer Command Prompt for VS, start typing 'developer' in the Windows Start menu, and you should see it appear in the list of suggestions. The exact name depends on which version of Visual Studio or the Visual Studio Build Tools you have installed. Select the item to open the prompt.
You can test that you have the C++ compiler, cl.exe, installed correctly by typing 'cl' and you should see a copyright message with the version and basic usage description.
If you need boost in your plugin (like us with QuadPype)
- Go to the Boost Downloads page and download the latest Boost source
.zip
file or.tar.gz
file. - Extract the archive to a directory, e.g.,
C:\Boost
. - Open a Developer PowerShell for VS console and navigate to the Boost directory, e.g.:
cd C:\Boost
- Run the
bootstrap.bat
script to set up the build system:
.\bootstrap.bat
- Build Boost using the b2 tool. Specify the desired toolchain (e.g., msvc) and install path:
.\b2 install --toolset=msvc --address-model=64 --prefix=C:\Boost\Boost_Install
--address-model=64
: Specifies a 64-bit build.
--prefix=C:\Boost\Boost_Install
: Directory where Boost will be installed.
Open your user environment variables window
And add a new environment variable:
BOOST_ROOT
: C:\Boost\Boost_Install
If you need openSSL for your compilation you should use the version from Shining Light Productions. Yes the website seems to come from the 90s and have stay in it, it's true, BUT it's the easiest way without building manually OpenSSL to get the correct LIB and HEADERS files.
- Go to this page and downlaod the correct MSI installed for your platform (x64 or x86).
- Install it but check the option to install the lib data in the OpenSSL install folder not copy them to the Windows directory.
- All good you have the files you need.
Based on your code and the CMakeLists.txt
you have (should have) you will for sure need other packages.
Yeah no easy to find (or kind of impossible), but we are kind and we could provide it (send me an email).
When you have it you need to add it to you CMakeLists by adding the TVPAINT_SDK_INCLUDE
path to the include_directories
.
And by adding the "${TVPAINT_SDK_LIB}/dllx.c"
as the last element in the add_library
(used to build your dll) in your CMakeLists.
Here we go!
- First, update your
CMakeLists.txt
to point to the correct folders you retrieved / downloaded/ installed. - Now a Developer Command Prompt for VS in admin (right click > Run as administrator), navigate to the location where you
CMakeLists.txt
is, and then run:
cmake .
For x86
(x32) build the command need to be:
cmake -G "Visual Studio 17 2022" -A Win32 .
- Check the logs, fix the issues (you will probably have some the first time, or you are just too good and you can take an ice cream, you deserve it!)
- Last but not least, the true generation of your TV Paint dll plugin, run the command:
msbuild NAME_OF_YOU_PROJECT.sln
INFO: This .sln
file as heen generated by the previous cmake .
command, the NAME_OF_YOU_PROJECT
is your project name defined in your CMakeLists.txt
with the line:
project(NAME_OF_YOU_PROJECT C CXX)
If everything works, wow, that was a good day! If not, hum sorry you will need more debug, but I'm sure you will succeed.