From 7a12f7898421bcc60439e53372c2ddca355cf5e4 Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Mon, 29 Jul 2019 17:33:35 +0930 Subject: [PATCH] Fix poser failure because of incorrect translated rig bone name in Simplified Chinese. --- src/animalrigger.cpp | 2 +- src/skeletonside.cpp | 1 + src/skeletonside.h | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/animalrigger.cpp b/src/animalrigger.cpp index ab3d6590..d224f5bd 100644 --- a/src/animalrigger.cpp +++ b/src/animalrigger.cpp @@ -639,5 +639,5 @@ QString AnimalRigger::namingConnector(const QString &spineName, const QString &c QString AnimalRigger::namingChainPrefix(const QString &baseName, SkeletonSide side, int orderInSide, int totalInSide) { - return SkeletonSideToDispName(side) + baseName + (totalInSide == 1 ? QString() : QString::number(orderInSide)); + return SkeletonSideToString(side) + baseName + (totalInSide == 1 ? QString() : QString::number(orderInSide)); } diff --git a/src/skeletonside.cpp b/src/skeletonside.cpp index a7587e52..c67106ac 100644 --- a/src/skeletonside.cpp +++ b/src/skeletonside.cpp @@ -2,6 +2,7 @@ #include "skeletonside.h" IMPL_SkeletonSideToDispName +IMPL_SkeletonSideToString SkeletonSide SkeletonSideFromBoneName(const QString &boneName) { diff --git a/src/skeletonside.h b/src/skeletonside.h index b9a528f6..14e2d13c 100644 --- a/src/skeletonside.h +++ b/src/skeletonside.h @@ -24,6 +24,21 @@ QString SkeletonSideToDispName(SkeletonSide side) \ return ""; \ } \ } +QString SkeletonSideToString(SkeletonSide side); +#define IMPL_SkeletonSideToString \ +QString SkeletonSideToString(SkeletonSide side) \ +{ \ + switch (side) { \ + case SkeletonSide::Left: \ + return "Left"; \ + case SkeletonSide::Right: \ + return "Right"; \ + case SkeletonSide::None: \ + return ""; \ + default: \ + return ""; \ + } \ +} SkeletonSide SkeletonSideFromBoneName(const QString &boneName); #endif