Max Export Model plug-in

Source: Internet
Author: User

First, the following preparations need to be done:
1. Install a full version of 3D Max with Visual Stdio.
I installed 3D MAX 2012, it is best to find a full version, because the full version of the learning materials and the SDK for learning, very convenient. The two development of 3D MAX has a correspondence with the requirements of VS, which can be found in the SDK documentation, the VS development version of 3D Max 2012 should be vs 2010, making sure that vs 2010 is already installed on the PC, but I'm using vs2012.
2. Customize the 3D MAX Plug-in wizard.
A. Locate the 3dsmaxPluginWizard folder for the installation directory (my installation directory is C:\Program files\autodesk\3ds Max. SDK

\maxsdk\howto\3dsmaxpluginwizard
),
B. Open the Maxpluginwizard.vsz file under this directory and edit the absolute path parameter to:

param= "Absolute_path=c:\program files\autodesk\3ds Max 2012\sdk\maxsdk\howto\3dsmaxpluginwizard"

C. Copy the three files under the 3dsmaxPluginWizard folder 3dsmaxpluginwizard.ico, 3dsmaxpluginwizard.vsdir, 3dsmaxpluginwizard.vsz to vs 2005 the directory on my computer under the VC Projects directory for the installation directory is C:\Program Files\Microsoft Visual Studio 12\vc\vcprojects.
D. Start vs 2012,file-new Project, and select Visual C + + to see the 3DS Max Plugin Wizard option, explaining the success of the customization.
These are just some of the pre-development work, can be directly in the 3D MAX SDK documentation directly found, but the document can be in English oh, to read patiently.
After the preparation work done, you can start to develop a plug-in, from simple to complex, first to do a simple plug-in program. Plug-in program is written in two ways, one is to use the Plug-in wizard, just above said, the other is by hand to create a plug-in project, here for the moment only to discuss with the plug-in wizard to develop, relatively convenient, manual development after the completion.
1. The first step is to generate a plug-in program for the project, specifically as follows:
A. Open file->new project-> Select 3ds Max Plugin Wizard and enter Project name, such as "MyExport".
B. Enter the Welcome to the 3DS Max Plugin Wizard screen and select Plugin type:

C. The various plug-in types are shown here, so what to do now is a file export plugin, so choose the Fileexport type.
D. Next, a dialog box appears

The framework in the Max SDK directory is placed in the VS directory, and a new project on Max's engineering options is easy to build, with fewer configuration steps

Select File export, and then configure the path

classMeshenumproc: PublicItreeenumproc { Public: Meshenumproc (Const Char*name,iscene *scene,interface *i,dword options); ~Meshenumproc (); intCallback (INode *node); voidExport (INode *node,triobject *Tri); FILE*file; Iscene*scene; Interface*i; intselected; intnum_surfaces;};

Write a class that inherits from Itreeenumproc, a class that has a enumtree method that iterates through all the max scene nodes and calls the callback method

intMeshenumproc::callback (INode *node) {    if(Selected && node->selected () = = FALSE)returntree_continue; Object*obj = Node->evalworldstate (i->GetTime ()). obj; if(Obj->canconverttotype (class_id (triobj_class_id,0)) {Triobject*tri = (triobject*) obj->converttotype (I->gettime (), class_id (triobj_class_id,0));        Export (Node,tri); if(obj! =Tri) Delete tri; }    returntree_continue;}

Export method Write save vertex data and normals, map Uvs

Doexport inside write this class export

intEXP1::D Oexport (ConstTCHAR *name,expinterface *ei,interface *I, BOOL suppressprompts, DWORD options) {    //#pragma message (TODO ("Implement The actual file Export here and")    /*if (!suppressprompts) Dialogboxparam (hinstance, Makeintresource (Idd_panel),                GetActiveWindow (), Exp1optionsdlgproc, (LPARAM) this); */MessageBox (0,"ABC","Enter Meshenumproc", MB_OK); Meshenumproc Mesh (Name,ei-thescene,i,options); return true;}
Const TCHAR *exp1::ext (int  n) {            //#pragma message (TODO ("Return the ' i-th ' file name Extension (i.e. \ "3ds\").    ) return _t ("mimesh");}

This is the suffix name.

After compiling, build the. dle file and copy it to the Pugines folder under the Max directory, such as: D:\Program files\autodesk\3ds Max 2012\plugins

3dmax inside Edit Model

Export selection

Save the file and load the display with your own frame

Max Export Model plug-in

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.