2 #include "AL/maya/Common.h"
4 #include "maya/MString.h"
32 MStatus
parse(
const MString& optionString);
39 auto it = m_niceNameToValue.find(str);
40 if(it != m_niceNameToValue.end())
42 return it->second->m_bool;
50 int getInt(
const char*
const str)
const
52 auto it = m_niceNameToValue.find(str);
53 if(it != m_niceNameToValue.end())
55 return it->second->m_int;
65 auto it = m_niceNameToValue.find(str);
66 if(it != m_niceNameToValue.end())
68 return it->second->m_float;
78 auto it = m_niceNameToValue.find(str);
79 if(it != m_niceNameToValue.end())
81 return it->second->m_string.c_str();
87 #ifndef AL_GENERATING_DOCS
96 static const MString kNullString;
103 case kBool: m_bool = m_defaultBool;
break;
104 case kInt: m_int = m_defaultInt;
break;
105 case kFloat: m_float = m_defaultFloat;
break;
106 case kString: m_string = m_defaultString;
break;
111 void parse(MString& str)
115 case kBool: m_bool = str.asInt() ?
true :
false;
break;
116 case kInt: m_int = str.asInt();
break;
117 case kFloat: m_float = str.asFloat();
break;
118 case kString: m_string = str.asChar();
break;
128 float m_defaultFloat;
130 std::string m_defaultString;
137 std::string m_string;
139 std::map<std::string, OptionValue*> m_optionNameToValue;
140 std::map<std::string, OptionValue*> m_niceNameToValue;
163 bool addFrame(
const char* frameName);
173 bool addBool(
const char* optionName,
bool defaultValue =
false);
179 bool addInt(
const char* optionName,
int defaultValue = 0);
185 bool addFloat(
const char* optionName,
float defaultValue = 0.0f);
191 bool addString(
const char* optionName,
const char*
const defaultValue =
"");
202 bool boolControlsVisibility(
const char* controller,
const char* controlled,
bool invertBehaviour =
false);
218 #ifndef AL_GENERATING_DOCS
219 bool hasOption(
const char*
const optionName)
const;
220 bool hasOption(
const MString& optionName)
const {
return hasOption(optionName.asChar()); }
221 void generateBoolGlobals(
const MString& niceName,
const MString& optionName,
bool defaultValue);
222 void generateIntGlobals(
const MString& niceName,
const MString& optionName,
int defaultValue);
223 void generateFloatGlobals(
const MString& niceName,
const MString& optionName,
float defaultValue);
224 void generateStringGlobals(
const MString& niceName,
const MString& optionName, MString defaultValue);
227 #ifndef AL_GENERATING_DOCS
237 FrameLayout(
const char* frameName)
238 : m_frameName(frameName), m_options()
251 const char* defaultString;
254 std::vector<Option> m_options;
256 FrameLayout& lastFrame()
258 return *(m_frames.end() - 1);
260 std::vector<FrameLayout> m_frames;
261 std::vector<std::pair<MString, MString> > m_visibility;
262 MString m_translatorName;
Definition: FileTranslatorOptions.h:241
int getInt(const char *const str) const
Given the text name of an option, returns the integer value for that option.
Definition: FileTranslatorOptions.h:50
bool getBool(const char *const str) const
Given the text name of an option, returns the boolean value for that option.
Definition: FileTranslatorOptions.h:37
MString getString(const char *const str) const
Given the text name of an option, returns the string value for that option.
Definition: FileTranslatorOptions.h:76
Utility class that constructs the file translator export GUI from the export options you want to supp...
Definition: FileTranslatorOptions.h:148
bool addBool(const char *optionName, bool defaultValue=false)
Add a boolean value to the translator options.
Utility class that parses the file translator options passed through by Maya.
Definition: FileTranslatorOptions.h:17
float getFloat(const char *const str) const
Given the text name of an option, returns the floating point value for that option.
Definition: FileTranslatorOptions.h:63
bool addString(const char *optionName, const char *const defaultValue="")
Add a string value to the translator options.
bool boolControlsVisibility(const char *controller, const char *controlled, bool invertBehaviour=false)
For a given boolean option (the controller), if enabled the 'controlled' option will be editable...
bool addInt(const char *optionName, int defaultValue=0)
Add an integer value to the translator options.
bool addFrame(const char *frameName)
add a new frame layout under which to group a set of controls. There must be at least 1 frame created...
MStatus generateScript(OptionsParser &optionParser, MString &defaultOptionString)
This method generates the MEL script for the import/export GUI, and evaluates it behind the scenes...
bool addFloat(const char *optionName, float defaultValue=0.0f)
Add a float value to the translator options.
FileTranslatorOptions(const char *fileTranslatorName)
ctor
MStatus parse(const MString &optionString)
Given a string containing a semi-colon separated list of options passed to a file translator plugin...