Important: You need to set up your environment as described in Setting up your build environment before building the examples.
Plug-in examples are located in $DEVKIT_LOCATION/devkit/plug-ins/ and standalone application examples are located in $DEVKIT_LOCATION/devkit/applications/. Each individual example is in its own dedicated directory. Change to the example's directory to build it.
For example, the circleNode plug-in example, is located in the circleNode directory. To build it, change directory to circleNode:
cd $DEVKIT_LOCATION/devkit/plug-ins/circleNode
Before building an example, you need to run cmake once to generate a project or a makefile.
For example,
Project type | cmake command |
---|---|
Xcode | cmake -H. -Bbuild -G Xcode |
Makefile | cmake -H. -Bbuild -G "Unix Makefiles" |
On Apple Silicon, the target architecture will be arm64 by default. Similarly, on Intel, the target architecture will be Intel x86_64 by default.
You can optionally choose to build for both architectures using the CMAKE_OSX_ARCHITECTURES option.
For example:
Project type | cmake command |
---|---|
Xcode | cmake -H. -Bbuild -G Xcode -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" |
Makefile | cmake -H. -Bbuild -G "Unix Makefiles" -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" |
Note: Only one project is generated when you build for both arm64 and Intel86_64.
The cmake command should exit with no errors and create a build directory.
Run cmake again to build the example:
cmake --build build
The executable or plug-in will be located under the build directory if it was built using a UNIX makefile. It will be under the build/Debug directory if it was built using an Xcode project.
If you generated an Xcode project, you can also build the project from within Xcode.
Plug-ins have the suffix bundle. For example, the circleNode plug-in will be called circleNode/build/circleNode.bundle.
Unlike applications that can be run from the command line, plug-ins must be loaded into Maya
Important: Do not rebuild a plug-in that is already loaded into Maya. Unload the plug-in before you rebuild it.