Scene Query.cpp

From The Foundry MODO SDK wiki
Revision as of 00:07, 6 September 2013 by Adissid (Talk | contribs)

Jump to: navigation, search

Scene_Query.cpp is a basic example plugin. This wiki page is intended as a walkthrough of the code in order to help you better understand the SDK.


When installed, Scene_Query adds two plugins to modo:ResetScene and HardReset. ResetScene opens a file dialog from which you will choose a file; the current scene will then be closed and the chosen file loaded. HardReset will close the current scene then take the last selected file and load it. To change the file HardReset loads, run ResetScene and choose a different file.

Code Walkthrough

#define ARGi_FILEPATH   0         
using namespace std;
const int MAXFILELENGTH = 1000;

Here we define an argument of the form ARGi_FILEPATH to have the index value of 0. So when 0 is being passed as an argument to functions later on, it is really referring to this variable. We also define a const int that forms the upper limit for the number of characters in the file path that we will be retrieving and the character array that will hold that file path.

Select_Scene class declaration

class Select_Scene : public CLxBasicCommand //Select_Scene will open a file dialog and load the chosen scene


       int basic_CmdFlags()         LXx_OVERRIDE;
       bool basic_Enable	(CLxUser_Message &msg) LXx_OVERRIDE;
       void cmd_Interact() LXx_OVERRIDE;
       void cmd_Execute(unsigned int flags);



Here, Clear_Button is declared as a basic command( with most of the basic methods associated with it. We are inheriting from basic commands because we want this plugin to perform state changes on modo.