浏览代码

added capture processing and sample capture data and animation clip

/BodyRecording
Dan 5 年前
当前提交
f8f083f9
共有 13 个文件被更改,包括 2983 次插入394 次删除
  1. 985
      Assets/BodyRecording/Scenes/BodyCaptureProcessing.unity
  2. 315
      Assets/BodyRecording/Scenes/BodyRecording.unity
  3. 7
      Assets/BodyRecording/Scripts/BodyEditorRecorder.cs
  4. 22
      Assets/BodyRecording/Scripts/BodyPlayback.cs
  5. 5
      Assets/BodyRecording/Scripts/BodyRuntimeRecorder.cs
  6. 19
      Assets/BodyRecording/Scripts/TrackingManager.cs
  7. 8
      Assets/BodyRecording/Art/Animation/CapturedClip.anim.meta
  8. 1001
      Assets/BodyRecording/Captures/BodyCaptureData copy.txt
  9. 7
      Assets/BodyRecording/Captures/BodyCaptureData copy.txt.meta
  10. 1001
      Assets/BodyRecording/Captures/BodyCaptureData.txt
  11. 7
      Assets/BodyRecording/Captures/BodyCaptureData.txt.meta

985
Assets/BodyRecording/Scenes/BodyCaptureProcessing.unity
文件差异内容过多而无法显示
查看文件

315
Assets/BodyRecording/Scenes/BodyRecording.unity


m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -250, y: 150}
m_AnchoredPosition: {x: -150, y: 200}
m_SizeDelta: {x: 250, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &56387589

- {fileID: 1885562733}
- {fileID: 1822202954}
m_Father: {fileID: 4639637737360137916}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}

m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -250, y: 150}
m_AnchoredPosition: {x: -150, y: 200}
m_SizeDelta: {x: 250, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &353165471

m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 970751607}
m_MethodName: ForceStopRecording
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &353165472
MonoBehaviour:
m_ObjectHideFlags: 0

m_Children:
- {fileID: 1544760639}
m_Father: {fileID: 4639637737360137916}
m_RootOrder: 1
m_RootOrder: 0
m_AnchoredPosition: {x: -250, y: -150}
m_AnchoredPosition: {x: -150, y: -250}
m_SizeDelta: {x: 250, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &718726553

m_RaycastManager: {fileID: 1335839538}
m_HumanBodyManager: {fileID: 1335839540}
m_PlaceObjectsOnPlane: {fileID: 1335839539}
m_UIManager: {fileID: 0}
--- !u!114 &970751607
MonoBehaviour:
m_ObjectHideFlags: 0

m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 250, y: 150}
m_AnchoredPosition: {x: 150, y: 200}
m_SizeDelta: {x: 250, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &971562478

- {fileID: 971562477}
- {fileID: 56387588}
m_Father: {fileID: 4639637737360137916}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}

m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -50, y: -50}
m_AnchoredPosition: {x: -50, y: -150}
m_SizeDelta: {x: 25, y: 25}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!95 &1822202955

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1822202953}
m_CullTransparentMesh: 0
--- !u!222 &1827046856
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1827046859}
m_CullTransparentMesh: 0
--- !u!114 &1827046857
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1827046859}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Playback
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4281479730
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_outlineColor:
serializedVersion: 2
rgba: 4278190080
m_fontSize: 24
m_fontSizeBase: 24
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_textAlignment: 514
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_firstOverflowCharacterIndex: -1
m_linkedTextComponent: {fileID: 0}
m_isLinkedTextComponent: 0
m_isTextTruncated: 0
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_ignoreRectMaskCulling: 0
m_ignoreCulling: 1
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_VertexBufferAutoSizeReduction: 1
m_firstVisibleCharacter: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 1827046857}
characterCount: 8
spriteCount: 0
spaceCount: 0
wordCount: 1
linkCount: 0
lineCount: 1
pageCount: 1
materialCount: 1
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
m_hasFontAssetChanged: 0
m_subTextObjects:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!224 &1827046858
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1827046859}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1928352369}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1827046859
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1827046858}
- component: {fileID: 1827046856}
- component: {fileID: 1827046857}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!1 &1885562732
GameObject:
m_ObjectHideFlags: 0

m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 150}
m_AnchoredPosition: {x: 0, y: 200}
m_SizeDelta: {x: 250, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1885562734

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1885562732}
m_CullTransparentMesh: 0
--- !u!114 &1928352368
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1928352370}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 1928352375}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_MethodName: LoadPlaybackScene
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!224 &1928352369
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1928352370}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1827046858}
m_Father: {fileID: 4639637737360137916}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 104, y: 208}
m_SizeDelta: {x: 161, y: 180}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1928352370
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1928352369}
- component: {fileID: 1928352374}
- component: {fileID: 1928352375}
- component: {fileID: 1928352368}
m_Layer: 5
m_Name: PlaybackSceneButton
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!222 &1928352374
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1928352370}
m_CullTransparentMesh: 0
--- !u!114 &1928352375
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1928352370}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: c6b85e32927794faeb9da0dc7e5c3fa6, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &2120258381
GameObject:
m_ObjectHideFlags: 0

m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1928352369}
- {fileID: 718726552}
- {fileID: 331955341}
- {fileID: 1586249606}

7
Assets/BodyRecording/Scripts/BodyEditorRecorder.cs


{
m_Recorder.SaveToClip(m_Clip);
m_Recorder.ResetRecording();
Debug.Log("Animation Capture Complete");
}
}
#endif

m_Record = !m_Record;
}
public void RecordClip()
{
m_Record = true;
m_BodyPlayback.PlayAnimationOneShot();
}
}

22
Assets/BodyRecording/Scripts/BodyPlayback.cs


[SerializeField]
bool m_PlayingAnimation = false;
[SerializeField]
bool m_RecordToAnimationClip;
BodyEditorRecorder m_BodyEditorRecorder;
bool m_PlayingOneShot = false;
List<Vector3> m_JointPositions;
List<Quaternion> m_JointRotations;

// Editor processing, file playback
else
{
m_BodyEditorRecorder = GetComponent<BodyEditorRecorder>();
if (m_RecordToAnimationClip)
{
m_BodyEditorRecorder.RecordToggle();
m_PlayingAnimation = true;
}
}
SetBodyStartPose();

if (m_JointIndex == m_JointPositions.Count)
{
m_JointIndex = 0;
if (m_InEditor && m_PlayingOneShot)
if (m_InEditor && m_RecordToAnimationClip)
GetComponent<BodyEditorRecorder>().RecordToggle();
m_BodyEditorRecorder.RecordToggle();
}
}
}

}
return retVal / numberOfCapturedPositions;
}
public void PlayAnimationOneShot()
{
m_PlayingAnimation = true;
m_PlayingOneShot = true;
}
}

5
Assets/BodyRecording/Scripts/BodyRuntimeRecorder.cs


}
}
public bool HasData()
public void ForceStopRecording()
return m_JointPositions != null && m_JointPositions.Count > 0;
m_IsRecording = false;
}

19
Assets/BodyRecording/Scripts/TrackingManager.cs


[SerializeField]
PlaceObjectsOnPlane m_PlaceObjectsOnPlane;
[SerializeField]
UIManager m_UIManager;
bool m_FirstWorldTracking = true;
public void SwitchToWorldTracking()
{
SwitchTracking(CurrentTrackingState.WorldTracking);

m_RaycastManager.enabled = true;
m_PlaceObjectsOnPlane.enabled = true;
m_TrackingState = CurrentTrackingState.WorldTracking;
// show instructional UI is enabling world tracking for the first time
if (m_FirstWorldTracking)
{
// uses m_UIManager
if (m_UIManager)
{
m_UIManager.AddToQueue(new UXHandle(UIManager.InstructionUI.CrossPlatformFindAPlane, UIManager.InstructionGoals.FoundAPlane));
m_UIManager.AddToQueue(new UXHandle(UIManager.InstructionUI.TapToPlace, UIManager.InstructionGoals.PlacedAnObject));
}
m_FirstWorldTracking = false;
}
}
}
}

8
Assets/BodyRecording/Art/Animation/CapturedClip.anim.meta


fileFormatVersion: 2
guid: 6330ced51055b469ab1f70c44f7170d0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

1001
Assets/BodyRecording/Captures/BodyCaptureData copy.txt
文件差异内容过多而无法显示
查看文件

7
Assets/BodyRecording/Captures/BodyCaptureData copy.txt.meta


fileFormatVersion: 2
guid: d6d6745d9e8ad44bc807be5e0bda807b
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
Assets/BodyRecording/Captures/BodyCaptureData.txt
文件差异内容过多而无法显示
查看文件

7
Assets/BodyRecording/Captures/BodyCaptureData.txt.meta


fileFormatVersion: 2
guid: c425463213196479b8b45af0212a761f
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存