[OpenMaya] How to create a reference in OpenMaya / C++?


#1

Hi all - I was wondering if anyone knew how to create a reference using OpenMaya / C++ api. Is the only way to call to mell with MGlobal::executeCommand?


#2

Ooops - answered my own question. MFileIO.reference. Woo!


#3

Hmm… next question - is it possible to pass in an “options string” when creating a reference in C++? Ie, like the “-options” flag in the mel file command:

file -reference -type "mayaAscii" -options "foo=1;bar=2" "C:/maya/projects/default/scenes/barney.ma"

…or the “optionsString” in

MPxFileTranslator::reader(const MFileObject& file, const MString& optionsString, MPxFileTranslator::FileAccessMode mode)