As a 3D developer, especially a 3D engine developer, it is often exposed to data from a variety of three-dimensional models. Although 3dsmax has been able to export many formats of the model, but it is not always suitable for their own use. So there's always a way to write an export plugin that lets 3dmax export the data format you want. Here is a brief introduction to how to write the first step of exporting a plugin for 3dmax: How to configure VS and maxsdk. Here you need to have two items: 1, a full version of the 3dsMax. 2, a visual Studio. Why do you want the full version of 3dsMax? This is because the full version of the 3dsMax installation file comes with MAXSDK. This is very important. Different versions of 3dsMax, with the SDK will not be the same. You took the other version of the SDK to do the plugin, not necessarily suitable for your current 3dsmax use. Many people write this configuration tutorial, will tell you to go online to find MAXSDK. It doesn't really need to be so troublesome. The following will tell you how to install. I'm taking the 64-bit version of the 3dsmax2011 I'm currently using to do a demonstration. The other versions are the same way. So what does Visual Studio require? Some people have written tutorials that will tell you that each version of Max's SDK will correspond to different versions of VS, preferably. It's not wrong to say so. But in fact, this correspondence is not so strict, I will tell you how to cross-version configuration. For example, max2011 SDK corresponding to the VS2008, I will use the vs2010 to configure. OK, the above 2 things ready, 3dsmax normal installation, vs also normal installation, the preparation is finished, then Azhao and everyone together to install this MAXSDK: Run the full version of the 3dsMax installation files, you will see the following interface, we choose "Installation tools and Utilities":
Here you select the tools you need to install, and we need the SDK for 3ds Max 2011:
After installation, the installation directory will find a howto folder, there is a 3dsmaxPluginWizard folder, there is a Readme.txt document, the document shows how to configure the SDK. In fact, after the installation, we can move the Maxsdk folder casually to the place we want. But before the configuration, it is best to move well, after you start the configuration, do not move the path of this folder. Before the configuration, the properties of this folder are read-only, we first remove the entire folder read-only, and then start the configuration: Use Notepad to open the 3dsmaxpluginwizard.vsz under the same folder, and then find the place with the red line. The default wizard=vswizardengine.9.0, which represents the corresponding VS2008 version. I need to use version 2010 now, so I changed it to 10.0 and then the following Absolute_path changed to the path of the current 3dsmaxPluginWizard folder:
After the change, we copy the three files under the 3dsmaxPluginWizard folder:
Then locate the VS2010 installation folder, locate the Vc/vcprojects folder, and put the three files you just copied into this folder:
Then we can open vs2010 and create a new project. This time in the C + + project to see the category of 3dsmax plug-in, select it, and then in the following project name and path to enter the name and path you want.
If your previous configuration is correct, the Setup wizard will pop up, and if it doesn't pop up, check the previous steps. We choose File Export: Here is the details of the plugin, directly next to the line:
Here is the project details, the first entry maxsdk path, the second input plugin want to output the path, such as the 3dsmax installation directory of the Plugins folder, the third entry needs to debug 3dsmax installation directory. All three items can be modified after the project is established.
By the finish, since this version of the SDK corresponds to VS2008, now I use 2010, so there is a conversion version of the process at this time, the project should have been created successfully. If the creation is not successful, check the previous steps. This is usually because the VS version in 3dsmaxpluginwizard.vsz is set incorrectly. If the creation succeeds, we find the CPP for your project in Solution Explorer, open.
Inside the CPP, modify the Ext method inside the return, here is the model you exported the format suffix, here I was changed to "Azhao", and then change the Shortdesc method inside the return, here is the description of the model, I changed to "Azhao model format." Now press debug, the error will pop up:
This is because the debug target is not set correctly, you can find the project Properties modified: In the configuration properties of the debug, modify the command entry for your 3dsmax.exe path: According to the truth, now we start debugging, your 3dsmax will start. If you are configuring for a 32-bit 3dsmax, then the entire configuration process is complete. But I here 3dsmax start error, this is because my 3dsmax is 64 bits, just debug generated 32-bit plug-ins can not be used. Next we are going to change the project to 64-bit. Open the project properties first, and in Configuration Manager, change the Win32 to x64:
After the change, all of our configurations are gone and need to be configured individually: Configure the debugger Path First:
Then configure the output path to configure the path of the generator database file OK, the 64-bit modification is complete, we debug again, 3dsmax should be able to open the normal. We create a teapot in the scene and export it. Now we can choose the export format, find the format we just specified, that is, "Azhao model format", the suffix is "Azhao".
OK save, will open a dialog box, but there are some default things, no content, because we just completed the configuration of the steps, did not start to write the actual content of the export.
Find the Doexport method in VS and make a breakpoint inside. To choose to export our format again, vs should be able to enter the breakpoint. The Doexport method is the entrance to the method of export.
If you find a problem on the way, it is likely that the following problems: 1, download the maxsdk have problems, we recommend the full version of the 3dsMax SDK. 2, forget to cancel the Maxsdk folder read-only properties, so that the new project or compile the time will be wrong. 3. The VS version set in 3dsmaxpluginwizard.vsz is not correct. 9.0 corresponds to the vs2008,10.0 corresponding to is the vs2010,11.0 corresponding is vs2012.4, debugging error, there may be no set on the Debug object, to be set to 3dsMax exe. 5, debugging when no error, but did not appear to export the choice. It is possible that the export save path is not correct, to be saved in the 3dsmax installation path inside the plug-in folder, such as plugins or Stdplugs folder. 6, debugging when the 3dsmax started, but on the way to start error. It is possible that the SDK used and the 3dsMax version do not correspond, or that the 32-bit plug-in and 64-bit software do not correspond. Although this process is simple, but will encounter a lot of silently wonderful small problems, although the relevant tutorials on the Internet, but at least I myself to a lot of tutorials are not configured successfully, so just put their own configuration process recorded, hoping to give a reference to the people who need to be configured later. "Turn" http://liweizhaolili.blog.163.com/blog/static/162307442013117731953/
3DsMax Export Plugin Write (a)--vs2010 and 3dsmax2011 (64-bit) configuration method