The Core API is a powerful method to extend 3DCoat’s functionality. You can automate the job or add principally new tools. This is not just the scripting; the code you write runs at the full speed of compiled C++. We use Microsoft Visual Studio for the compiling. But the whole process is entirely transparent for you. You don’t need to configure anything or manage complex project configurations. 3DCoat will lead you through the whole process with a simple wizard.
Quickstart
The core API requires Visual Studio 2022 Community with the C++ features installed. If you have not installed Visual Studio, 3DCoat will help to install it with the correct options.
The start is quite easy. Just use Scripts->Create new Core API script
Choose the template and path for your project. Then 3DCoat will assist you in installing the Visual Studio if needed.
Each example is well documented and uses relatively simple syntax, making it easy to understand from basic to complex.
There are several important notes you need to know:
1) Always start your project from one of the examples. Even if you want to make everything from scratch, use Scripts->Create new Core API script->Minimal c++ program as your starting point. Don’t create the project manually!
2) Use Debugging; it is very convenient; all 3DCoat native data types are shown in a user-friendly interface.
3) Always follow the Visual Studio linter hints to write the correct code. Hover over the data types and function names to access the documentation on-the-fly.
4) Don’t read the full documentation. It is impossible to remember. Follow the Examples first. And then look at the documentation if you need some details.
5) Look at the C++ syntax, but don’t read the whole manual; take the basics first
6) Click on the item in the Script menu to execute. Use RMB click to get the useful commands – edit, build, rebuild. You may also create a distributive of your script to share with other users.
Addendum:
- You can access to live booleans via the python/CoreAPI.
- Additional self-test mechanism to prevent situations when CoreAPI gets failed into the build. Also, any script may be executed as 3DCoat.exe -script “path to cpp/python script”.
The script may do some action and exit using coat::utils::quit() / coat.utils.quit()