Skip to content

Commit

Permalink
5.01.03_β04
Browse files Browse the repository at this point in the history
VmdSizing_5.01.03_β04 (2021/05/22)
・腕スタンス補正
 ・作成元「もしくは」変換先のモデルで手首→中指1の長さチェックに引っかかった場合、
  作成元も変換先も、いずれも「表示先」ボーンを使用して手首の傾きを算出するよう処理変更
  • Loading branch information
miu200521358 committed May 22, 2021
1 parent 8ce2ee8 commit 6ff7290
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from service.SizingService import SizingService
from utils.MException import SizingException

VERSION_NAME = "ver5.01.03_β03"
VERSION_NAME = "ver5.01.03_β04"

# 指数表記なし、有効小数点桁数6、30を超えると省略あり、一行の文字数200
np.set_printoptions(suppress=True, precision=6, threshold=30, linewidth=200)
Expand Down
22 changes: 16 additions & 6 deletions src/service/parts/StanceService.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3925,16 +3925,26 @@ cdef class StanceService():
_, rep_to_qq = data_set.rep_model.calc_arm_stance(target_bone_name, to_bone_name)

if "手首" in target_bone_name and f"{direction}中指2" in data_set.org_model.bones and f"{direction}中指2" in data_set.rep_model.bones:
wrist2finger1 = data_set.org_model.bones[f"{direction}手首"].position.distanceToPoint(data_set.org_model.bones[f"{direction}中指1"].position)
finget12finger3 = data_set.org_model.bones[f"{direction}中指1"].position.distanceToPoint(data_set.org_model.bones[f"{direction}中指3"].position)
org_wrist2finger1 = data_set.org_model.bones[f"{direction}手首"].position.distanceToPoint(data_set.org_model.bones[f"{direction}中指1"].position)
org_finget12finger3 = data_set.org_model.bones[f"{direction}中指1"].position.distanceToPoint(data_set.org_model.bones[f"{direction}中指3"].position)

logger.debug(f"手首-指1: {wrist2finger1}")
logger.debug(f"指1-指3: {finget12finger3)}")
logger.debug(f"手首-指1: {org_wrist2finger1}")
logger.debug(f"指1-指3: {org_finget12finger3)}")

if wrist2finger1 > finget12finger3 * 2:
rep_wrist2finger1 = data_set.rep_model.bones[f"{direction}手首"].position.distanceToPoint(data_set.rep_model.bones[f"{direction}中指1"].position)
rep_finget12finger3 = data_set.rep_model.bones[f"{direction}中指1"].position.distanceToPoint(data_set.rep_model.bones[f"{direction}中指3"].position)

logger.debug(f"手首-指1: {rep_wrist2finger1}")
logger.debug(f"指1-指3: {rep_finget12finger3)}")

if org_wrist2finger1 > org_finget12finger3 * 2 or rep_wrist2finger1 > rep_finget12finger3 * 2:
# ISAO式ミクの場合、手首と中指が分断されてるので、表示先をベースに調整する
if direction == "":
logger.warning(f"手首から中指付け根までの長さが、中指の長さx2の長さより長いため、手首の表示先で傾きを調整します。【No.{(data_set_idx + 1)}】")
if org_wrist2finger1 > org_finget12finger3 * 2:
logger.warning(f"作成元モデルの、手首から中指付け根までの長さ({round(org_wrist2finger1, 4)})が中指の長さx2の長さ({round(org_finget12finger3 * 2, 4)})より長いため、手首の表示先で傾きを調整します。【No.{(data_set_idx + 1)}】")

if rep_wrist2finger1 > rep_finget12finger3 * 2:
logger.warning(f"変換先モデルの、手首から中指付け根までの長さ({round(rep_wrist2finger1, 4)})が中指の長さx2の長さ({round(rep_finget12finger3 * 2, 4)})より長いため、手首の表示先で傾きを調整します。【No.{(data_set_idx + 1)}】")

# TARGET-TOの傾き
_, org_to_qq = data_set.org_model.calc_arm_stance(target_bone_name, None)
Expand Down
2 changes: 1 addition & 1 deletion vmdising_np64.spec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ exe = EXE(pyz,
a.zipfiles,
a.datas,
[],
name='VmdSizing_5.01.03_β03_64bit',
name='VmdSizing_5.01.03_β04_64bit',
debug=False,
bootloader_ignore_signals=False,
strip=False,
Expand Down

0 comments on commit 6ff7290

Please sign in to comment.