@@ -156,9 +156,9 @@ static UINT getFirstFreeIndex(MPlug* arrayPlug)
156156
157157MObject SkinManagerMaya::addMissingBones (BoneNamesVector& missingBoneNames, const UINT& skinnedBoneCount)
158158{
159- for (std::string & name : missingBoneNames)
159+ for (std::wstring & name : missingBoneNames)
160160 {
161- auto command = fmt::format (" skinCluster -e -ai {} {}" , name, this ->fnSkinCluster .name ().asChar ());
161+ std::wstring command = fmt::format (L " skinCluster -e -ai {} {}" , name, fmt::ptr ( this ->fnSkinCluster .name ().asChar () ));
162162 MGlobal::executeCommand (MString (command.c_str ()));
163163 }
164164}
@@ -278,10 +278,10 @@ PySkinData SkinManagerMaya::extractSkinData(const bool safeMode)
278278 {
279279 throw std::runtime_error (" Failed to find influence objects!" );
280280 }
281- pySkinData.boneNames = std::vector<std::string >(skinnedBones.length ());
281+ pySkinData.boneNames = std::vector<std::wstring >(skinnedBones.length ());
282282 for (UINT boneIndex = 0 ; boneIndex < skinnedBones.length (); boneIndex++)
283283 {
284- pySkinData.boneNames [boneIndex] = fmt::format (" {}" , skinnedBones[boneIndex].partialPathName ().asChar ());
284+ pySkinData.boneNames [boneIndex] = fmt::format (L " {}" , fmt::ptr ( skinnedBones[boneIndex].partialPathName ().asChar () ));
285285 }
286286 MPoint mPoint ;
287287 pySkinData.setMaximumVertexWeightCount (boneCount);
@@ -409,13 +409,13 @@ static MDoubleArray getWeightsAsMDoubleArray(BoneIDsMatrix& boneIDs, WeightsMatr
409409}
410410
411411
412- static void getBoneNames (std::vector<std::string >& currentBoneNames, const MDagPathArray& skinnedBones, const UINT& skinnedBoneCount)
412+ static void getBoneNames (std::vector<std::wstring >& currentBoneNames, const MDagPathArray& skinnedBones, const UINT& skinnedBoneCount)
413413{
414414 currentBoneNames.clear ();
415415 currentBoneNames.resize (skinnedBoneCount);
416416 for (UINT boneIndex = 0 ; boneIndex < skinnedBoneCount; boneIndex++)
417417 {
418- currentBoneNames[boneIndex] = fmt::format (" {}" , skinnedBones[boneIndex].partialPathName ().asChar ());
418+ currentBoneNames[boneIndex] = fmt::format (L " {}" , fmt::ptr ( skinnedBones[boneIndex].partialPathName ().asChar () ));
419419 }
420420}
421421
@@ -456,7 +456,7 @@ bool SkinManagerMaya::applySkinData(PySkinData& skinData)
456456 throw std::runtime_error (" Error querying bones!" );
457457 }
458458 auto skinnedBoneCount = skinnedBones.length ();
459- auto currentBoneNames = std::vector<std::string >(skinnedBoneCount);
459+ auto currentBoneNames = std::vector<std::wstring >(skinnedBoneCount);
460460 getBoneNames (currentBoneNames, skinnedBones, skinnedBoneCount);
461461 bool bonesAdded = false ;
462462 if (skinnedBoneCount == 0 )
0 commit comments