このページは過去の情報となります。
新しいスクリプトリファレンスはこちらになります。
キャラクターモデル情報を取得するのに必要なクラスです。
ExportCharacter | |
---|---|
名前 | 説明 |
IsAvailable | キャラクターが利用可能か |
GetBoneTransform | ボーンのTransformを取得する |
ExportCharacter.IsAvailable fun(): bool
キャラクターが利用可能か。
キャラクター変更中はfalseとなる。
ExportCharacter.GetBoneTransform fun(boneName: string): usertype
ボーンのTransformを取得する。
boneName | 詳しくはHumanBodyBones を参照 |
---|
table{“position”: Vector3, “rotation”: Quaternion}
無効なボーン名や対応していないボーンを指定した場合はnilが返る。
local player = vci.vc.room.GetAllPlayers()[1] local character = player.Character local previousIsAvailable = character.IsAvailable() -- IsAvailableが変化したタイミングでprintする local function DetectIsAvailableValueChange() if character.IsAvailable() == previousIsAvailable then return end if character.IsAvailable() then print("Character got available.") else print("Character got unavailable.") end previousIsAvailable = character.IsAvailable() end vci.StartCoroutine( coroutine.create( function() while true do DetectIsAvailableValueChange() coroutine.yield() end end )) local bones = { "Hips", "LeftUpperLeg", "RightUpperLeg", "LeftLowerLeg", "RightLowerLeg", "LeftFoot", "RightFoot", "Spine", "Chest", "UpperChest", "Neck", "Head", "LeftShoulder", "RightShoulder", "LeftUpperArm", "RightUpperArm", "LeftLowerArm", "RightLowerArm", "LeftHand", "RightHand", "LeftToes", "RightToes", "LeftEye", "RightEye", "Jaw", "LeftThumbProximal", "LeftThumbIntermediate", "LeftThumbDistal", "LeftIndexProximal", "LeftIndexIntermediate", "LeftIndexDistal", "LeftMiddleProximal", "LeftMiddleIntermediate", "LeftMiddleDistal", "LeftRingProximal", "LeftRingIntermediate", "LeftRingDistal", "LeftLittleProximal", "LeftLittleIntermediate", "LeftLittleDistal", "RightThumbProximal", "RightThumbIntermediate", "RightThumbDistal", "RightIndexProximal", "RightIndexIntermediate", "RightIndexDistal", "RightMiddleProximal", "RightMiddleIntermediate", "RightMiddleDistal", "RightRingProximal", "RightRingIntermediate", "RightRingDistal", "RightLittleProximal", "RightLittleIntermediate", "RightLittleDistal" } for k,v in pairs(bones) do local transform = character.GetBoneTransform(v) -- {"position": Vector3, "rotation": Quaternion} if transform == nil then print("bone is not found: "..v) else print(v.."\nposition:"..tostring(transform["position"]).."\nrotation: "..tostring(transform["rotation"])) end end