diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..cebea2f --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,18 @@ +The MIT License +Copyright (c) 2025 Ra-gu + +本ソフトウェアおよび関連する文書のファイル(以下「ソフトウェア」)の複製を取得した全ての人物に対し、以下の条件に従うことを前提に、ソフトウェアを無制限に扱うことを無償で許可します。これには、ソフトウェアの複製を使用、複製、改変、結合、公開、頒布、再許諾、および/または販売する権利、およびソフトウェアを提供する人物に同様の行為を許可する権利が含まれますが、これらに限定されません。 + +上記の著作権表示および本許諾表示を、ソフトウェアの全ての複製または実質的な部分に記載するものとします。 + +ソフトウェアは「現状有姿」で提供され、商品性、特定目的への適合性、および権利の非侵害性に関する保証を含むがこれらに限定されず、明示的であるか黙示的であるかを問わず、いかなる種類の保証も行われません。著作者または著作権者は、契約、不法行為、またはその他の行為であるかを問わず、ソフトウェアまたはソフトウェアの使用もしくはその他に取り扱いに起因または関連して生じるいかなる請求、損害賠償、その他の責任について、一切の責任を負いません。 + + +The MIT License (MIT) +Copyright © 2025 Ra-gu + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/New steve noeye_mouse.png b/New steve noeye_mouse.png new file mode 100644 index 0000000..b460c51 Binary files /dev/null and b/New steve noeye_mouse.png differ diff --git a/R-G_Rig_MoCap_v1.0.blend b/R-G_Rig_MoCap_v1.0.blend new file mode 100644 index 0000000..ff58a09 Binary files /dev/null and b/R-G_Rig_MoCap_v1.0.blend differ diff --git a/R-G_Rig_v1.0.blend b/R-G_Rig_v1.0.blend new file mode 100644 index 0000000..b7ed8c6 Binary files /dev/null and b/R-G_Rig_v1.0.blend differ diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..495c719 --- /dev/null +++ b/README.txt @@ -0,0 +1,64 @@ +R-G Simple MC Rig v1.0 +2025/12/25 + +R-G Simple MC Rigをダウンロードして頂きありがとうございます! + +こちらのリグは必要最低限の機能を備えた、日本語話者向けのシンプルな +Minecraftプレイヤーリグになります + +複雑なカスタマイズ等は出来ませんが、初心者の方やバニラに近いテイストのリグを +求めてる方に必要な機能は入ってると思います! + +このリグが、blenderを使ったマイクラアニメ制作の第一歩を踏み出すきっかけになれば嬉しいです! + + +↓下にスクロールしてください↓ + + +---簡単なQ&A--- +後日このリグに関する詳細な説明動画も投稿予定です! +定期的にチャンネルページをチェックしてください! +https://www.youtube.com/@Ra-gu/videos + +'スキンの変更方法' +「UV編集」ワークスペースに移動します。 +初期設定では「blenderSteve.png」が割り当てられているので、これを以下の手順で別のスキンに置き換えます。 +まずは「画像」→「パック解除」→「パックを削除」 +ここまで出来たら次は「画像」→「置き換え...」 +後は適用したいMinecraftのスキン画像を追加してください。 + +'目の色の変更方法' +リグの頭上にある歯車マークの設定オブジェクトを選択します。 +プロパティ画面から「マテリアルプロパティ」を開きます。 +「Pupils(○目)」マテリアルを選択すると、サーフェスドロップダウンに目の色に関する設定項目があります。 +必要に応じてカラーを変更して下さい。 + +'顔パーツの移動と変形' +「R-G MC Rig v○.○」を選択し、ポーズモードに切り替えます。 +移動、変形したい顔パーツを選択します。 +移動、回転、スケールのギズモを切り替えて、スキンの画像に合わせた配置に変更してください。 +大抵のスキンは問題ないと思いますが、極端な移動や拡大縮小には対応できません。 + +'目を閉じる/顔パーツを無くしたい' +「R-G MC Rig v○.○」を選択し、ポーズモードに切り替えます。 +Ra-guのロゴ下にある「上下の矢印」を選択し、下に移動させると目が閉じます。 +顔パーツを使わない場合は、目を閉じた状態にした後、オブジェクトモードから頭上の歯車を選択し +サイドパネルにある「Sleep Eyes」のチェックを外してください。 + +'IKモードに切り替えたい' +「R-G MC Rig v○.○」を選択し、ポーズモードに切り替えます。 +頭の横にある「IK」のスイッチを移動させることでFKとIKモードを切り替えられます。 +各手足で分かれているので、必要に応じてキーフレームで制御するなどしてください。 + +'腕の裏側に隙間ができる/スリムタイプのスキンを使いたい' +リグの頭上にある歯車マークの設定オブジェクトを選択します。 +サイドパネルの「Slim Skin」にチェックを入れることで、スリムタイプのスキンに対応します。 + + +---ライセンス(License)--- +R-G MC Rigは「MITライセンス」に基づきライセンスされます。 +This Rig is licensed under the MIT License. + +https://licenses.opensource.jp/MIT/MIT.html + +Copyright © 2025 Ra-gu \ No newline at end of file diff --git a/blender_assets.cats.txt b/blender_assets.cats.txt new file mode 100644 index 0000000..181ea00 --- /dev/null +++ b/blender_assets.cats.txt @@ -0,0 +1,10 @@ +# This is an Asset Catalog Definition file for Blender. +# +# Empty lines and lines starting with `#` will be ignored. +# The first non-ignored line should be the version indicator. +# Other lines are of the format "UUID:catalog/path/for/assets:simple catalog name" + +VERSION 1 + +6f89b5e6-c60e-418b-aaed-b4d0bed1fd19:口プリセット:口プリセット +dc1a81fc-3b8e-4075-9798-d27fbdd28827:目プリセット:目プリセット diff --git a/dance_fullbody_loop.bvh b/dance_fullbody_loop.bvh new file mode 100644 index 0000000..c44b26d --- /dev/null +++ b/dance_fullbody_loop.bvh @@ -0,0 +1,124 @@ +HIERARCHY +ROOT Hips +{ + OFFSET 0.000 0.000 0.000 + CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation + JOINT Spine + { + OFFSET 0.000 10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT Neck + { + OFFSET 0.000 10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT Head + { + OFFSET 0.000 10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + End Site + { + OFFSET 0.000 5.000 0.000 + } + } + } + JOINT LeftShoulder + { + OFFSET -5.000 10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT LeftArm + { + OFFSET -10.000 0.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT LeftForeArm + { + OFFSET -10.000 0.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + End Site + { + OFFSET -5.000 0.000 0.000 + } + } + } + } + JOINT RightShoulder + { + OFFSET 5.000 10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT RightArm + { + OFFSET 10.000 0.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT RightForeArm + { + OFFSET 10.000 0.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + End Site + { + OFFSET 5.000 0.000 0.000 + } + } + } + } + } + JOINT LeftUpLeg + { + OFFSET -5.000 -10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT LeftLeg + { + OFFSET 0.000 -10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT LeftFoot + { + OFFSET 0.000 -10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + End Site + { + OFFSET 0.000 -5.000 5.000 + } + } + } + } + JOINT RightUpLeg + { + OFFSET 5.000 -10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT RightLeg + { + OFFSET 0.000 -10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT RightFoot + { + OFFSET 0.000 -10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + End Site + { + OFFSET 0.000 -5.000 5.000 + } + } + } + } +} +MOTION +Frames: 20 +Frame Time: 0.0333333 +0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 +0.618 0.000 0.000 0.000 0.000 1.545 1.545 0.000 0.000 0.927 0.000 0.000 0.618 0.000 0.000 3.090 0.000 0.000 7.725 0.000 0.000 3.090 0.000 0.000 -3.090 0.000 0.000 -7.725 0.000 0.000 -3.090 0.000 0.000 2.472 0.000 0.000 -1.854 0.000 0.000 0.000 0.000 0.000 -2.472 0.000 0.000 1.854 0.000 0.000 0.000 0.000 0.000 +1.176 0.000 0.000 0.000 0.000 2.940 2.940 0.000 0.000 1.764 0.000 0.000 1.176 0.000 0.000 5.878 0.000 0.000 14.695 0.000 0.000 5.878 0.000 0.000 -5.878 0.000 0.000 -14.695 0.000 0.000 -5.878 0.000 0.000 4.702 0.000 0.000 -3.526 0.000 0.000 0.000 0.000 0.000 -4.702 0.000 0.000 3.526 0.000 0.000 0.000 0.000 0.000 +1.618 0.000 0.000 0.000 0.000 4.045 4.045 0.000 0.000 2.427 0.000 0.000 1.618 0.000 0.000 8.090 0.000 0.000 20.225 0.000 0.000 8.090 0.000 0.000 -8.090 0.000 0.000 -20.225 0.000 0.000 -8.090 0.000 0.000 6.472 0.000 0.000 -4.854 0.000 0.000 0.000 0.000 0.000 -6.472 0.000 0.000 4.854 0.000 0.000 0.000 0.000 0.000 +1.902 0.000 0.000 0.000 0.000 4.755 4.755 0.000 0.000 2.853 0.000 0.000 1.902 0.000 0.000 9.511 0.000 0.000 23.778 0.000 0.000 9.511 0.000 0.000 -9.511 0.000 0.000 -23.778 0.000 0.000 -9.511 0.000 0.000 7.608 0.000 0.000 -5.706 0.000 0.000 0.000 0.000 0.000 -7.608 0.000 0.000 5.706 0.000 0.000 0.000 0.000 0.000 +2.000 0.000 0.000 0.000 0.000 5.000 5.000 0.000 0.000 3.000 0.000 0.000 2.000 0.000 0.000 10.000 0.000 0.000 25.000 0.000 0.000 10.000 0.000 0.000 -10.000 0.000 0.000 -25.000 0.000 0.000 -10.000 0.000 0.000 8.000 0.000 0.000 -6.000 0.000 0.000 0.000 0.000 0.000 -8.000 0.000 0.000 6.000 0.000 0.000 0.000 0.000 0.000 +1.902 0.000 0.000 0.000 0.000 4.755 4.755 0.000 0.000 2.853 0.000 0.000 1.902 0.000 0.000 9.511 0.000 0.000 23.778 0.000 0.000 9.511 0.000 0.000 -9.511 0.000 0.000 -23.778 0.000 0.000 -9.511 0.000 0.000 7.608 0.000 0.000 -5.706 0.000 0.000 0.000 0.000 0.000 -7.608 0.000 0.000 5.706 0.000 0.000 0.000 0.000 0.000 +1.618 0.000 0.000 0.000 0.000 4.045 4.045 0.000 0.000 2.427 0.000 0.000 1.618 0.000 0.000 8.090 0.000 0.000 20.225 0.000 0.000 8.090 0.000 0.000 -8.090 0.000 0.000 -20.225 0.000 0.000 -8.090 0.000 0.000 6.472 0.000 0.000 -4.854 0.000 0.000 0.000 0.000 0.000 -6.472 0.000 0.000 4.854 0.000 0.000 0.000 0.000 0.000 +1.176 0.000 0.000 0.000 0.000 2.940 2.940 0.000 0.000 1.764 0.000 0.000 1.176 0.000 0.000 5.878 0.000 0.000 14.695 0.000 0.000 5.878 0.000 0.000 -5.878 0.000 0.000 -14.695 0.000 0.000 -5.878 0.000 0.000 4.702 0.000 0.000 -3.526 0.000 0.000 0.000 0.000 0.000 -4.702 0.000 0.000 3.526 0.000 0.000 0.000 0.000 0.000 +0.618 0.000 0.000 0.000 0.000 1.545 1.545 0.000 0.000 0.927 0.000 0.000 0.618 0.000 0.000 3.090 0.000 0.000 7.725 0.000 0.000 3.090 0.000 0.000 -3.090 0.000 0.000 -7.725 0.000 0.000 -3.090 0.000 0.000 2.472 0.000 0.000 -1.854 0.000 0.000 0.000 0.000 0.000 -2.472 0.000 0.000 1.854 0.000 0.000 0.000 0.000 0.000 +0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 +-0.618 0.000 0.000 0.000 0.000 -1.545 -1.545 0.000 0.000 -0.927 0.000 0.000 -0.618 0.000 0.000 -3.090 0.000 0.000 -7.725 0.000 0.000 -3.090 0.000 0.000 3.090 0.000 0.000 7.725 0.000 0.000 3.090 0.000 0.000 -2.472 0.000 0.000 1.854 0.000 0.000 0.000 0.000 0.000 2.472 0.000 0.000 -1.854 0.000 0.000 0.000 0.000 0.000 +-1.176 0.000 0.000 0.000 0.000 -2.940 -2.940 0.000 0.000 -1.764 0.000 0.000 -1.176 0.000 0.000 -5.878 0.000 0.000 -14.695 0.000 0.000 -5.878 0.000 0.000 5.878 0.000 0.000 14.695 0.000 0.000 5.878 0.000 0.000 -4.702 0.000 0.000 3.526 0.000 0.000 0.000 0.000 0.000 4.702 0.000 0.000 -3.526 0.000 0.000 0.000 0.000 0.000 +-1.618 0.000 0.000 0.000 0.000 -4.045 -4.045 0.000 0.000 -2.427 0.000 0.000 -1.618 0.000 0.000 -8.090 0.000 0.000 -20.225 0.000 0.000 -8.090 0.000 0.000 8.090 0.000 0.000 20.225 0.000 0.000 8.090 0.000 0.000 -6.472 0.000 0.000 4.854 0.000 0.000 0.000 0.000 0.000 6.472 0.000 0.000 -4.854 0.000 0.000 0.000 0.000 0.000 +-1.902 0.000 0.000 0.000 0.000 -4.755 -4.755 0.000 0.000 -2.853 0.000 0.000 -1.902 0.000 0.000 -9.511 0.000 0.000 -23.778 0.000 0.000 -9.511 0.000 0.000 9.511 0.000 0.000 23.778 0.000 0.000 9.511 0.000 0.000 -7.608 0.000 0.000 5.706 0.000 0.000 0.000 0.000 0.000 7.608 0.000 0.000 -5.706 0.000 0.000 0.000 0.000 0.000 +-2.000 0.000 0.000 0.000 0.000 -5.000 -5.000 0.000 0.000 -3.000 0.000 0.000 -2.000 0.000 0.000 -10.000 0.000 0.000 -25.000 0.000 0.000 -10.000 0.000 0.000 10.000 0.000 0.000 25.000 0.000 0.000 10.000 0.000 0.000 -8.000 0.000 0.000 6.000 0.000 0.000 0.000 0.000 0.000 8.000 0.000 0.000 -6.000 0.000 0.000 0.000 0.000 0.000 +-1.902 0.000 0.000 0.000 0.000 -4.755 -4.755 0.000 0.000 -2.853 0.000 0.000 -1.902 0.000 0.000 -9.511 0.000 0.000 -23.778 0.000 0.000 -9.511 0.000 0.000 9.511 0.000 0.000 23.778 0.000 0.000 9.511 0.000 0.000 -7.608 0.000 0.000 5.706 0.000 0.000 0.000 0.000 0.000 7.608 0.000 0.000 -5.706 0.000 0.000 0.000 0.000 0.000 +-1.618 0.000 0.000 0.000 0.000 -4.045 -4.045 0.000 0.000 -2.427 0.000 0.000 -1.618 0.000 0.000 -8.090 0.000 0.000 -20.225 0.000 0.000 -8.090 0.000 0.000 8.090 0.000 0.000 20.225 0.000 0.000 8.090 0.000 0.000 -6.472 0.000 0.000 4.854 0.000 0.000 0.000 0.000 0.000 6.472 0.000 0.000 -4.854 0.000 0.000 0.000 0.000 0.000 +-1.176 0.000 0.000 0.000 0.000 -2.940 -2.940 0.000 0.000 -1.764 0.000 0.000 -1.176 0.000 0.000 -5.878 0.000 0.000 -14.695 0.000 0.000 -5.878 0.000 0.000 5.878 0.000 0.000 14.695 0.000 0.000 5.878 0.000 0.000 -4.702 0.000 0.000 3.526 0.000 0.000 0.000 0.000 0.000 4.702 0.000 0.000 -3.526 0.000 0.000 0.000 0.000 0.000 +-0.618 0.000 0.000 0.000 0.000 -1.545 -1.545 0.000 0.000 -0.927 0.000 0.000 -0.618 0.000 0.000 -3.090 0.000 0.000 -7.725 0.000 0.000 -3.090 0.000 0.000 3.090 0.000 0.000 7.725 0.000 0.000 3.090 0.000 0.000 -2.472 0.000 0.000 1.854 0.000 0.000 0.000 0.000 0.000 2.472 0.000 0.000 -1.854 0.000 0.000 0.000 0.000 0.000 diff --git a/dance_loop.bvh b/dance_loop.bvh new file mode 100644 index 0000000..9a92f6d --- /dev/null +++ b/dance_loop.bvh @@ -0,0 +1,86 @@ +HIERARCHY +ROOT Hips +{ + OFFSET 0.000 0.000 0.000 + CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation + JOINT Spine + { + OFFSET 0.000 10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT Neck + { + OFFSET 0.000 10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT Head + { + OFFSET 0.000 10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + End Site + { + OFFSET 0.000 5.000 0.000 + } + } + } + JOINT LeftShoulder + { + OFFSET -5.000 10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT LeftArm + { + OFFSET -10.000 0.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT LeftForeArm + { + OFFSET -10.000 0.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + End Site + { + OFFSET -5.000 0.000 0.000 + } + } + } + } + JOINT RightShoulder + { + OFFSET 5.000 10.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT RightArm + { + OFFSET 10.000 0.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + JOINT RightForeArm + { + OFFSET 10.000 0.000 0.000 + CHANNELS 3 Zrotation Xrotation Yrotation + End Site + { + OFFSET 5.000 0.000 0.000 + } + } + } + } + } +} +MOTION +Frames: 20 +Frame Time: 0.0333333 +0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 +0.618 0.000 0.000 0.000 0.000 1.545 1.545 0.000 0.000 0.927 0.000 0.000 0.618 0.000 0.000 3.090 0.000 0.000 7.725 0.000 0.000 3.090 0.000 0.000 -3.090 0.000 0.000 -7.725 0.000 0.000 -3.090 0.000 0.000 +1.176 0.000 0.000 0.000 0.000 2.940 2.940 0.000 0.000 1.764 0.000 0.000 1.176 0.000 0.000 5.878 0.000 0.000 14.695 0.000 0.000 5.878 0.000 0.000 -5.878 0.000 0.000 -14.695 0.000 0.000 -5.878 0.000 0.000 +1.618 0.000 0.000 0.000 0.000 4.045 4.045 0.000 0.000 2.427 0.000 0.000 1.618 0.000 0.000 8.090 0.000 0.000 20.225 0.000 0.000 8.090 0.000 0.000 -8.090 0.000 0.000 -20.225 0.000 0.000 -8.090 0.000 0.000 +1.902 0.000 0.000 0.000 0.000 4.755 4.755 0.000 0.000 2.853 0.000 0.000 1.902 0.000 0.000 9.511 0.000 0.000 23.778 0.000 0.000 9.511 0.000 0.000 -9.511 0.000 0.000 -23.778 0.000 0.000 -9.511 0.000 0.000 +2.000 0.000 0.000 0.000 0.000 5.000 5.000 0.000 0.000 3.000 0.000 0.000 2.000 0.000 0.000 10.000 0.000 0.000 25.000 0.000 0.000 10.000 0.000 0.000 -10.000 0.000 0.000 -25.000 0.000 0.000 -10.000 0.000 0.000 +1.902 0.000 0.000 0.000 0.000 4.755 4.755 0.000 0.000 2.853 0.000 0.000 1.902 0.000 0.000 9.511 0.000 0.000 23.778 0.000 0.000 9.511 0.000 0.000 -9.511 0.000 0.000 -23.778 0.000 0.000 -9.511 0.000 0.000 +1.618 0.000 0.000 0.000 0.000 4.045 4.045 0.000 0.000 2.427 0.000 0.000 1.618 0.000 0.000 8.090 0.000 0.000 20.225 0.000 0.000 8.090 0.000 0.000 -8.090 0.000 0.000 -20.225 0.000 0.000 -8.090 0.000 0.000 +1.176 0.000 0.000 0.000 0.000 2.940 2.940 0.000 0.000 1.764 0.000 0.000 1.176 0.000 0.000 5.878 0.000 0.000 14.695 0.000 0.000 5.878 0.000 0.000 -5.878 0.000 0.000 -14.695 0.000 0.000 -5.878 0.000 0.000 +0.618 0.000 0.000 0.000 0.000 1.545 1.545 0.000 0.000 0.927 0.000 0.000 0.618 0.000 0.000 3.090 0.000 0.000 7.725 0.000 0.000 3.090 0.000 0.000 -3.090 0.000 0.000 -7.725 0.000 0.000 -3.090 0.000 0.000 +0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 +-0.618 0.000 0.000 0.000 0.000 -1.545 -1.545 0.000 0.000 -0.927 0.000 0.000 -0.618 0.000 0.000 -3.090 0.000 0.000 -7.725 0.000 0.000 -3.090 0.000 0.000 3.090 0.000 0.000 7.725 0.000 0.000 3.090 0.000 0.000 +-1.176 0.000 0.000 0.000 0.000 -2.940 -2.940 0.000 0.000 -1.764 0.000 0.000 -1.176 0.000 0.000 -5.878 0.000 0.000 -14.695 0.000 0.000 -5.878 0.000 0.000 5.878 0.000 0.000 14.695 0.000 0.000 5.878 0.000 0.000 +-1.618 0.000 0.000 0.000 0.000 -4.045 -4.045 0.000 0.000 -2.427 0.000 0.000 -1.618 0.000 0.000 -8.090 0.000 0.000 -20.225 0.000 0.000 -8.090 0.000 0.000 8.090 0.000 0.000 20.225 0.000 0.000 8.090 0.000 0.000 +-1.902 0.000 0.000 0.000 0.000 -4.755 -4.755 0.000 0.000 -2.853 0.000 0.000 -1.902 0.000 0.000 -9.511 0.000 0.000 -23.778 0.000 0.000 -9.511 0.000 0.000 9.511 0.000 0.000 23.778 0.000 0.000 9.511 0.000 0.000 +-2.000 0.000 0.000 0.000 0.000 -5.000 -5.000 0.000 0.000 -3.000 0.000 0.000 -2.000 0.000 0.000 -10.000 0.000 0.000 -25.000 0.000 0.000 -10.000 0.000 0.000 10.000 0.000 0.000 25.000 0.000 0.000 10.000 0.000 0.000 +-1.902 0.000 0.000 0.000 0.000 -4.755 -4.755 0.000 0.000 -2.853 0.000 0.000 -1.902 0.000 0.000 -9.511 0.000 0.000 -23.778 0.000 0.000 -9.511 0.000 0.000 9.511 0.000 0.000 23.778 0.000 0.000 9.511 0.000 0.000 +-1.618 0.000 0.000 0.000 0.000 -4.045 -4.045 0.000 0.000 -2.427 0.000 0.000 -1.618 0.000 0.000 -8.090 0.000 0.000 -20.225 0.000 0.000 -8.090 0.000 0.000 8.090 0.000 0.000 20.225 0.000 0.000 8.090 0.000 0.000 +-1.176 0.000 0.000 0.000 0.000 -2.940 -2.940 0.000 0.000 -1.764 0.000 0.000 -1.176 0.000 0.000 -5.878 0.000 0.000 -14.695 0.000 0.000 -5.878 0.000 0.000 5.878 0.000 0.000 14.695 0.000 0.000 5.878 0.000 0.000 +-0.618 0.000 0.000 0.000 0.000 -1.545 -1.545 0.000 0.000 -0.927 0.000 0.000 -0.618 0.000 0.000 -3.090 0.000 0.000 -7.725 0.000 0.000 -3.090 0.000 0.000 3.090 0.000 0.000 7.725 0.000 0.000 3.090 0.000 0.000 diff --git a/makebvh.py b/makebvh.py new file mode 100644 index 0000000..3d5152e --- /dev/null +++ b/makebvh.py @@ -0,0 +1,35 @@ +from pathlib import Path +import re + +blend = Path(r"c:\Users\dance\REPO\visualize\RAGURIG\R-G_Rig_v1.0.blend") +data = blend.read_bytes() + +# extract candidate strings (ascii and utf-8-ish) from binary +# keep runs of printable chars (including common japanese utf-8 bytes will be filtered out later) +printables = set(range(0x20, 0x7f)) +strings = [] +cur = bytearray() +for b in data: + if b in printables: + cur.append(b) + else: + if len(cur) >= 3: + strings.append(cur.decode('ascii', errors='ignore')) + cur.clear() +if len(cur) >= 3: + strings.append(cur.decode('ascii', errors='ignore')) + +# filter likely bone/armature-related names +pat = re.compile(r"(?i)(bone|armature|rig|spine|head|neck|shoulder|upper|lower|forearm|hand|thigh|calf|shin|foot|toe|hips|pelvis|root|ik|fk|ctrl|def|pole)") +hits = [s for s in strings if pat.search(s)] + +# de-dupe while preserving order +seen=set(); uniq=[] +for s in hits: + if s not in seen: + seen.add(s); uniq.append(s) + +print("total strings:", len(strings)) +print("hits:", len(uniq)) +for s in uniq[:250]: + print(s) diff --git a/retarget_bvh_to_ragurig.py b/retarget_bvh_to_ragurig.py new file mode 100644 index 0000000..b6d7a8f --- /dev/null +++ b/retarget_bvh_to_ragurig.py @@ -0,0 +1,132 @@ +import bpy +import sys +from pathlib import Path + +def parse_args(argv): + args = {"bvh": None, "delete_source": False} + if "--" in argv: + argv = argv[argv.index("--") + 1 :] + else: + argv = [] + i = 0 + while i < len(argv): + a = argv[i] + if a == "--bvh" and i + 1 < len(argv): + args["bvh"] = argv[i + 1] + i += 2 + continue + if a == "--delete-source": + args["delete_source"] = True + i += 1 + continue + i += 1 + return args + +def find_target_armature(): + preferred = bpy.data.objects.get("R-G MC Rig v1.0") + if preferred and preferred.type == "ARMATURE": + return preferred + candidates = [o for o in bpy.data.objects if o.type == "ARMATURE"] + if not candidates: + return None + candidates.sort(key=lambda o: len(o.data.bones), reverse=True) + return candidates[0] + +def import_bvh(filepath: str): + before = {o.name for o in bpy.data.objects} + bpy.ops.import_anim.bvh(filepath=str(filepath), axis_forward="-Z", axis_up="Y") + after = [o for o in bpy.data.objects if o.name not in before and o.type == "ARMATURE"] + if after: + return after[0] + arms = [o for o in bpy.data.objects if o.type == "ARMATURE"] + for o in arms: + if o.name not in before: + return o + return None + +def ensure_pose(obj): + bpy.context.view_layer.objects.active=obj + if obj.mode!='POSE': + bpy.ops.object.mode_set(mode='POSE') + +def add_copy_rot(target_obj, target_bone, source_obj, source_bone, use_offset=True): + pb=target_obj.pose.bones.get(target_bone) + c=pb.constraints.new(type='COPY_ROTATION') + c.target=source_obj + c.subtarget=source_bone + c.owner_space='WORLD' + c.target_space='WORLD' + c.mix_mode='ADD' if use_offset else 'REPLACE' + c.influence=1.0 + return c + +def add_copy_loc(target_obj, target_bone, source_obj, source_bone): + pb=target_obj.pose.bones.get(target_bone) + c=pb.constraints.new(type='COPY_LOCATION') + c.target=source_obj + c.subtarget=source_bone + c.owner_space='WORLD' + c.target_space='WORLD' + c.influence=1.0 + return c + +def bake(target_obj, frame_start, frame_end): + bpy.ops.nla.bake(frame_start=frame_start, frame_end=frame_end, only_selected=False, visual_keying=True, clear_constraints=True, use_current_action=True, bake_types={'POSE'}) + +def retarget(bvh_path: str, delete_source: bool): + tgt = find_target_armature() + if not tgt: + return "target_not_found" + + src = import_bvh(bvh_path) + if not src: + return "source_not_found" + + ensure_pose(src) + ensure_pose(tgt) + + mapping = { + "Hips": "Hip", + "Spine": "Chest", + "Head": "head", + "LeftArm": "L_Arm", + "LeftForeArm": "L_Arm_Bottom", + "RightArm": "R_Arm", + "RightForeArm": "R_Arm_Bottom", + "LeftUpLeg": "L_Leg", + "LeftLeg": "L_Leg_Bottom", + "RightUpLeg": "R_Leg", + "RightLeg": "R_Leg_Bottom", + } + + applied = 0 + for sb, tb in mapping.items(): + if src.pose.bones.get(sb) and tgt.pose.bones.get(tb): + add_copy_rot(tgt, tb, src, sb, use_offset=True) + if sb == "Hips": + add_copy_loc(tgt, tb, src, sb) + applied += 1 + + scene = bpy.context.scene + if src.animation_data and src.animation_data.action: + fr = src.animation_data.action.frame_range + scene.frame_start = int(fr[0]) + scene.frame_end = int(fr[1]) + + bake(tgt, scene.frame_start, scene.frame_end) + + if delete_source: + bpy.ops.object.mode_set(mode="OBJECT") + bpy.data.objects.remove(src, do_unlink=True) + + return f"ok applied:{applied} frames:{scene.frame_start}-{scene.frame_end}" + +if __name__=='__main__': + args = parse_args(sys.argv) + if not args["bvh"]: + print("missing_bvh") + raise SystemExit(2) + bvh_path = Path(args["bvh"]) + if not bvh_path.is_absolute(): + bvh_path = Path(bpy.path.abspath("//")) / bvh_path + print(retarget(str(bvh_path), bool(args["delete_source"])))