Netcode Bootstrap
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
|
||||
<ui:VisualElement style="flex-grow: 1; flex-direction: row;">
|
||||
<ui:Label tabindex="-1" text="Hash" parse-escape-sequences="true" display-tooltip-when-elided="true" name="nameHashLabel" style="width: 254px; border-right-color: rgb(127, 127, 127); border-right-width: 1px;" />
|
||||
<ui:Label tabindex="-1" text="Name" parse-escape-sequences="true" display-tooltip-when-elided="true" name="nameLabel" style="flex-grow: 1; border-right-color: rgb(127, 127, 127); border-right-width: 1px;" />
|
||||
<ui:Label tabindex="-1" text="Parent bone index" parse-escape-sequences="true" display-tooltip-when-elided="true" name="parentBoneIndexLabel" style="flex-grow: 0; width: 402px; border-right-color: rgb(127, 127, 127); border-right-width: 1px;" />
|
||||
<ui:Label tabindex="-1" text="Human body part" parse-escape-sequences="true" display-tooltip-when-elided="true" name="humanBodyPartLabel" style="width: 116px;" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f01028b80e61b104387c8488a086244d
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 298480
|
||||
packageName: Rukhanka Animation System 2
|
||||
packageVersion: 2.9.0
|
||||
assetPath: Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/RigBlobInfoWindow/BoneInfoAsset.uxml
|
||||
uploadId: 897522
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
|
||||
<ui:VisualElement style="flex-grow: 1; flex-direction: row;">
|
||||
<ui:Label tabindex="-1" text="Human body part" parse-escape-sequences="true" display-tooltip-when-elided="true" name="humanBodyPartLabel" style="flex-grow: 1; border-right-color: rgb(127, 127, 127); border-right-width: 1px;" />
|
||||
<ui:Label tabindex="-1" text="Rig bone index" parse-escape-sequences="true" display-tooltip-when-elided="true" name="rigBoneIndexLabel" style="width: 254px; border-right-color: rgb(127, 127, 127); border-right-width: 1px;" />
|
||||
<ui:Label tabindex="-1" text="Min muscle angles" parse-escape-sequences="true" display-tooltip-when-elided="true" name="minMuscleAnglesLabel" style="flex-grow: 0; width: 200px; border-right-color: rgb(127, 127, 127); border-right-width: 1px;" />
|
||||
<ui:Label tabindex="-1" text="Max muscle angles" parse-escape-sequences="true" display-tooltip-when-elided="true" name="maxMuscleAnglesLabel" style="width: 200px;" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: af24eed8b4ebfc740b48cd86284380b0
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 298480
|
||||
packageName: Rukhanka Animation System 2
|
||||
packageVersion: 2.9.0
|
||||
assetPath: Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/RigBlobInfoWindow/HumanBoneInfoAsset.uxml
|
||||
uploadId: 897522
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
using Rukhanka.Toolbox;
|
||||
using Unity.Mathematics;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Rukhanka.Editor
|
||||
{
|
||||
public class RigBlobInfoWindow : EditorWindow
|
||||
{
|
||||
[SerializeField]
|
||||
private VisualTreeAsset visualTreeAsset = default;
|
||||
|
||||
[SerializeField]
|
||||
private VisualTreeAsset boneInfoAsset = default;
|
||||
|
||||
[SerializeField]
|
||||
private VisualTreeAsset humanBoneInfoAsset = default;
|
||||
|
||||
[SerializeField]
|
||||
private VisualTreeAsset entityRefAsset = default;
|
||||
|
||||
internal static BlobInspector.BlobAssetInfo<RigDefinitionBlob> rigBlob;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public void CreateGUI()
|
||||
{
|
||||
var root = rootVisualElement;
|
||||
var doc = visualTreeAsset.Instantiate();
|
||||
root.Add(doc);
|
||||
|
||||
titleContent = new GUIContent("Rukhanka.Animation Rig Info");
|
||||
FillRigInfo();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
unsafe void FillRigInfo()
|
||||
{
|
||||
ref var b = ref rigBlob.blobAsset.Value;
|
||||
var hashLabel = rootVisualElement.Q<Label>("hashLabel");
|
||||
hashLabel.text = b.hash.ToString();
|
||||
|
||||
var nameLabel = rootVisualElement.Q<Label>("nameLabel");
|
||||
var bakingTimeLabel = rootVisualElement.Q<Label>("bakingTimeLabel");
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
nameLabel.text = b.name.ToString();
|
||||
bakingTimeLabel.text = $"{b.bakingTime:F3} sec";
|
||||
#else
|
||||
nameLabel.text = "-";
|
||||
bakingTimeLabel.text = "-";
|
||||
#endif
|
||||
|
||||
var sizeLabel = rootVisualElement.Q<Label>("sizeLabel");
|
||||
sizeLabel.text = CommonTools.FormatMemory(rigBlob.blobAsset.m_data.Header->Length);
|
||||
|
||||
ref var bones = ref b.bones;
|
||||
var rootBoneIndexLabel = rootVisualElement.Q<Label>("rootBoneIndexLabel");
|
||||
rootBoneIndexLabel.text = $"[{b.rootBoneIndex.ToString()}]";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
if (b.rootBoneIndex >= 0)
|
||||
rootBoneIndexLabel.text += $" {bones[b.rootBoneIndex].name.ToString()}";
|
||||
#endif
|
||||
|
||||
// Fill bone data
|
||||
var bonesFoldout = rootVisualElement.Q<Foldout>("bonesFoldout");
|
||||
bonesFoldout.text = $"{bones.Length} Bones";
|
||||
|
||||
bonesFoldout.Add(boneInfoAsset.Instantiate());
|
||||
for (var i = 0; i < bones.Length; ++i)
|
||||
{
|
||||
ref var bone = ref bones[i];
|
||||
var boneInfoUIEntry = boneInfoAsset.Instantiate();
|
||||
if (i % 2 == 0)
|
||||
boneInfoUIEntry.style.backgroundColor = new StyleColor(new Color(0.3f, 0.3f, 0.3f, 1));
|
||||
|
||||
var nameHashLabelB = boneInfoUIEntry.Q<Label>("nameHashLabel");
|
||||
var nameLabelB = boneInfoUIEntry.Q<Label>("nameLabel");
|
||||
var parentBoneIndexLabelB = boneInfoUIEntry.Q<Label>("parentBoneIndexLabel");
|
||||
//var refPoseLabelB = boneInfoUIEntry.Q<Label>("refPoseLabel");
|
||||
var humanBodyPartLabelB = boneInfoUIEntry.Q<Label>("humanBodyPartLabel");
|
||||
|
||||
nameHashLabelB.text = bone.hash.ToString();
|
||||
parentBoneIndexLabelB.text = $"[{bone.parentBoneIndex}]";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
nameLabelB.text = bone.name.ToString();
|
||||
if (bone.parentBoneIndex >= 0)
|
||||
parentBoneIndexLabelB.text += $" {bones[bone.parentBoneIndex].name.ToString()}";
|
||||
#else
|
||||
nameLabelB.text = "-";
|
||||
#endif
|
||||
//refPoseLabelB.text = GetFormattedBoneTransformString(bone.refPose);
|
||||
humanBodyPartLabelB.text = bone.humanBodyPart.ToString();
|
||||
|
||||
bonesFoldout.Add(boneInfoUIEntry);
|
||||
}
|
||||
|
||||
// Fill human data
|
||||
var humanDataFoldout = rootVisualElement.Q<Foldout>("humanBodyPartsFoldout");
|
||||
humanDataFoldout.text = "0 Human Bones";
|
||||
if (b.humanData.IsValid)
|
||||
{
|
||||
humanDataFoldout.text = $"{b.humanData.Value.humanBoneToSkeletonBoneIndices.Length} Human Bones";
|
||||
|
||||
ref var hbi = ref b.humanData.Value.humanBoneToSkeletonBoneIndices;
|
||||
ref var hrd = ref b.humanData.Value.humanRotData;
|
||||
humanDataFoldout.Add(humanBoneInfoAsset.Instantiate());
|
||||
for (var i = 0; i < hbi.Length; ++i)
|
||||
{
|
||||
var rigBoneIndex = hbi[i];
|
||||
var boneInfoUIEntry = humanBoneInfoAsset.Instantiate();
|
||||
if (i % 2 == 0)
|
||||
boneInfoUIEntry.style.backgroundColor = new StyleColor(new Color(0.3f, 0.3f, 0.3f, 1));
|
||||
|
||||
var humanBodyPartLabelB = boneInfoUIEntry.Q<Label>("humanBodyPartLabel");
|
||||
var rigBoneIndexLabelB = boneInfoUIEntry.Q<Label>("rigBoneIndexLabel");
|
||||
var minMuscleAnglesLabelB = boneInfoUIEntry.Q<Label>("minMuscleAnglesLabel");
|
||||
var maxMuscleAnglesLabelB = boneInfoUIEntry.Q<Label>("maxMuscleAnglesLabel");
|
||||
|
||||
humanBodyPartLabelB.text = ((HumanBodyBones)i).ToString();
|
||||
rigBoneIndexLabelB.text = $"[{rigBoneIndex}]";
|
||||
if (rigBoneIndex >= 0)
|
||||
{
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
rigBoneIndexLabelB.text += $" {bones[rigBoneIndex].name.ToString()}";
|
||||
#endif
|
||||
minMuscleAnglesLabelB.text = GetFormattedHumanRotAngles(hrd[rigBoneIndex].minMuscleAngles);
|
||||
maxMuscleAnglesLabelB.text = GetFormattedHumanRotAngles(hrd[rigBoneIndex].maxMuscleAngles);
|
||||
}
|
||||
else
|
||||
{
|
||||
minMuscleAnglesLabelB.text = "-";
|
||||
maxMuscleAnglesLabelB.text = "-";
|
||||
}
|
||||
|
||||
humanDataFoldout.Add(boneInfoUIEntry);
|
||||
}
|
||||
}
|
||||
|
||||
// Referenced entities view
|
||||
var relatedEntitiesView = rootVisualElement.Q("relatedEntitiesView");
|
||||
var relatedEntitieLabel = rootVisualElement.Q<Label>("relatedEntitiesLabel");
|
||||
AnimatorClipBlobInfoWindow.PopulateReferencedEntities(relatedEntitiesView, relatedEntitieLabel, rigBlob.refEntities, entityRefAsset);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
string GetFormattedHumanRotAngles(float3 angles)
|
||||
{
|
||||
var rv = $"{math.degrees(angles.x):F1}; {math.degrees(angles.y):F1}; {math.degrees(angles.z):F1}";
|
||||
return rv;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
string GetFormattedBoneTransformString(BoneTransform bt)
|
||||
{
|
||||
var rv = $"T: {bt.pos}, R: {bt.rot}, S: {bt.scale}";
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 68f5c8e8bbb4f824fb5e3d9b84a28491
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- m_ViewDataDictionary: {instanceID: 0}
|
||||
- visualTreeAsset: {fileID: 9197481963319205126, guid: 5937f66a819d5c0448c73ccbabeb5e7a, type: 3}
|
||||
- boneInfoAsset: {fileID: 9197481963319205126, guid: f01028b80e61b104387c8488a086244d, type: 3}
|
||||
- humanBoneInfoAsset: {fileID: 9197481963319205126, guid: af24eed8b4ebfc740b48cd86284380b0, type: 3}
|
||||
- entityRefAsset: {fileID: 9197481963319205126, guid: dba65a86cda2861448a7ae7891041b16, type: 3}
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 298480
|
||||
packageName: Rukhanka Animation System 2
|
||||
packageVersion: 2.9.0
|
||||
assetPath: Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/RigBlobInfoWindow/RigBlobInfoWindow.cs
|
||||
uploadId: 897522
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
.custom-label {
|
||||
font-size: 20px;
|
||||
-unity-font-style: bold;
|
||||
color: rgb(68, 138, 255);
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d09d75ad8beda7a439f357254ceaa4dc
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
|
||||
disableValidation: 0
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 298480
|
||||
packageName: Rukhanka Animation System 2
|
||||
packageVersion: 2.9.0
|
||||
assetPath: Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/RigBlobInfoWindow/RigBlobInfoWindow.uss
|
||||
uploadId: 897522
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
|
||||
<Style src="project://database/Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/SkinnedMeshBlobInfoWindow/SkinnedMeshBlobInfoWindow.uss?fileID=7433441132597879392&guid=6e371b466073a1848895a5824af0da1b&type=3#SkinnedMeshBlobInfoWindow" />
|
||||
<ui:VisualElement style="flex-grow: 1; border-left-color: rgb(127, 127, 127); border-right-color: rgb(127, 127, 127); border-top-color: rgb(127, 127, 127); border-bottom-color: rgb(127, 127, 127); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px;">
|
||||
<ui:VisualElement style="flex-grow: 0; flex-direction: row; flex-shrink: 0;">
|
||||
<ui:VisualElement style="flex-grow: 0; width: 143px; flex-shrink: 0;">
|
||||
<ui:Label tabindex="-1" text="Hash128:" parse-escape-sequences="true" display-tooltip-when-elided="true" />
|
||||
<ui:Label tabindex="-1" text="Name:" parse-escape-sequences="true" display-tooltip-when-elided="true" />
|
||||
<ui:Label tabindex="-1" text="Root Bone Index:" parse-escape-sequences="true" display-tooltip-when-elided="true" />
|
||||
<ui:Label tabindex="-1" text="Baking TIme:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Size:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement style="flex-grow: 1;">
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="hashLabel" />
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="nameLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="rootBoneIndexLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="bakingTimeLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="sizeLabel" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:ScrollView scroll-deceleration-rate="0,135" elasticity="0,1" style="flex-grow: 1; border-left-color: rgb(127, 127, 127); border-right-color: rgb(127, 127, 127); border-top-color: rgb(127, 127, 127); border-bottom-color: rgb(127, 127, 127); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; margin-top: 5px; padding-top: 3px; padding-right: 0; padding-bottom: 3px; padding-left: 0;">
|
||||
<ui:Foldout text="Foldout" name="bonesFoldout" value="false" style="align-items: stretch;" />
|
||||
<ui:Foldout text="Foldout" value="false" name="humanBodyPartsFoldout" />
|
||||
</ui:ScrollView>
|
||||
<ui:Label tabindex="-1" text="Related Entities" parse-escape-sequences="true" display-tooltip-when-elided="true" name="relatedEntitiesLabel" style="padding-top: 10px;" />
|
||||
<ui:ScrollView scroll-deceleration-rate="0,135" elasticity="0,1" name="relatedEntitiesView" style="flex-grow: 1; border-left-color: rgb(127, 127, 127); border-right-color: rgb(127, 127, 127); border-top-color: rgb(127, 127, 127); border-bottom-color: rgb(127, 127, 127); border-top-width: 0; border-right-width: 0; border-bottom-width: 0; border-left-width: 0; border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 0; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px;" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5937f66a819d5c0448c73ccbabeb5e7a
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 298480
|
||||
packageName: Rukhanka Animation System 2
|
||||
packageVersion: 2.9.0
|
||||
assetPath: Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/RigBlobInfoWindow/RigBlobInfoWindow.uxml
|
||||
uploadId: 897522
|
||||
Reference in New Issue
Block a user