### Basic KawaiiPhysics Node Setup in AnimGraph Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Integrate the KawaiiPhysics node into your AnimGraph by connecting it after your existing animation. Configure the Root Bone and basic physics parameters in the Details panel. ```blueprint // AnimGraph接続イメージ [既存のアニメーション(例: Run)] ↓ [KawaiiPhysics ノード] ↓ [Final Animation Pose] // KawaiiPhysicsノード 基本設定(Details パネル) Modify Target: Root Bone = "hair_root" // 揺らしたいボーンチェーンの根元 Dummy Bone Length = 5.0 // 末端ボーンの制御改善(短いチェーンに有効) Bone Forward Axis = Y+ // ボーン前方向 Physics Settings: Damping = 0.15 // 減衰(大きいほど速く収束) Stiffness = 0.05 // 剛性(大きいほど元の形を維持) World Damping Location = 0.7 // 移動時の安定性 World Damping Rotation = 0.7 // 回転時の安定性 Collision Radius = 1.5 // 各ボーンのコリジョン半径 Limit Angle = 45.0 // 回転制限(荒ぶり防止) Target Frame Rate = 60 // 目標フレームレート Warm Up Frames = 5 // 初期化用の空回し回数 Teleport Distance Threshold = 300 // 瞬間移動検出しきい値(これ以上移動時は物理リセット) ``` -------------------------------- ### KawaiiPhysics Parameter Examples for Different Assets Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Provides reference parameter values for common assets like long hair, ponytails, skirts, earrings, and weapons. Includes troubleshooting tips for common issues like excessive shaking or stiffness. ```ini // 用途別パラメータ参考値 // ロングヘア Damping = 0.15 // 0.1〜0.2 Stiffness = 0.07 // 0.05〜0.1 World Damping Location = 0.7 // 0.6〜0.8 World Damping Rotation = 0.7 // 0.6〜0.8 Gravity = (0.0, 0.0, -0.5) // 軽めの重力 // ポニーテール Damping = 0.2 // 0.15〜0.25 Stiffness = 0.15 // 0.1〜0.2 World Damping Location = 0.8 // 0.7〜0.9 Limit Angle = 45.0 // 30〜60 // スカート Damping = 0.25 // 0.2〜0.3 Stiffness = 0.15 // 0.1〜0.2 World Damping Location = 0.8 // 0.7〜0.9 World Damping Rotation = 0.8 Limit Angle = 60.0 // 45〜90 Gravity = (0.0, 0.0, -0.3) // イヤリング Damping = 0.15 // 0.1〜0.2 Stiffness = 0.07 // 0.05〜0.1 World Damping Location = 0.6 // 0.5〜0.7 Dummy Bone Length = 4.0 // 3〜5(短いチェーン用) Gravity = (0.0, 0.0, -0.8) // 武器(剣・杖) Damping = 0.4 // 0.3〜0.5 Stiffness = 0.4 // 0.3〜0.5 World Damping Location = 0.9 // 0.8〜1.0 Limit Angle = 20.0 // 10〜30 // トラブルシューティング // 揺れすぎる → World Damping Location/Rotation を 0.8〜1.0 に上げる // 硬すぎる → Stiffness を 0.01〜0.05 に下げる // 収まらない → Damping を 0.3〜0.5 に上げる // 瞬間移動で荒ぶる → Teleport Distance Threshold を下げる ``` -------------------------------- ### Curve Data Examples for Physics Parameters Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Defines how curve data can be used to modify physics parameters like stiffness, damping, and radius based on bone distance from the root. Useful for creating natural motion, such as softer hair tips or reduced skirt collision at the hem. ```plaintext // Curve Data 計算式 // 係数 = RootBoneから対象ボーンまでの長さ / RootBoneから末端ボーンまでの長さ(0.0〜1.0) // 最終値 = 設定値 × カーブの値(係数における) // 例1:髪の毛先を柔らかくする(Stiffness Curve Data) Stiffness Curve Data: Point[0]: Time=0.0, Value=1.0 // 根元: Stiffnessを100%適用 Point[1]: Time=1.0, Value=0.3 // 毛先: Stiffnessを30%に削減 // 例2:毛先の揺れを大きくする(Damping Curve Data) Damping Curve Data: Point[0]: Time=0.0, Value=1.0 // 根元: Dampingを100%適用 Point[1]: Time=1.0, Value=0.5 // 毛先: Dampingを50%に削減(より揺れる) // 例3:スカートの裾のコリジョンを小さくする(Radius Curve Data) Radius Curve Data: Point[0]: Time=0.0, Value=1.0 // 腰: Radiusを100%適用 Point[1]: Time=1.0, Value=0.4 // 裾: Radiusを40%に削減 // 例4:Limit Angle Curve Data(先端の可動域を広げる) Limit Angle Curve Data: Point[0]: Time=0.0, Value=0.5 // 根元: Limit Angleを50%に制限 Point[1]: Time=1.0, Value=1.0 // 先端: Limit Angleを100%適用(広く揺れる) // 利用可能なCurve Data種類 // - Damping Curve Data // - Stiffness Curve Data // - World Damping Location Curve Data // - World Damping Rotation Curve Data // - Radius Curve Data(Collision Radius補正) // - Limit Angle Curve Data ``` -------------------------------- ### Configure Basic External Forces Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Set up gravity, simple directional forces, and wind effects. Gravity can be world-space fixed or use project settings. Wind requires a WindDirectionalSource actor. ```plaintext External Force: Gravity = (0.0, 0.0, -0.5) // X, Y, Z方向の重力ベクトル Use World Space Gravity Direction = true // ワールド空間で重力方向を固定(v1.20) Use Default Gravity Z Project Setting = false // プロジェクトのGravityZ値を乗算 Simple External Force = (5.0, 0.0, 0.0) // X方向に一定の力 Use World Space Simple External Force = true Enable Wind = true Wind Scale = 1.5 // 風の影響度 Wind Direction Noise = 0.3 // 風向きのランダム性(v1.19追加) // ※ レベルにWindDirectionalSourceを配置することで有効 ``` -------------------------------- ### Sharing Bone Constraints via Data Asset Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Demonstrates how to share Bone Constraint configurations using a Data Asset, including support for pattern-based bone selection (regex). Provides performance hints like reducing iteration counts. ```plaintext // DataAssetで共有(正規表現ベースのボーン指定にも対応) Bone Constraints Data Asset = DA_SkirtConstraints // DA_SkirtConstraints内でのボーン指定例(正規表現) // Bone1 Pattern: "skirt_.*_01" // Bone2 Pattern: "skirt_.*_02" (隣接チェーンを自動マッチング) // パフォーマンスヒント // - Constraint Iteration Count を下げる(1に削減で負荷軽減) // - Update Physics Settings In Game = false(ゲーム中に変更しない場合) ``` -------------------------------- ### Recommended Combination: Sync Bone and Capsule Limits Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Suggests combining Sync Bone for general pose matching with Capsule Limits for detailed collision prevention to resolve skirt-leg penetration issues effectively. ```plaintext // 組み合わせ推奨:Sync Bone + Capsule Limits // Sync Bone → 足の動きにスカートを同期させる(大まかな追従) // Capsule Limits → 細かいコリジョンで貫通を物理的に防ぐ ``` -------------------------------- ### Share Parameters with Data Assets Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Create and reference Data Assets for KawaiiPhysicsLimitsDataAsset and KawaiiPhysicsBoneConstraintsDataAsset to share settings across multiple Animation Blueprints or characters. Supports regex for bone naming. ```plaintext // DataAsset作成手順 // 1. Content Browserで右クリック → Miscellaneous → Data Asset // 2. クラスに "KawaiiPhysicsLimitsDataAsset" または // "KawaiiPhysicsBoneConstraintsDataAsset" を選択 // 3. 設定を入力して保存 // AnimBPノードでDataAssetを参照 Limits Data Asset = DA_CharacterHairCollision Bone Constraints Data Asset = DA_SkirtConstraints // 複数キャラクターへの適用例 // DA_HumanHairCollision → 全人型キャラクターで共有 // DA_BeastTailCollision → 獣型キャラクターで共有 // BoneConstraints DataAssetでの正規表現ボーン指定(複数チェーンを自動登録) // 例:スカートボーンのパターンで隣接チェーンを自動設定 Bone1 Pattern = "skirt_[0-9]+_L" Bone2 Pattern = "skirt_[0-9]+_R" ``` -------------------------------- ### Bone Constraint Basic Settings Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Configures the fundamental settings for Bone Constraints, including global compliance type and iteration counts for physics calculations before and after collision. Enables automatic addition of child dummy bone constraints. ```plaintext // Bone Constraint 基本設定 Bone Constraint: Global Compliance Type = Soft // Soft / Hard Constraint Iteration Count (Before Collision) = 2 Constraint Iteration Count (After Collision) = 1 Auto Add Child Dummy Bone Constraint = true ``` -------------------------------- ### Debug Kawaii Physics with Console Variables Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Use console variables to toggle Kawaii Physics on/off and enable debug visualizations, including bone length rate. ```plaintext // KawaiiPhysicsの有効/無効切り替え a.AnimNode.KawaiiPhysics.Enable 0 // 無効 a.AnimNode.KawaiiPhysics.Enable 1 // 有効 // デバッグビジュアライゼーション表示 a.AnimNode.KawaiiPhysics.Debug 1 // ボーン長さ比のデバッグ表示 a.AnimNode.KawaiiPhysics.Debug.LengthRate 1 ``` -------------------------------- ### Multiple Root Bone Configuration in KawaiiPhysics Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Configure multiple root bones for physics simulation, allowing for more granular control over different parts of a character's mesh. Use 'Exclude Bones' to prevent specific bone chains from being simulated. ```blueprint // 複数Root Bone設定(v1.17以降) Modify Target: Root Bones: [0] = "hair_front_root" // 前髪 [1] = "hair_side_L_root" // 左サイド [2] = "hair_side_R_root" // 右サイド Exclude Bones: [0] = "hair_accessory" // 除外するボーン(そのボーン以下も除外) Dummy Bone Length = 8.0 // ツインテール:左右を別ノードで設定するAnimGraph構成 [既存アニメーション] ↓ [KawaiiPhysics: Root Bone = "twintail_L_root"] ↓ [KawaiiPhysics: Root Bone = "twintail_R_root"] ↓ [Final Animation Pose] ``` -------------------------------- ### Sync Bone Configuration for Skirt Penetration Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Sets up Sync Bones to reflect the reference bone's pose changes onto target bones, preventing skirt-leg penetration without ControlRig or PoseDriver. Defines source bone, target bones, influence distance, ratio, and amount. ```plaintext // Sync Bone 設定(スカートの足貫通対策) Sync Bones: [0]: Source Bone = "thigh_L" // 参照ボーン(左足) Target Bones: [0] = "skirt_L_01" [1] = "skirt_front_01" Distance = 20.0 // 影響範囲(この距離内のTargetBoneに適用) Ratio = 0.8 // 移動量の反映率 Amount = 1.0 // 移動量のスケール [1]: Source Bone = "thigh_R" // 参照ボーン(右足) Target Bones: [0] = "skirt_R_01" [1] = "skirt_front_01" Distance = 20.0 Ratio = 0.8 Amount = 1.0 ``` -------------------------------- ### Implement Custom External Force in C++ Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Define a custom external force by inheriting from FKawaiiPhysicsExternalForce and implementing the Apply function. This allows for unique force logic that can be configured in the AnimBP details panel. ```cpp // カスタム外力クラスの定義例 // MyKawaiiExternalForce.h #pragma once #include "KawaiiPhysicsExternalForce.h" #include "MyKawaiiExternalForce.generated.h" USTRUCT(BlueprintType, DisplayName = "My Custom Force") struct FMyKawaiiExternalForce : public FKawaiiPhysicsExternalForce { GENERATED_BODY() // 外力の強さ(Detailsパネルで編集可能) UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "MyForce") float ForceStrength = 100.0f; // 外力の方向(ローカル座標) UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "MyForce") FVector ForceDirection = FVector(1.0f, 0.0f, 0.0f); // 毎フレーム呼ばれる外力適用関数 virtual void Apply( FKawaiiPhysicsModifyBone& Bone, const FAnimNode_KawaiiPhysics& Node, const FComponentSpacePoseContext& PoseContext, const FTransform& BoneTransform) override { // 外力をボーンに適用 Bone.ExternalForce += ForceDirection.GetSafeNormal() * ForceStrength; } }; // AnimBP Detailsパネルでの設定 External Forces: [0] (My Custom Force): // 上記クラスがプルダウンに追加される Force Strength = 150.0 Force Direction = (0.5, 0.0, 0.5) Apply Bone Filter: ["hair_side_L", "hair_side_R"] ``` -------------------------------- ### AnimGraphの構成例 Source: https://github.com/pafuhana1213/kawaiiphysics/wiki/Tutorial-Hair ツインテール設定時に、左右それぞれにKawaiiPhysicsノードを使用し、AnimGraphでそれらを連結する構成例です。 ```blueprint [既存アニメーション] → [KawaiiPhysics (左)] → [KawaiiPhysics (右)] → [Final Animation Pose] ``` -------------------------------- ### Simulation Space Settings in KawaiiPhysics Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Choose the simulation coordinate system to resolve issues like jittering on elevators or during rapid rotations. Adjust 'Skeletal Component Movement Scale' to control the influence of the skeletal component's movement on physics. ```blueprint // Simulation Space 選択肢と使用場面 Simulation Space: Component Space // デフォルト。一般的なケース World Space // エレベーター・移動プラットフォーム上での安定動作 // 1フレーム内で180度回転するキャラクターに有効 Base Bone Space // ベースボーン基準の座標系 // 関連パラメータ(v1.19追加) Skeletal Component Movement Scale = 0.5 // SkeletalMeshComponentの移動が物理に与える影響度(0.0〜1.0) // エレベーター上での過剰反応を抑制 // 使用例:エレベーター上でのキャラクター Simulation Space = World Space Skeletal Component Movement Scale = 0.3 World Damping Location = 0.9 ``` -------------------------------- ### Configure External Forces Presets Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Define presets for external forces, including direction, rate, interval, bone filtering, and random scaling. Presets can also reference character gravity settings or use curves for time-varying forces. ```plaintext External Forces: [0] (Basic): Force Dir = (1.0, 0.0, 0.0) // 外力の方向 Force Rate = 100.0 Interval = 0.5 // 外力を適用する間隔(秒) Apply Bone Filter: ["hair_front"] // 前髪のみに適用 Random Force Scale = (0.5, 1.5) // ランダムスケール範囲 [1] (Gravity): Use Character Gravity Direction = true // キャラクターのGravityDirection参照 Use Character Gravity Scale = true // キャラクターのGravityScale参照 [2] (Curve): Force Curve: Point[0]: Time=0.0, Value=0.0 Point[0]: Time=0.5, Value=200.0 Point[1]: Time=1.0, Value=0.0 // 0.5秒でピーク、1秒で消える外力 Time Scale = 1.0 Substep Count = 2 Curve Evaluate Type = Loop // Loop / Once / PingPong ``` -------------------------------- ### Planar Limits Configuration Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Sets up planar collision volumes, useful for preventing penetration in areas like the back. Define the driving bone, offset location, and offset rotation (normal direction). ```plaintext Planar Limits: [0]: Driving Bone = "spine_01" Offset Location = (0.0, -5.0, 0.0) Offset Rotation = (0.0, 0.0, 0.0) // 平面の法線方向 ``` -------------------------------- ### Capsule Limits Configuration Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Configures capsule-shaped collision volumes for bones like legs and arms to prevent body penetration. Requires driving bone, offset, radius, and length. ```plaintext Capsule Limits: [0]: Driving Bone = "thigh_L" // 左太もも Offset Location = (0.0, 0.0, -15.0) Radius = 8.0 Length = 30.0 [1]: Driving Bone = "thigh_R" // 右太もも Offset Location = (0.0, 0.0, -15.0) Radius = 8.0 Length = 30.0 ``` -------------------------------- ### AnimGraph構成例: 複数のアクセサリー Source: https://github.com/pafuhana1213/kawaiiphysics/wiki/Tutorial-Accessories キャラクターに複数の揺れ物がある場合、KawaiiPhysicsノードを順番に適用するAnimGraphの構成例です。パフォーマンスを考慮し、ノードの数を最小限に抑えることが推奨されます。 ```blueprint [既存アニメーション] ↓ [KawaiiPhysics: 髪] ↓ [KawaiiPhysics: イヤリング左] ↓ [KawaiiPhysics: イヤリング右] ↓ [KawaiiPhysics: リボン] ↓ [Final Animation Pose] ``` -------------------------------- ### Filter Physics Nodes with Gameplay Tags Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Assign Gameplay Tags to Kawaii Physics nodes to identify and control specific nodes when multiple physics systems are present, allowing for targeted alpha value adjustments. ```plaintext // Gameplay Tag設定 // 複数のKawaiiPhysicsノードがある場合に特定ノードのみを操作 KawaiiPhysics Tag = "Physics.Hair.Front" // 前髪ノードのタグ KawaiiPhysics Tag = "Physics.Hair.Back" // 後ろ髪ノードのタグ KawaiiPhysics Tag = "Physics.Skirt" // スカートノードのタグ // Blueprint経由でタグ指定してAlphaを変更 // KawaiiPhysicsノードをGameplay Tagで検索し、特定ノードのみを制御可能 ``` -------------------------------- ### Control Physics with AnimNotifyState Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Use AnimNotifyState to override the Alpha value of Kawaii Physics during specific animation segments, effectively enabling or disabling physics for cutscenes or specific actions. ```plaintext // AnimNotifyState: Set Alpha(v1.20追加) // アニメーションの特定区間でAlpha値をオーバーライド // 使用例:カットシーン中は物理を無効化 AnimNotify使用手順: 1. アニメーションシーケンスを開く 2. Notifiesトラックに "KawaiiPhysics Set Alpha" を追加 3. 区間を指定(例:0.2秒〜1.8秒) 4. Alpha値を設定(0.0 = 物理無効、1.0 = 通常) → カットシーン中:Alpha = 0.0 → 特定アクション中:Alpha = 0.5(物理を半減) ``` -------------------------------- ### Add KawaiiPhysics Node to AnimGraph Source: https://github.com/pafuhana1213/kawaiiphysics/wiki/Quick-Start Add the KawaiiPhysics node within the AnimGraph and connect its output to the Final Animation Pose. This is the core step for integrating physics simulation into your animation. ```text [既存のアニメーション] → [KawaiiPhysics] → [Final Animation Pose] ``` -------------------------------- ### Defining Bone Constraints Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Lists specific pairs of bones that should maintain their distance using Bone Constraints. This is particularly effective for clothing like skirts and capes. ```plaintext Bone Constraints: [0]: Bone1 = "skirt_front_01" Bone2 = "skirt_L_01" [1]: Bone1 = "skirt_L_01" Bone2 = "skirt_back_01" [2]: Bone1 = "skirt_back_01" Bone2 = "skirt_R_01" [3]: Bone1 = "skirt_R_01" Bone2 = "skirt_front_01" ``` -------------------------------- ### Configure World Collision Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Enable or disable collision with level geometry. This feature is performance-intensive and should be used judiciously. You can override parameters and ignore specific bones or bone prefixes. ```plaintext World Collision: Allow World Collision = true // 有効化(注意:負荷大) Override Collision Params = true // 独自コリジョン設定を使用 Ignore Self Component = true // 自身のPhysicsAssetを無視 Ignore Bones: [0] = "hair_back_01" // このボーンのコリジョンを無視 [1] = "hair_back_02" Ignore Bone Name Prefix = "hair_back" // "hair_back"で始まるボーンを全て無視 ``` -------------------------------- ### Spherical Limits Configuration Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Sets up spherical collision volumes to prevent bone penetration, typically used for areas like the head. Specify the driving bone, offset, radius, and limit type (Outer/Inner). ```plaintext Spherical Limits: [0]: Driving Bone = "head" // 追従するボーン Offset Location = (0.0, 0.0, 5.0) // 頭のボーン原点からのオフセット Radius = 15.0 // 球の半径 Limit Type = Outer // Outer=外側に押し出し、Inner=内側に閉じ込め [1]: Driving Bone = "head" Offset Location = (0.0, -5.0, 0.0) // 後頭部 Radius = 12.0 ``` -------------------------------- ### Sharing Limits Data Asset Source: https://context7.com/pafuhana1213/kawaiiphysics/llms.txt Specifies a Data Asset to share collision settings across different Anim Blueprints. Also notes that limits can be exported to a Data Asset from the Details panel. ```plaintext // DataAssetでコリジョン設定を共有 Limits Data Asset = DA_HairCollision // 別のAnimBPでも同じ設定を流用 // v1.16追加:DetailsパネルのExportボタンでLimitsをDataAssetに書き出し可能 // v1.20追加:BoxコリジョンのビューポートVisualization対応 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.