Difference between revisions of "Building Plug-ins"

From The Foundry MODO SDK wiki
Jump to: navigation, search
(How do I create a new Visual Studio project for a modo plugin?)
(How do I create a new Visual Studio project for a modo plugin?)
Line 13: Line 13:
 
== How do I create a new Visual Studio project for a modo plugin? ==
 
== How do I create a new Visual Studio project for a modo plugin? ==
  
These instructions are based on Visual Studio Express 2010. Much like the XCode instructions above, the basic idea is to create a static library project for the common.lib and set that as a dependency for your main plugin project.
+
These instructions are based on Visual Studio Express 2010. Much like the XCode instructions above, the basic idea is to create a static library project for the common.lib and set that as a dependency for your main plugin project. Let's see how this works in practice.
  
modo plugins are regular DLL files, easily created using the standard 'new project' wizard. You can create the DLL project before or after the common project. We'll do the former here.
+
modo plugins are regular DLL files, easily created using the standard 'new project' wizard. You can create the plugin project before or after the common project.
  
 
Start the new project wizard. Find the template for a new DLL, and create a blank project. The project should have the name of the plugin that you want to create (e.g. test for test.dll).
 
Start the new project wizard. Find the template for a new DLL, and create a blank project. The project should have the name of the plugin that you want to create (e.g. test for test.dll).
Line 21: Line 21:
 
[[File:Build_Visual_Studio2010Express_step_1.png]]
 
[[File:Build_Visual_Studio2010Express_step_1.png]]
 
[[File:Build_Visual_Studio2010Express_step_2.png]]
 
[[File:Build_Visual_Studio2010Express_step_2.png]]
 +
 +
Now, let's get the common static library sorted out. If you already have a other modo plugin source code around, you'll likely have a common project in place. You can add it to this new project easily by simplying adding the common project as shown below :
 +
 +
[[File:Build_Visual_Studio2010Express_step_3.png]]
 +
 +
Otherwise, let's create a new common project. This is done easily :
 +
 +
[[File:Build_Visual_Studio2010Express_step_3_new.png]]

Revision as of 18:40, 4 November 2012

The easiest way to see how to setup the project files is to start with the sample plugins. There are both Xcode and Visual Studio projects included.

How do I create a new XCode project for a modo plugin?

Firstly, you don't want to be creating a bundle, you want to create a C/C++ Library, set the type to Dynamic.

Then add a new target to the project, of the same type, but this one is a static library. Add the .cpp files in the SDK common directory to this target and set the header search path to look in the SDK header directory.

Then select your plugin target and go to build phases, add the SDK target as a target dependency. Also add the SDK target under Link Binary with libraries.

That should be everything you need to do.

How do I create a new Visual Studio project for a modo plugin?

These instructions are based on Visual Studio Express 2010. Much like the XCode instructions above, the basic idea is to create a static library project for the common.lib and set that as a dependency for your main plugin project. Let's see how this works in practice.

modo plugins are regular DLL files, easily created using the standard 'new project' wizard. You can create the plugin project before or after the common project.

Start the new project wizard. Find the template for a new DLL, and create a blank project. The project should have the name of the plugin that you want to create (e.g. test for test.dll).

Build Visual Studio2010Express step 1.png Build Visual Studio2010Express step 2.png

Now, let's get the common static library sorted out. If you already have a other modo plugin source code around, you'll likely have a common project in place. You can add it to this new project easily by simplying adding the common project as shown below :

Build Visual Studio2010Express step 3.png

Otherwise, let's create a new common project. This is done easily :

Build Visual Studio2010Express step 3 new.png