Message 1 of 4
getTranslation is not working or I'm doing something wrong.

Not applicable
08-31-2017
01:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey guys, using the C++ maya API to get the position of a object, I am using:
MFnTransform fn(obj); MVector Translation = fn.getTranslation(MSpace::kTransform); std::string s = std::to_string(Translation.x); MString m(s.c_str()); cerr << m << endl; std::string ss = std::to_string(Translation.y); MString mm(ss.c_str()); cerr << mm << endl; std::string sss = std::to_string(Translation.z); MString mmm(sss.c_str()); cerr << mmm << endl;
But It's not assigning / I'm using the wrong class to get the XYZ,