![]() ![]() We need to create a variable of the msModel type and then call the msModel::Load method. We need to study the msViewer code to see how the msModel class is used. Now we need to write the LoadMS3D function to do the importing of the file. Next add the MQImportFile function which is specifically required for Import plugins.Ĭhange the name of the function called in this function to the function name you declared at the top of the file. Next add the MQEnumFileExt function which is required by Import plugins and change the extension to your file extension. Next add the MQEnumFileType function which is required for Import plugins and change the text to the file type you are importing. Next add the required MQGetPlugInType function and make sure the type is MQPLUGIN_TYPE_IMPORT. Next add the required MQGetPlugInName function and change the text to what you want displayed in the Help>About Plug-ins dialog. We don’t need to initialise any variables when the *.dll is loaded so we don’t need to add this function to our plugin.Īdd the required MQGetPlugInID function and change the Product and ID numbers to the ones you chose for yourself. Next in ImportDXF is the DllMain function. If you don’t set the Post-Build Event you will have to copy the *.dll to the Metasequoia\Plugins\Import folder in File Explorer every time you build the project.įor reference open ImportDXF.cpp in the editor.Ĭopy and paste the define, includes and function declaration into our plugin’s blank source file.ĭelete #include “Strings.h” since we do not need it, add #include “msModel.h” so we can use the functions from it and rename the function LoadMS3D. For Debug Configuration set a Post-Build Event to copy *.dll to Import folder.For Debug Configuration set the Debugging Command to path to Metaseq.exe.For All Configurations set the Additional Include Directories to “.”.For All Configurations set the Character Set to Multi-Byte Character Set.For All Configurations set the Output Directory and Intermediate directory.If a 64 bit *.dll is required use Configuration Manager to change the platform.Set the following properties in the project’s Property Pages. We will write our plugin code in this file. In Visual Studio add the files (existing items) to the project.Īdd MQInit.cpp (existing item) to the project.Īdd a new blank *.cpp file to the project. Open the msViewer\src folder in File Explorer and copy the following files into the project folder. See the previous posts for the details about the following steps.Ĭhoose C Win32 project, give it a suitable name and click OK.Ĭlick Application Settings, select DLL, Empty project and click Finish. We will use the *.ms3d file loading code from the viewer in our plugin to read the *.ms3d file so download msViewer2.zip and extract it somewhere. MilkShape 3D released a *.ms3d viewer with C source code. ![]() Plugins have access to more of Metasequoia’s inbuilt functions than scripts. I wrote a Metasequoia Python script to import MilkShape 3D *.ms3d files and will write a plugin to do the same. ![]() ![]() I will not use the class technique for creating the plugin. This time we will create an Import plugin. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |