How I can set the name of node with this pattern? note that i and j are inetger
node->SetName(_T("Bone"+i+j));
How I can set the name of node with this pattern? note that i and j are inetger
node->SetName(_T("Bone"+i+j));
if you want to keep it all “max”
Then something like
TSTR name;
name.printf(_T("Bone%d%d"),i,j);
node->SetName(name.data());
would be as good as any (note i’ve typed that off the top of my head so may or may not work
)
but otherwise lots of “standard” c/cpp ways of doing it.
typedef std::basic_string<TCHAR, std::char_traits<TCHAR>, std::allocator<TCHAR>> tstr;
tstr name = _T("Bone");
TCHAR temp[21];
name += _itot(i,temp,10);
name += _itot(j,temp,10);
node->SetName(name.c_str());
or something like
typedef std::basic_stringstream<TCHAR, std::char_traits<TCHAR>, std::allocator<TCHAR>> tstream;
tstream bonestrm;
bonestrm << _T("Bone") << i << j;
node->SetName(bonestrm.str().c_str());
i would do something like:
// where : MSTR base, int x, int y
std::wstringstream wss;
wss << std::wstring(base) << x << y;
MSTR name = wss.str().c_str();
if i want to do it more c++ than max sdk.
anyway it would be very close to what Klvnk showed.