How to use C ++ to develop the 3DS MAX plug-in

Source: Internet
Author: User

Create an empty project

We first create a simple geometric object in the Panel created by 3DS MAX, which is called a "widget ". You can use three parameters in the View window to modify its geometric properties. Size indicates the contour size, left indicates the extension of the left wing of the object, and right indicates the extension of the right wing.
First, let's take a look at how to build a project. You can use the following two methods:
1. Using the appwizards
2. manually
Some plug-ins can only be created manually.

For simplicity, only the first method is described.
Using the Appwizard

1. Wizard Installation
The following describes the plug-in Application Wizard (Appwizard) in Visual Studio, which is a program running in Visual Studio. To install Appwizard in Visual Studio, follow these steps:
First, open the maxpluginwizard. vsz file in Notepad (located in the maxsdk/howto/3dsmaxpluginwizard directory) and edit the parameter absolute path to the new path where the 3dsmaxpluginwizard root directory is located. Do not add a backslash to the end position of the directory name. For example, the new path is:
C:/program files/Autodesk/3DS MAX 9 SDK/maxsdk/howto/3 dsmaxpluginwizard. To:
Param = "absolute_path
= [C:/program files/Autodesk/3DS MAX 9 SDK/maxsdk/howto/3 dsmaxpluginwizard] ".

Copy the following files from the 3dsmaxpluginwizard directory to the VC/vcprojects folder under the installation directory of Visual Studio (usually C:/program files/Microsoft Visual Studio.. Net/VC/vcprojects ).
• 3dsmaxpluginwizard. ICO
• 3dsmaxpluginwizard. vsdir
• 3dsmaxpluginwizard. vsz
The 3DS MAX plugin wizard project appears under File> New: Projects> visual c ++ projects in Visual Studio.
2. Create a project
Select a new project in Visual Studio, File> New> project..., select 3DS MAX plugin wizard in the displayed dialog box, and enter the project name and storage path.

Figure 2 the new project dialog in Visual Studio, And the 3DS MAX plugin wizard

The following window is displayed after you click OK:

Figure 3 shows the polictypes of plugins that can be created with the Appwizard.

Select procedural objects from the plugin type list. Then select the plugin details Tag:

Figure 4 plugin details.

Set according to Figure 4. In this example, select simpleobject2 as the base class inherited by the plug-in program. The third blank indicates the plug-in program type, it will appear in the list under the create panel of Max. Last input description.

Next, select the project details Tag:

Figure 5 input and output information.
Select the path of the 3DS max sdk folder and set it to the root directory of <Max SDK/include> and <Max SDK/lib>. Enter the output directory and execution path of the file. Select finish to complete the creation.
Figure 6 shows the solution browser after completion, which contains three sub-files. Under the source files file, Appwizard creates two CPP files, dllentry. CPP contains the dlin entry function dllmain. The Wizard has been filled in with code and does not need to be modified. Widget. cpp is the implementation file of plugin.

Figure 6 the Solution Explorer shows the files created by the Appwizard.
In this example, the CPP file does not have specific code to implement the function, but can compile and run this project normally.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.