Repository navigation
feat: Generic な .anim のボーンの Transform のカーブをポーズボーンに読み込む - #286
Merged
Merged
Conversation
#209 では読み飛ばしていた、ボーンを対象にした m_PositionCurves / m_RotationCurves / m_EulerCurves / m_ScaleCurves を、 ポーズボーンの位置・回転・スケールのキーにする(#270)。 - 新旧どちらの FBX インポーターも、このアドオンの呼び方ではボーンの軸を付け替えない(3ds Max・Maya・MotionBuilder・ Unity FBX Exporter・Blender の FBX 10 本で、新旧のボーンの行列が一致)。そのため、親(親のボーンかアーマチュア)から 見たボーンの行列はオブジェクトの子と同じ A⁻¹·L·A になる。Issue に書いた軸の補正は要らなかった。 - フレームごとに祖先から順にポーズの行列を求め、Bone.convert_local_to_pose でポーズボーンの値にする。新しいインポーターが Maya の FBX で inherit_scale を NONE にするボーンも、これで正しく扱える。 - Unity 6 で .anim をサンプリングした値と突き合わせた。Ghoul Crew の Scavenger(Maya)はフレームの時刻で位置・回転とも一致し、 Thalassophobia のサメ(Blender)は補間の差(1.3 mm・0.04°)だけだった。 - 同点の結び付き先が別々のモデルにまたがるときは、クリップとフォルダが近いモデルだけに付ける(prefer_nearest_models)。 ボーン名が共通の Ghoul Crew では、各クリップが 10 体すべてのアーマチュアに付いていた。 - 速さのために、カーブを時刻の列でまとめて評価し(evaluate_many / transform_specs)、クリップの中で使い回す。値が変わらない チャンネルはキー 1 つにし、キーがフレームより密なときはキーの時刻を足さない。Ghoul Crew(.anim 45 本)で読み込みは main より約 6 秒増える。 - Blender 4.5 の channelbag.fcurves.new は group_name を取らないので、グループは後から付ける。 - 合成パッケージの Wave.anim を、Hips の位置・回転と Spine のオイラー回転・スケールに作り替え、期待値は Unity 6 で再生した ボーンの向きと位置にした。統合テストにボーンの頭の位置のチェック(bone_head)を足した。 Closes #270 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
#209 では読み飛ばしていた、.anim の中でボーンを対象にした Transform のカーブ(位置・回転・オイラー回転・スケール)を、ポーズボーンのキーとして読み込みます(#270)。キーはアーマチュアの NLA トラックに入ります。
変更内容
A⁻¹·L·Aで求めました。Issue で見込んでいた軸の補正は要りませんでした。Bone.convert_local_to_poseでポーズボーンの値に直します。新しいインポーターが Maya の FBX でinherit_scale = NONEにするボーンも、これで正しく扱えます。prefer_nearest_models)evaluate_many/transform_specs)、評価した値をクリップの中で使い回します。channelbag.fcurves.newはgroup_nameを取らないので、F カーブのグループは作った後で付けます。Wave.animを作り替えました(Hips の位置・回転、Spine のオイラー回転・スケール)。期待値は Unity 6 で再生した値です。bone_head)を足しました。1.19.0-dev.1確認
Unity 6 との突き合わせ(.anim をサンプリングした各ボーンのワールドの値と比較)
Wave単体テスト: 638 件すべて成功
統合テスト: Blender 5.3 と 4.5 で全期待値 33 本が合格、5.2.1 でアニメーションの 4 本が合格
範囲外で見つけたこと
Waveでは、Legacy だと Head が当たりません)。以前からある動作です。Closes #270
🤖 Generated with Claude Code