Netcode Bootstrap
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using Rukhanka.Hybrid;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Rukhanka.Editor
|
||||
{
|
||||
[CustomEditor(typeof(AimIKAuthoring))]
|
||||
public class AimIKAuthoringEditor : UnityEditor.Editor
|
||||
{
|
||||
public VisualTreeAsset inpectorXML;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public override VisualElement CreateInspectorGUI()
|
||||
{
|
||||
var myInspector = new VisualElement();
|
||||
inpectorXML.CloneTree(myInspector);
|
||||
var t = (AimIKAuthoring)target;
|
||||
var angleLimitMinSlider = (Slider)myInspector.Q("minAngleSlider");
|
||||
var angleLimitMaxSlider = (Slider)myInspector.Q("maxAngleSlider");
|
||||
angleLimitMinSlider.RegisterValueChangedCallback((newVal) => { t.angleLimitMax = Math.Max(t.angleLimitMax, newVal.newValue); });
|
||||
angleLimitMaxSlider.RegisterValueChangedCallback((newVal) => { t.angleLimitMin = Math.Min(newVal.newValue, t.angleLimitMin); });
|
||||
|
||||
return myInspector;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea4a0d834e497c144bce3d577268dc42
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- inpectorXML: {fileID: 9197481963319205126, guid: cf4d33380a26ecf4ea08af1e93763d81, 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/AimIKAuthoringEditor.cs
|
||||
uploadId: 897522
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a08108865024ae459733ffbdaa4e617
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef DOTS_INSTANCING_ON
|
||||
UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata)
|
||||
UNITY_DOTS_INSTANCED_PROP(float, _DeformedMeshIndex)
|
||||
UNITY_DOTS_INSTANCED_PROP(float4, _DeformationParamsForMotionVectors)
|
||||
UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata)
|
||||
#endif
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fcd50cc09e4fac945bbdabe59f0c6e08
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 298480
|
||||
packageName: Rukhanka Animation System 2
|
||||
packageVersion: 2.9.0
|
||||
assetPath: Packages/com.rukhanka.animation/Rukhanka.Editor/AmplifyShaderEditor/RukhankaDeformationPropertyDefines.hlsl
|
||||
uploadId: 897522
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 78b2425a2284af743826c689403a4924, type: 3}
|
||||
m_Name: RukhankaMeshDeformation
|
||||
m_EditorClassIdentifier:
|
||||
m_functionInfo: "// Made with Amplify Shader Editor v1.9.8.1\n// Available at the
|
||||
Unity Asset Store - http://u3d.as/y3X \n/*ASEBEGIN\nVersion=19801\nNode;AmplifyShaderEditor.PosVertexDataNode;2;-512,-336;Inherit;False;0;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4\nNode;AmplifyShaderEditor.NormalVertexDataNode;3;-512,-192;Inherit;False;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4\nNode;AmplifyShaderEditor.TangentVertexDataNode;4;-512,-48;Inherit;False;0;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4\nNode;AmplifyShaderEditor.VertexIdVariableNode;5;-480,-416;Inherit;False;0;1;INT;0\nNode;AmplifyShaderEditor.CustomExpressionNode;1;-208,-208;Inherit;False;ComputeDeformedVertex_float(vertexID,
|
||||
meshVertex, meshNormal, meshTangent, deformedVertex, deformedNormal, deformedTangent)@$;7;Call;7;True;vertexID;INT;0;In;;Inherit;False;True;meshVertex;FLOAT3;0,0,0;In;;Inherit;False;True;meshNormal;FLOAT3;0,0,0;In;;Inherit;False;True;meshTangent;FLOAT3;0,0,0;In;;Inherit;False;True;deformedVertex;FLOAT3;0,0,0;Out;;Inherit;False;True;deformedNormal;FLOAT3;0,0,0;Out;;Inherit;False;True;deformedTangent;FLOAT3;0,0,0;Out;;Inherit;False;Rukhanka
|
||||
Mesh Deformation;False;False;0;;False;8;0;FLOAT;0;False;1;INT;0;False;2;FLOAT3;0,0,0;False;3;FLOAT3;0,0,0;False;4;FLOAT3;0,0,0;False;5;FLOAT3;0,0,0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;4;FLOAT;0;FLOAT3;6;FLOAT3;7;FLOAT3;8\nNode;AmplifyShaderEditor.RangedFloatNode;8;-208,96;Inherit;False;Property;_DeformedMeshIndex;_DeformedMeshIndex;0;1;[HideInInspector];Create;True;0;0;0;True;0;False;0;0;0;0;0;1;FLOAT;0\nNode;AmplifyShaderEditor.Vector4Node;10;-208,192;Inherit;False;Property;_DeformationParamsForMotionVectors;_DeformationParamsForMotionVectors;1;0;Create;True;0;0;0;True;0;False;0,0,0,0;0,0,0,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4\nNode;AmplifyShaderEditor.FunctionOutput;7;192,-80;Inherit;False;False;-1;Deformed
|
||||
Tangent;2;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.FunctionOutput;6;192,-160;Inherit;False;False;-1;Deformed
|
||||
Normal;1;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.FunctionOutput;0;192,-240;Inherit;False;True;-1;Deformed
|
||||
Vertex;0;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0\nWireConnection;1;1;5;0\nWireConnection;1;2;2;0\nWireConnection;1;3;3;0\nWireConnection;1;4;4;0\nWireConnection;7;0;1;8\nWireConnection;6;0;1;7\nWireConnection;0;0;1;6\nASEEND*/\n//CHKSM=93F12AB0D3C8468E37E48D03D4AFB0922FB79856"
|
||||
m_functionName:
|
||||
m_description: Rukhanka Mesh Deformation Node
|
||||
m_additionalIncludes:
|
||||
m_additionalIncludes: []
|
||||
m_outsideIncludes: []
|
||||
m_additionalPragmas:
|
||||
m_additionalPragmas: []
|
||||
m_outsidePragmas: []
|
||||
m_additionalDirectives:
|
||||
m_validData: 0
|
||||
m_isDirty: 1
|
||||
m_moduleName: ' Additional Directives'
|
||||
m_independentModule: 1
|
||||
m_customEdited: 0
|
||||
m_additionalDirectives:
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
m_shaderFunctionDirectives: []
|
||||
m_nativeDirectives: []
|
||||
m_nativeDirectivesIndex: -1
|
||||
m_nativeDirectivesFoldout: 0
|
||||
m_directivesSaveItems:
|
||||
- LineType: 0
|
||||
LineValue: Packages/com.rukhanka.animation/Rukhanka.Editor/AmplifyShaderEditor/RukhankaDeformationPropertyDefines.hlsl
|
||||
GUIDToggle: 0
|
||||
GUIDValue:
|
||||
ShowConditionals: 0
|
||||
VersionMin: 0
|
||||
VersionMax: 0
|
||||
Passes:
|
||||
Origin: 2
|
||||
- LineType: 0
|
||||
LineValue: Packages/com.rukhanka.animation/Rukhanka.Runtime/Deformation/Resources/ComputeDeformedVertex.hlsl
|
||||
GUIDToggle: 0
|
||||
GUIDValue:
|
||||
ShowConditionals: 0
|
||||
VersionMin: 0
|
||||
VersionMax: 0
|
||||
Passes:
|
||||
Origin: 2
|
||||
m_nodeCategory: 3
|
||||
m_headerStyle: 0
|
||||
m_headerColor: {r: 1, g: 0.4, b: 0, a: 1}
|
||||
m_customNodeCategory:
|
||||
m_previewPosition: 0
|
||||
m_hidden: 0
|
||||
m_url:
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39064ff186f064e41ba30cef48c769b5
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 298480
|
||||
packageName: Rukhanka Animation System 2
|
||||
packageVersion: 2.9.0
|
||||
assetPath: Packages/com.rukhanka.animation/Rukhanka.Editor/AmplifyShaderEditor/RukhankaMeshDeformation.asset
|
||||
uploadId: 897522
|
||||
@@ -0,0 +1,42 @@
|
||||
using UnityEditor;
|
||||
using UnityEditor.UIElements;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Rukhanka.Editor
|
||||
{
|
||||
[CustomEditor(typeof(AnimationCullingConfig))]
|
||||
public class AnimationCullingConfigEditor : UnityEditor.Editor
|
||||
{
|
||||
public VisualTreeAsset inpectorXML;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public override VisualElement CreateInspectorGUI()
|
||||
{
|
||||
var myInspector = new VisualElement();
|
||||
inpectorXML.CloneTree(myInspector);
|
||||
|
||||
var t = (AnimationCullingConfig)target;
|
||||
|
||||
#if !RUKHANKA_DEBUG_INFO
|
||||
var debugAndVisualization = myInspector.Q<Foldout>("debugAndVisualization");
|
||||
debugAndVisualization.text += " (available only with 'RUKHANKA_DEBUG_INFO' defined)";
|
||||
debugAndVisualization.SetEnabled(false);
|
||||
#endif
|
||||
|
||||
var drawCullingVolumesToggle = myInspector.Q<PropertyField>("drawCullingVolumes");
|
||||
var drawCullingVolumesChildren = myInspector.Q("drawCullingVolumesChildren");
|
||||
drawCullingVolumesToggle.RegisterValueChangeCallback((newVal) => { drawCullingVolumesChildren.SetEnabled(newVal.changedProperty.boolValue); });
|
||||
drawCullingVolumesChildren.SetEnabled(t.drawCullingVolumes);
|
||||
|
||||
var drawBBTogle = myInspector.Q<PropertyField>("drawSceneBoundingBoxes");
|
||||
var drawBBChildren = myInspector.Q("drawSceneBoundingBoxesChildren");
|
||||
drawBBTogle.RegisterValueChangeCallback((newVal) => { drawBBChildren.SetEnabled(newVal.changedProperty.boolValue); });
|
||||
drawBBChildren.SetEnabled(t.drawSceneBoundingBoxes);
|
||||
|
||||
return myInspector;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 432ca46b2437f4b4a8572a4b3b6be432
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- inpectorXML: {fileID: 9197481963319205126, guid: bfd1c56abbcf01e4dbf64f0298fd6d78, 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/AnimationCullingConfigEditor.cs
|
||||
uploadId: 897522
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a90160f1d300fcf4ca5d14bdd6c70c4d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
BEGIN_OPTIONS
|
||||
Stackable "False"
|
||||
ShaderName "Hidden/Rukhanka Animation/Deformation"
|
||||
END_OPTIONS
|
||||
|
||||
BEGIN_PROPERTIES
|
||||
[HideInInspector]_DeformedMeshIndex("Deformed Mesh Buffer Index Offset", Float) = 0
|
||||
[HideInInspector]_DeformationParamsForMotionVectors("Deformation Parameters", Float) = 0
|
||||
END_PROPERTIES
|
||||
|
||||
|
||||
BEGIN_CBUFFER
|
||||
float _DeformedMeshIndex;
|
||||
float _DeformationParamsForMotionVectors;
|
||||
END_CBUFFER
|
||||
|
||||
BEGIN_CODE
|
||||
|
||||
|
||||
#if defined(DOTS_INSTANCING_ON)
|
||||
// DOTS instancing definitions
|
||||
UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata)
|
||||
UNITY_DOTS_INSTANCED_PROP(float, _DeformedMeshIndex)
|
||||
UNITY_DOTS_INSTANCED_PROP(float4, _DeformationParamsForMotionVectors)
|
||||
UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata)
|
||||
// DOTS instancing usage macros
|
||||
#define UNITY_ACCESS_HYBRID_INSTANCED_PROP(var, type) UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(type, var)
|
||||
#elif defined(UNITY_INSTANCING_ENABLED)
|
||||
// Unity instancing definitions
|
||||
UNITY_INSTANCING_BUFFER_START(SGPerInstanceData)
|
||||
UNITY_DEFINE_INSTANCED_PROP(float, _DeformedMeshIndex)
|
||||
UNITY_DEFINE_INSTANCED_PROP(float4, _DeformationParamsForMotionVectors)
|
||||
UNITY_INSTANCING_BUFFER_END(SGPerInstanceData)
|
||||
// Unity instancing usage macros
|
||||
#define UNITY_ACCESS_HYBRID_INSTANCED_PROP(var, type) UNITY_ACCESS_INSTANCED_PROP(SGPerInstanceData, var)
|
||||
#else
|
||||
#define UNITY_ACCESS_HYBRID_INSTANCED_PROP(var, type) var
|
||||
#endif
|
||||
|
||||
#include "Packages/com.rukhanka.animation/Rukhanka.Runtime/Deformation/Resources/ComputeDeformedVertex.hlsl"
|
||||
|
||||
void ModifyVertex(inout VertexData v, inout ExtraV2F d)
|
||||
{
|
||||
ComputeDeformedVertex_float(v.vertexID, v.vertex.xyz, v.normal.xyz, v.tangent.xyz, v.vertex.xyz, v.normal.xyz, v.tangent.xyz);
|
||||
}
|
||||
|
||||
END_CODE
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 145a0cbd410390b49ae2e8aa2611c197
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 298480
|
||||
packageName: Rukhanka Animation System 2
|
||||
packageVersion: 2.9.0
|
||||
assetPath: Packages/com.rukhanka.animation/Rukhanka.Editor/BetterShaders/StackableRukhankaDeformation.surfshader
|
||||
uploadId: 897522
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 784f41e04c4d8cb4fa42ed7a8b9fbe35
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b6240afa69eff44a936c1102da7f5f9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<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="True">
|
||||
<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="hashLabel" style="width: 75px; border-right-width: 1px; border-right-color: rgb(127, 127, 127);" />
|
||||
<ui:Label tabindex="-1" text="Name" parse-escape-sequences="true" display-tooltip-when-elided="true" name="nameLabel" style="flex-grow: 1; border-right-width: 1px; border-right-color: rgb(127, 127, 127);" />
|
||||
<ui:Label tabindex="-1" text="Time" parse-escape-sequences="true" display-tooltip-when-elided="true" name="timeLabel" style="width: 120px; border-right-width: 1px; border-right-color: rgb(127, 127, 127);" />
|
||||
<ui:Label tabindex="-1" text="Float" parse-escape-sequences="true" display-tooltip-when-elided="true" name="floatParamLabel" style="width: 120px; border-right-width: 1px; border-right-color: rgb(127, 127, 127);" />
|
||||
<ui:Label tabindex="-1" text="Int" parse-escape-sequences="true" display-tooltip-when-elided="true" name="intParamLabel" style="width: 120px; border-right-width: 1px; border-right-color: rgb(127, 127, 127);" />
|
||||
<ui:Label tabindex="-1" text="String" parse-escape-sequences="true" display-tooltip-when-elided="true" name="stringParamLabel" style="width: 120px; border-right-width: 1px; border-right-color: rgb(127, 127, 127);" />
|
||||
<ui:Label tabindex="-1" text="String Hash" parse-escape-sequences="true" display-tooltip-when-elided="true" name="stringHashParamLabel" style="width: 120px;" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d48924796ce90364db884e5b7593aa47
|
||||
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/AnimationClipBlobInfoWindow/AnimationEventBlobInfo.uxml
|
||||
uploadId: 897522
|
||||
+192
@@ -0,0 +1,192 @@
|
||||
using System.Collections.Generic;
|
||||
using Rukhanka.Toolbox;
|
||||
using Unity.Entities;
|
||||
using Unity.Mathematics;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Rukhanka.Editor
|
||||
{
|
||||
public class AnimatorClipBlobInfoWindow : EditorWindow
|
||||
{
|
||||
[SerializeField]
|
||||
private VisualTreeAsset visualTreeAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset trackGroupBlobInfoAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset trackBlobInfoAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset animationEventInfoAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset entityRefAsset = default;
|
||||
|
||||
internal static BlobInspector.BlobAssetInfo<AnimationClipBlob> animationClipBlob;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public void CreateGUI()
|
||||
{
|
||||
var root = rootVisualElement;
|
||||
var doc = visualTreeAsset.Instantiate();
|
||||
root.Add(doc);
|
||||
|
||||
titleContent = new GUIContent("Rukhanka.Animation Clip Blob Info");
|
||||
FillBlobInfo();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
unsafe void FillBlobInfo()
|
||||
{
|
||||
ref var b = ref animationClipBlob.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 lengthLabel = rootVisualElement.Q<Label>("lengthLabel");
|
||||
lengthLabel.text = $"{b.length:F3} sec";
|
||||
|
||||
var cycleOffsetLabel = rootVisualElement.Q<Label>("cycleOffsetLabel");
|
||||
cycleOffsetLabel.text = $"{b.cycleOffset}";
|
||||
|
||||
var loopedCheckBox = rootVisualElement.Q<Toggle>("loopedCheckBox");
|
||||
loopedCheckBox.SetEnabled(false);
|
||||
loopedCheckBox.value = b.looped;
|
||||
|
||||
var loopPoseBlendCheckBox = rootVisualElement.Q<Toggle>("loopPoseBlendCheckBox");
|
||||
loopPoseBlendCheckBox.SetEnabled(false);
|
||||
loopPoseBlendCheckBox.value = b.loopPoseBlend;
|
||||
|
||||
var sizeLabel = rootVisualElement.Q<Label>("sizeLabel");
|
||||
sizeLabel.text = CommonTools.FormatMemory(animationClipBlob.blobAsset.m_data.Header->Length);
|
||||
|
||||
FillTrackSetFoldout("clipTracksInfoFoldout", "Clip Tracks", ref b.clipTracks);
|
||||
FillTrackSetFoldout("additiveRefPoseTrackSetInfoFoldout", "Additive Ref Pose Tracks", ref b.additiveReferencePoseFrame);
|
||||
|
||||
ref var events = ref b.events;
|
||||
var animationEventsInfoFoldout = rootVisualElement.Q<Foldout>("animationEventsInfoFoldout");
|
||||
animationEventsInfoFoldout.text = $"{events.Length} Animation Events";
|
||||
animationEventsInfoFoldout.Add(animationEventInfoAsset.Instantiate());
|
||||
for (var i = 0; i < events.Length; ++i)
|
||||
{
|
||||
var eventInfo = animationEventInfoAsset.Instantiate();
|
||||
|
||||
if (i % 2 == 0)
|
||||
eventInfo.style.backgroundColor = new StyleColor(new Color(0.3f, 0.3f, 0.3f, 1));
|
||||
|
||||
ref var evt = ref events[i];
|
||||
var hashLabelE = eventInfo.Q<Label>("hashLabel");
|
||||
var nameLabelE = eventInfo.Q<Label>("nameLabel");
|
||||
var timeLabelE = eventInfo.Q<Label>("timeLabel");
|
||||
var floatParamLabelE = eventInfo.Q<Label>("floatParamLabel");
|
||||
var intParamLabelE = eventInfo.Q<Label>("intParamLabel");
|
||||
var stringParamTabelE = eventInfo.Q<Label>("stringParamLabel");
|
||||
var stringHashParamTabelE = eventInfo.Q<Label>("stringHashParamLabel");
|
||||
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
nameLabelE.text = evt.name.ToString();
|
||||
stringParamTabelE.text = evt.stringParam.ToString();
|
||||
#else
|
||||
nameLabelE.text = "-";
|
||||
stringParamTabelE.text = "-";
|
||||
#endif
|
||||
hashLabelE.text = evt.nameHash.ToString();
|
||||
timeLabelE.text = evt.time.ToString();
|
||||
floatParamLabelE.text = evt.floatParam.ToString();
|
||||
intParamLabelE.text = evt.intParam.ToString();
|
||||
stringHashParamTabelE.text = evt.stringParamHash.ToString();
|
||||
animationEventsInfoFoldout.Add(eventInfo);
|
||||
}
|
||||
|
||||
var relatedEntitiesView = rootVisualElement.Q("relatedEntitiesView");
|
||||
var relatedEntitieLabel = rootVisualElement.Q<Label>("relatedEntitiesLabel");
|
||||
PopulateReferencedEntities(relatedEntitiesView, relatedEntitieLabel, animationClipBlob.refEntities, entityRefAsset);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
internal static void PopulateReferencedEntities(VisualElement container, Label containerLabel, List<Entity> entities, VisualTreeAsset entryAsset)
|
||||
{
|
||||
containerLabel.text = $"{entities.Count} Related Entities";
|
||||
for (var i = 0; i < entities.Count; ++i)
|
||||
{
|
||||
var e = entities[i];
|
||||
var element = entryAsset.Instantiate();
|
||||
var entityIDLabel = element.Q<Label>("entityIDLabel");
|
||||
var nameLabel = element.Q<Label>("nameLabel");
|
||||
|
||||
entityIDLabel.text = e.ToString();
|
||||
if (BlobInspector.currentWorld != null)
|
||||
nameLabel.text = BlobInspector.currentWorld.EntityManager.GetName(e);
|
||||
|
||||
container.Add(element);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void FillTrackSetFoldout(string foldoutName, string caption, ref TrackSet ts)
|
||||
{
|
||||
var trackSetInfoFoldout = rootVisualElement.Q<Foldout>(foldoutName);
|
||||
trackSetInfoFoldout.text = $"{ts.trackGroups.Length} {caption}";
|
||||
|
||||
for (int i = 0; i < ts.trackGroups.Length - 1; ++i)
|
||||
{
|
||||
var tgRange = new int2(ts.trackGroups[i], ts.trackGroups[i + 1]);
|
||||
var trackGroupInfo = trackGroupBlobInfoAsset.Instantiate();
|
||||
|
||||
if (i % 2 == 0)
|
||||
trackGroupInfo.style.backgroundColor = new StyleColor(new Color(0.3f, 0.3f, 0.3f, 1));
|
||||
|
||||
var trackListFoldout = trackGroupInfo.Q<Foldout>("trackList");
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
var tgDebugInfo = ts.trackGroupDebugInfo[i];
|
||||
trackListFoldout.text = $"[{i} {tgDebugInfo.name} Hash: {tgDebugInfo.hash:X}] Track Group Start:Length [{tgRange.x}:{tgRange.y - tgRange.x}]";
|
||||
#else
|
||||
trackListFoldout.text = $"[{i}] Track Group Start:Length [{tgRange.x}:{tgRange.y - tgRange.x}]";
|
||||
#endif
|
||||
|
||||
var trackInfoHeader = trackBlobInfoAsset.Instantiate();
|
||||
trackListFoldout.Add(trackInfoHeader);
|
||||
for (var l = tgRange.x; l < tgRange.y; ++l)
|
||||
{
|
||||
Track t = ts.tracks[l];
|
||||
var trackInfo = trackBlobInfoAsset.Instantiate();
|
||||
|
||||
var hashLabel = trackInfo.Q<Label>("hashLabel");
|
||||
var nameLabel = trackInfo.Q<Label>("nameLabel");
|
||||
var bindingTypeLabel = trackInfo.Q<Label>("bindingTypeLabel");
|
||||
var channelIndexLabel = trackInfo.Q<Label>("channelIndexLabel");
|
||||
var keyFrameInfoLabel = trackInfo.Q<Label>("keyFrameInfoLabel");
|
||||
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
nameLabel.text = $"{t.name.ToString()}";
|
||||
#else
|
||||
nameLabel.text = "-";
|
||||
#endif
|
||||
|
||||
hashLabel.text = t.props.ToString("X");
|
||||
bindingTypeLabel.text = t.bindingType.ToString();
|
||||
channelIndexLabel.text = t.channelIndex.ToString();
|
||||
keyFrameInfoLabel.text = $"Start:Length [{t.keyFrameRange.x}:{t.keyFrameRange.y}]";
|
||||
|
||||
trackListFoldout.Add(trackInfo);
|
||||
}
|
||||
|
||||
trackSetInfoFoldout.Add(trackGroupInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28a266621693c00469972be15f47a2d5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- m_ViewDataDictionary: {instanceID: 0}
|
||||
- visualTreeAsset: {fileID: 9197481963319205126, guid: 547be161a75c99a418c17010dda0234c, type: 3}
|
||||
- trackGroupBlobInfoAsset: {fileID: 9197481963319205126, guid: 07660a014a4d1f24abec619013960db9, type: 3}
|
||||
- trackBlobInfoAsset: {fileID: 9197481963319205126, guid: 63bc41214c99e734aa5adc4a69340137, type: 3}
|
||||
- animationEventInfoAsset: {fileID: 9197481963319205126, guid: d48924796ce90364db884e5b7593aa47, 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/AnimationClipBlobInfoWindow/AnimatorClipBlobInfoWindow.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: a257fa72e71cbc9458084aa8141bc9e2
|
||||
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/AnimationClipBlobInfoWindow/AnimatorClipBlobInfoWindow.uss
|
||||
uploadId: 897522
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<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="True">
|
||||
<Style src="project://database/Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/AnimationClipBlobInfoWindow/AnimatorClipBlobInfoWindow.uss?fileID=7433441132597879392&guid=a257fa72e71cbc9458084aa8141bc9e2&type=3#AnimatorClipBlobInfoWindow" />
|
||||
<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; flex-shrink: 1;">
|
||||
<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="Length:" parse-escape-sequences="true" display-tooltip-when-elided="true" />
|
||||
<ui:Label tabindex="-1" text="Cycle Offset:" parse-escape-sequences="true" display-tooltip-when-elided="true" />
|
||||
<ui:Label tabindex="-1" text="Looped:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Loop Pose Blend:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="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="LabelLabelLabelLabelLabelLabelLabelLabelLabel" 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="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="lengthLabel" />
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="cycleOffsetLabel" />
|
||||
<ui:Toggle focusable="false" name="loopedCheckBox" style="margin-top: 0; margin-bottom: 0; margin-right: 0; margin-left: 0;" />
|
||||
<ui:Toggle focusable="false" name="loopPoseBlendCheckBox" style="visibility: visible; display: flex; margin-top: 0; margin-bottom: 0; margin-right: 0; margin-left: 0;" />
|
||||
<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;">
|
||||
<ui:Foldout text="Foldout" name="clipTracksInfoFoldout" value="false" style="align-items: stretch;" />
|
||||
<ui:Foldout text="Foldout" value="false" name="additiveRefPoseTrackSetInfoFoldout" />
|
||||
<ui:Foldout text="Foldout" value="false" name="animationEventsInfoFoldout" />
|
||||
</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: 547be161a75c99a418c17010dda0234c
|
||||
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/AnimationClipBlobInfoWindow/AnimatorClipBlobInfoWindow.uxml
|
||||
uploadId: 897522
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<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="True">
|
||||
<ui:VisualElement style="flex-grow: 1; flex-direction: row;">
|
||||
<ui:Label tabindex="-1" text="Hash (properties)" parse-escape-sequences="true" display-tooltip-when-elided="true" name="hashLabel" style="flex-grow: 0; border-right-color: rgb(127, 127, 127); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; align-self: auto; width: 282px;" />
|
||||
<ui:Label tabindex="-1" text="Name" parse-escape-sequences="true" display-tooltip-when-elided="true" name="nameLabel" 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-right-width: 1px; width: 260px;" />
|
||||
<ui:Label tabindex="-1" text="Binding Type" parse-escape-sequences="true" display-tooltip-when-elided="true" name="bindingTypeLabel" style="flex-grow: 0; align-self: auto; width: 210px; 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-right-width: 1px;" />
|
||||
<ui:Label tabindex="-1" text="Channel Index" parse-escape-sequences="true" display-tooltip-when-elided="true" name="channelIndexLabel" style="flex-grow: 0; align-self: auto; width: 210px; 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);" />
|
||||
<ui:Label tabindex="-1" text="KeyFrame Info" parse-escape-sequences="true" display-tooltip-when-elided="true" name="keyFrameInfoLabel" style="flex-grow: 0; align-self: auto; width: 210px;" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63bc41214c99e734aa5adc4a69340137
|
||||
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/AnimationClipBlobInfoWindow/TrackBlobInfo.uxml
|
||||
uploadId: 897522
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<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="True">
|
||||
<ui:Foldout text="Foldout" name="trackList" value="false" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07660a014a4d1f24abec619013960db9
|
||||
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/AnimationClipBlobInfoWindow/TrackGroupBlobInfo.uxml
|
||||
uploadId: 897522
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6c504c21fed20414bb9b185131c8359b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+325
@@ -0,0 +1,325 @@
|
||||
using System.Collections.Generic;
|
||||
using Rukhanka;
|
||||
using Rukhanka.Editor;
|
||||
using Rukhanka.Toolbox;
|
||||
using Unity.Entities;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Rukhanka.Editor
|
||||
{
|
||||
public class AnimatorControllerBlobInfoWindow : EditorWindow
|
||||
{
|
||||
[SerializeField]
|
||||
private VisualTreeAsset visualTreeAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset entityRefAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset layerBlobInfoAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset stateBlobInfoAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset transitionBlobInfoAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset conditionBlobInfoAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset listViewLabelAsset = default;
|
||||
|
||||
internal static BlobInspector.BlobAssetInfo<ControllerBlob> controllerBlob;
|
||||
|
||||
readonly string nameColumnName = "name";
|
||||
readonly string hashColumnName = "hash";
|
||||
readonly string defValColumnName = "defaultValue";
|
||||
readonly string typeColumnName = "type";
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class ParameterListItem
|
||||
{
|
||||
public string name;
|
||||
public uint hash;
|
||||
public string paramValue;
|
||||
public ControllerParameterType paramType;
|
||||
public ParameterListItem(ref ParameterBlob pb)
|
||||
{
|
||||
name = "-";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
name = pb.name.ToString();
|
||||
#endif
|
||||
hash = pb.hash;
|
||||
paramValue = GetParameterValueAsString(ref pb);
|
||||
paramType = pb.type;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public void CreateGUI()
|
||||
{
|
||||
var root = rootVisualElement;
|
||||
var doc = visualTreeAsset.Instantiate();
|
||||
root.Add(doc);
|
||||
|
||||
titleContent = new GUIContent("Rukhanka.Animation Controller Blob Info");
|
||||
FillBlobInfo();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void InitMultiListView(VisualElement root, List<ParameterListItem> srcData)
|
||||
{
|
||||
var paramListView = root.Q<MultiColumnListView>("parametersList");
|
||||
|
||||
paramListView.itemsSource = srcData;
|
||||
|
||||
paramListView.columns[nameColumnName].makeCell = () => listViewLabelAsset.Instantiate().Q<Label>("label");
|
||||
paramListView.columns[nameColumnName].bindCell = (VisualElement ve, int index) => (ve as Label).text = srcData[index].name;
|
||||
|
||||
paramListView.columns[hashColumnName].makeCell = () => listViewLabelAsset.Instantiate().Q<Label>("label");
|
||||
paramListView.columns[hashColumnName].bindCell = (VisualElement ve, int index) => (ve as Label).text = srcData[index].hash.ToString("X");
|
||||
|
||||
paramListView.columns[defValColumnName].makeCell = () => listViewLabelAsset.Instantiate().Q<Label>("label");
|
||||
paramListView.columns[defValColumnName].bindCell = (VisualElement ve, int index) => (ve as Label).text = srcData[index].paramValue;
|
||||
|
||||
paramListView.columns[typeColumnName].makeCell = () => listViewLabelAsset.Instantiate().Q<Label>("label");
|
||||
paramListView.columns[typeColumnName].bindCell = (VisualElement ve, int index) => (ve as Label).text = srcData[index].paramType.ToString();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
unsafe void FillBlobInfo()
|
||||
{
|
||||
ref var b = ref controllerBlob.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(controllerBlob.blobAsset.m_data.Header->Length);
|
||||
|
||||
ref var blobParameters = ref b.parameters;
|
||||
var srcData = new List<ParameterListItem>();
|
||||
for (int i = 0; i < blobParameters.Length; ++i)
|
||||
{
|
||||
ref var p = ref blobParameters[i];
|
||||
var li = new ParameterListItem(ref p);
|
||||
srcData.Add(li);
|
||||
}
|
||||
|
||||
InitMultiListView(rootVisualElement, srcData);
|
||||
|
||||
// Referenced entities view
|
||||
var relatedEntitiesView = rootVisualElement.Q("relatedEntitiesView");
|
||||
var relatedEntitieLabel = rootVisualElement.Q<Label>("relatedEntitiesLabel");
|
||||
AnimatorClipBlobInfoWindow.PopulateReferencedEntities(relatedEntitiesView, relatedEntitieLabel, controllerBlob.refEntities, entityRefAsset);
|
||||
|
||||
FillControllerLayersList(ref b);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void FillControllerLayersList(ref ControllerBlob cb)
|
||||
{
|
||||
var layersFoldout = rootVisualElement.Q<Foldout>("layersFoldout");
|
||||
layersFoldout.text = $"{cb.layers.Length} Layers";
|
||||
|
||||
for (var i = 0; i < cb.layers.Length; ++i)
|
||||
{
|
||||
ref var layer = ref cb.layers[i];
|
||||
var uiEntry = layerBlobInfoAsset.Instantiate();
|
||||
var rootFoldout = uiEntry.Q<Foldout>("layerInfoFoldout");
|
||||
var blendModeLabel = uiEntry.Q<Label>("blendModeLabel");
|
||||
var defaultStateLabel = uiEntry.Q<Label>("defaultStateLabel");
|
||||
var initialWeightLabel = uiEntry.Q<Label>("initialWeightLabel");
|
||||
var avatarMaskHashLabel = uiEntry.Q<Label>("avatarMaskHashLabel");
|
||||
|
||||
rootFoldout.text = $"[{i}]";
|
||||
#if RUKHAHKA_DEBUG_INFO
|
||||
rootFoldout.text += $"' {layer.name.ToString()}'";
|
||||
if (layer.defaultStateIndex >= 0)
|
||||
defaultStateLabel.text = layer.states[layer.defaultStateIndex].name.ToString();
|
||||
#else
|
||||
defaultStateLabel.text = $"[{layer.defaultStateIndex.ToString()}]";
|
||||
#endif
|
||||
blendModeLabel.text = layer.blendingMode.ToString();
|
||||
initialWeightLabel.text = layer.initialWeight.ToString();
|
||||
avatarMaskHashLabel.text = layer.avatarMaskBlobHash.ToString();
|
||||
|
||||
FillLayerStatesInfo(ref layer, ref cb, uiEntry);
|
||||
|
||||
layersFoldout.Add(uiEntry);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void FillLayerStatesInfo(ref LayerBlob lb, ref ControllerBlob cb, VisualElement root)
|
||||
{
|
||||
var foldout = root.Q<Foldout>("statesFoldout");
|
||||
foldout.text = $"{lb.states.Length} States";
|
||||
|
||||
for (var i = 0; i < lb.states.Length; ++i)
|
||||
{
|
||||
ref var state = ref lb.states[i];
|
||||
var uiEntry = stateBlobInfoAsset.Instantiate();
|
||||
var rootFoldout = uiEntry.Q<Foldout>("stateInfoFoldout");
|
||||
var nameHashLabel = uiEntry.Q<Label>("nameHashLabel");
|
||||
var tagLabel = uiEntry.Q<Label>("tagLabel");
|
||||
var tagHashLabel = uiEntry.Q<Label>("tagHashLabel");
|
||||
var speedLabel = uiEntry.Q<Label>("speedLabel");
|
||||
var speedParamIdxLabel = uiEntry.Q<Label>("speedParamIdxLabel");
|
||||
var timeParamIdxLabel = uiEntry.Q<Label>("timeParamIdxLabel");
|
||||
var cycleOffsetLabel = uiEntry.Q<Label>("cycleOffsetLabel");
|
||||
var cycleOffsetParamIdxLabel = uiEntry.Q<Label>("cycleOffsetParamIdxLabel");
|
||||
|
||||
rootFoldout.text = $"[{i}]";
|
||||
nameHashLabel.text = state.hash.ToString();
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
rootFoldout.text += $" '{state.name.ToString()}'";
|
||||
tagLabel.text = state.tag.ToString();
|
||||
#else
|
||||
tagLabel.text = "-";
|
||||
#endif
|
||||
tagHashLabel.text = state.tagHash.ToString();
|
||||
speedLabel.text = state.speed.ToString();
|
||||
speedParamIdxLabel.text = $"[{state.speedMultiplierParameterIndex}]";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
if (state.speedMultiplierParameterIndex >= 0)
|
||||
speedParamIdxLabel.text += $" '{cb.parameters[state.speedMultiplierParameterIndex].name.ToString()}'";
|
||||
#endif
|
||||
timeParamIdxLabel.text = $"[{state.timeParameterIndex}]";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
if (state.timeParameterIndex >= 0)
|
||||
timeParamIdxLabel.text += $" '{cb.parameters[state.timeParameterIndex].name.ToString()}'";
|
||||
#endif
|
||||
cycleOffsetLabel.text = state.cycleOffset.ToString();
|
||||
cycleOffsetParamIdxLabel.text = $"[{state.cycleOffsetParameterIndex}]";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
if (state.cycleOffsetParameterIndex >= 0)
|
||||
cycleOffsetParamIdxLabel.text = $" '{cb.parameters[state.cycleOffsetParameterIndex].name.ToString()}'";
|
||||
#endif
|
||||
|
||||
FillTransitionsInfo(ref state, ref lb, ref cb, uiEntry);
|
||||
|
||||
foldout.Add(uiEntry);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void FillTransitionsInfo(ref StateBlob sb, ref LayerBlob lb, ref ControllerBlob cb, VisualElement root)
|
||||
{
|
||||
var foldout = root.Q<Foldout>("transitionsFoldout");
|
||||
foldout.text = $"{sb.transitions.Length} Transitions";
|
||||
|
||||
for (var i = 0; i < sb.transitions.Length; ++i)
|
||||
{
|
||||
ref var tr = ref sb.transitions[i];
|
||||
var uiEntry = transitionBlobInfoAsset.Instantiate();
|
||||
var rootFoldout = uiEntry.Q<Foldout>("transitionInfoFoldout");
|
||||
var nameHashLabel = uiEntry.Q<Label>("nameHashLabel");
|
||||
var targetStateIDLabel = uiEntry.Q<Label>("targetStateIDLabel");
|
||||
var durationLabel = uiEntry.Q<Label>("durationLabel");
|
||||
var exitTimeLabel = uiEntry.Q<Label>("exitTimeLabel");
|
||||
var offsetLabel = uiEntry.Q<Label>("offsetLabel");
|
||||
var hasExitTimeCheckbox = uiEntry.Q<Toggle>("hasExitTimeCheckbox");
|
||||
var hasFixedDurationCheckbox = uiEntry.Q<Toggle>("hasFixedDurationCheckbox");
|
||||
|
||||
nameHashLabel.text = tr.hash.ToString();
|
||||
targetStateIDLabel.text = $"[{tr.targetStateId.ToString()}]";
|
||||
rootFoldout.text = $"[{i}]";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
rootFoldout.text += $" '{tr.name.ToString()}'";
|
||||
if (tr.targetStateId >= 0)
|
||||
targetStateIDLabel.text += $" '{lb.states[tr.targetStateId].name.ToString()}'";
|
||||
#endif
|
||||
durationLabel.text = tr.duration.ToString();
|
||||
exitTimeLabel.text = tr.exitTime.ToString();
|
||||
offsetLabel.text = tr.offset.ToString();
|
||||
hasExitTimeCheckbox.value = tr.hasExitTime;
|
||||
hasExitTimeCheckbox.SetEnabled(false);
|
||||
hasFixedDurationCheckbox.value = tr.hasFixedDuration;
|
||||
hasFixedDurationCheckbox.SetEnabled(false);
|
||||
|
||||
FillConditionsInfo(ref tr, ref cb, uiEntry);
|
||||
|
||||
foldout.Add(uiEntry);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void FillConditionsInfo(ref TransitionBlob tb, ref ControllerBlob cb, VisualElement root)
|
||||
{
|
||||
var foldout = root.Q<Foldout>("conditionsFoldout");
|
||||
foldout.text = $"{tb.conditions.Length} Conditions";
|
||||
|
||||
for (var i = 0; i < tb.conditions.Length; ++i)
|
||||
{
|
||||
ref var conditionBlob = ref tb.conditions[i];
|
||||
var uiEntry = conditionBlobInfoAsset.Instantiate();
|
||||
var conditionLabel = uiEntry.Q<Label>("conditionLabel");
|
||||
conditionLabel.text = BuildConditionString(ref conditionBlob, ref cb.parameters);
|
||||
|
||||
foldout.Add(uiEntry);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
string BuildConditionString(ref ConditionBlob cb, ref BlobArray<ParameterBlob> pb)
|
||||
{
|
||||
ref var param = ref pb[cb.paramIdx];
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
var paramString = $"'{param.name.ToString()}'";
|
||||
#else
|
||||
var paramString = $"'{param.hash.ToString()}'";
|
||||
#endif
|
||||
|
||||
var opString = "";
|
||||
switch (cb.conditionMode)
|
||||
{
|
||||
case AnimatorConditionMode.Equals: opString = " =="; break;
|
||||
case AnimatorConditionMode.Greater: opString = " >"; break;
|
||||
case AnimatorConditionMode.If: opString = " == true"; break;
|
||||
case AnimatorConditionMode.Less: opString = " <"; break;
|
||||
case AnimatorConditionMode.IfNot: opString = " == false"; break;
|
||||
case AnimatorConditionMode.NotEqual: opString = " !="; break;
|
||||
}
|
||||
|
||||
var thresholdString = "";
|
||||
switch (param.type)
|
||||
{
|
||||
case ControllerParameterType.Float: thresholdString = " " + cb.threshold.floatValue; break;
|
||||
case ControllerParameterType.Int: thresholdString = " " + cb.threshold.intValue; break;
|
||||
}
|
||||
|
||||
var rv = paramString + opString + thresholdString;
|
||||
return rv;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static string GetParameterValueAsString(ref ParameterBlob pb) => pb.type switch
|
||||
{
|
||||
ControllerParameterType.Bool => pb.defaultValue.boolValue ? "true" : "false",
|
||||
ControllerParameterType.Trigger => pb.defaultValue.boolValue ? "true" : "false",
|
||||
ControllerParameterType.Float => pb.defaultValue.floatValue.ToString(),
|
||||
ControllerParameterType.Int => pb.defaultValue.intValue.ToString(),
|
||||
_ => ""
|
||||
};
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c3c09e83942e314cbdad5486d3edde7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- m_ViewDataDictionary: {instanceID: 0}
|
||||
- visualTreeAsset: {fileID: 9197481963319205126, guid: 021574c1f4ac2d84893abf85ab6abf69, type: 3}
|
||||
- controllerParameterBlobInfoAsset: {fileID: 9197481963319205126, guid: 105507b7bae5e594298939c9040e9947, type: 3}
|
||||
- entityRefAsset: {fileID: 9197481963319205126, guid: dba65a86cda2861448a7ae7891041b16, type: 3}
|
||||
- layerBlobInfoAsset: {fileID: 9197481963319205126, guid: 20cf45a045031f0449037db6abab3240, type: 3}
|
||||
- stateBlobInfoAsset: {fileID: 9197481963319205126, guid: aaab1c8abd35b8d458d1d9b52e28065a, type: 3}
|
||||
- transitionBlobInfoAsset: {fileID: 9197481963319205126, guid: c3451fa4841d2604c955112ea35a0456, type: 3}
|
||||
- conditionBlobInfoAsset: {fileID: 9197481963319205126, guid: f3041ef93fd36cc42a5e9f6b1bb2cb3c, type: 3}
|
||||
- listViewLabelAsset: {fileID: 9197481963319205126, guid: 5460ee29626c92b47a703070f7c106ba, 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/AnimatorControllerBlobInfoWindow/AnimatorControllerBlobInfoWindow.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: d13a537d15bd7bc4c8f28adebfcf734d
|
||||
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/AnimatorControllerBlobInfoWindow/AnimatorControllerBlobInfoWindow.uss
|
||||
uploadId: 897522
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<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/AnimatorControllerBlobInfoWindow/AnimatorControllerBlobInfoWindow.uss?fileID=7433441132597879392&guid=d13a537d15bd7bc4c8f28adebfcf734d&type=3#AnimatorControllerBlobInfoWindow" />
|
||||
<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="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="LabelLabelLabelLabelLabelLabelLabelLabelLabel" 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="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:MultiColumnListView name="parametersList" show-alternating-row-backgrounds="ContentOnly" show-foldout-header="true" header-title="Controller Parameters" allow-add="false" allow-remove="false" show-border="true" selection-type="None" show-bound-collection-size="true" virtualization-method="FixedHeight" style="margin-top: 4px; margin-right: 4px; margin-bottom: 4px; margin-left: 4px;">
|
||||
<ui:Columns stretch-mode="GrowAndFill" resize-preview="false">
|
||||
<ui:Column stretchable="true" title="Hash" name="hash" />
|
||||
<ui:Column title="Name" stretchable="true" name="name" />
|
||||
<ui:Column title="Type" stretchable="true" name="type" />
|
||||
<ui:Column title="Default Value" stretchable="true" name="defaultValue" />
|
||||
</ui:Columns>
|
||||
</ui:MultiColumnListView>
|
||||
<ui:Foldout text="Foldout" value="false" name="layersFoldout" />
|
||||
</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: 021574c1f4ac2d84893abf85ab6abf69
|
||||
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/AnimatorControllerBlobInfoWindow/AnimatorControllerBlobInfoWindow.uxml
|
||||
uploadId: 897522
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<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: 0; flex-direction: row;">
|
||||
<ui:VisualElement style="flex-grow: 0; width: 106px; flex-shrink: 0;">
|
||||
<ui:Label tabindex="-1" text="Condition:" 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="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="conditionLabel" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f3041ef93fd36cc42a5e9f6b1bb2cb3c
|
||||
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/AnimatorControllerBlobInfoWindow/AnimatorControllerConditionBlobEntry.uxml
|
||||
uploadId: 897522
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<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:Foldout text="Layers" name="layerInfoFoldout" value="false" style="border-top-width: 1px; 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);">
|
||||
<ui:VisualElement style="flex-grow: 0; flex-direction: row;">
|
||||
<ui:VisualElement style="flex-grow: 0; width: 143px; flex-shrink: 0;">
|
||||
<ui:Label tabindex="-1" text="Blend Mode:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Default State:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Initial Weight:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Avatar Mask Hash:" 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="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="blendModeLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="defaultStateLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="initialWeightLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="avatarMaskHashLabel" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:Foldout text="Transitions" name="statesFoldout" value="false" />
|
||||
</ui:Foldout>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20cf45a045031f0449037db6abab3240
|
||||
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/AnimatorControllerBlobInfoWindow/AnimatorControllerLayerBlobEntry.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="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="hashLabel" style="width: 141px; border-right-color: rgb(127, 127, 127); border-right-width: 1px; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0;" />
|
||||
<ui:Label tabindex="-1" text="Label" 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="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="typeLabel" style="flex-grow: 1; border-right-color: rgb(127, 127, 127); border-right-width: 1px;" />
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="defaultValueLabel" style="width: 104px;" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 105507b7bae5e594298939c9040e9947
|
||||
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/AnimatorControllerBlobInfoWindow/AnimatorControllerParameterBlobEntry.uxml
|
||||
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">
|
||||
<ui:Foldout text="Foldout" name="stateInfoFoldout" value="false" style="border-top-width: 1px; border-top-color: rgb(127, 127, 127);">
|
||||
<ui:VisualElement style="flex-grow: 0; flex-direction: row;">
|
||||
<ui:VisualElement style="flex-grow: 0; width: 184px; flex-shrink: 0;">
|
||||
<ui:Label tabindex="-1" text="Name Hash:" parse-escape-sequences="true" display-tooltip-when-elided="true" />
|
||||
<ui:Label tabindex="-1" text="Tag:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Tag Hash:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Speed:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Speed Param Index:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Time Param Index:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Cycle Offset:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Cycle Offset Param Index:" 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="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="nameHashLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="tagLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="tagHashLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="speedLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="speedParamIdxLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="timeParamIdxLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="cycleOffsetLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="cycleOffsetParamIdxLabel" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:Foldout text="Transitions" name="transitionsFoldout" value="false" />
|
||||
</ui:Foldout>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aaab1c8abd35b8d458d1d9b52e28065a
|
||||
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/AnimatorControllerBlobInfoWindow/AnimatorControllerStateBlobEntry.uxml
|
||||
uploadId: 897522
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<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:Foldout text="Foldout" name="transitionInfoFoldout" value="false" style="border-top-width: 1px; border-top-color: rgb(127, 127, 127);">
|
||||
<ui:VisualElement style="flex-grow: 0; flex-direction: row;">
|
||||
<ui:VisualElement style="flex-grow: 0; width: 184px; flex-shrink: 0;">
|
||||
<ui:Label tabindex="-1" text="Name Hash:" parse-escape-sequences="true" display-tooltip-when-elided="true" />
|
||||
<ui:Label tabindex="-1" text="Target State ID:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Duration:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Exit Time:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Offset:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Has Exit Time:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Has Fixed Duration:" 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="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="nameHashLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="targetStateIDLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="durationLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="exitTimeLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="offsetLabel" />
|
||||
<ui:Toggle name="hasExitTimeCheckbox" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0;" />
|
||||
<ui:Toggle name="hasFixedDurationCheckbox" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0;" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:Foldout text="Conditions" name="conditionsFoldout" value="false" />
|
||||
</ui:Foldout>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c3451fa4841d2604c955112ea35a0456
|
||||
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/AnimatorControllerBlobInfoWindow/AnimatorControllerTransitionBlobEntry.uxml
|
||||
uploadId: 897522
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9fde67a8740cb08419e256a8ff77bb69
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
using Rukhanka.Toolbox;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Rukhanka.Editor
|
||||
{
|
||||
public class AvatarMaskInfoWindow : EditorWindow
|
||||
{
|
||||
[SerializeField]
|
||||
private VisualTreeAsset visualTreeAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset includedBoneNameInfoAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset entityRefAsset = default;
|
||||
|
||||
internal static BlobInspector.BlobAssetInfo<AvatarMaskBlob> avatarMaskBlob;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public void CreateGUI()
|
||||
{
|
||||
var root = rootVisualElement;
|
||||
var doc = visualTreeAsset.Instantiate();
|
||||
root.Add(doc);
|
||||
|
||||
titleContent = new GUIContent("Rukhanka.Animation Avatar Mask Blob Info");
|
||||
FillAvatarMaskInfo();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
unsafe void FillAvatarMaskInfo()
|
||||
{
|
||||
ref var b = ref avatarMaskBlob.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(avatarMaskBlob.blobAsset.m_data.Header->Length);
|
||||
|
||||
// Fill included bone names
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
ref var boneNames = ref b.includedBoneNames;
|
||||
var includedBonesFoldout = rootVisualElement.Q<Foldout>("includedBonesFoldout");
|
||||
includedBonesFoldout.text = $"{boneNames.Length} Included Bones";
|
||||
|
||||
for (var i = 0; i < boneNames.Length; ++i)
|
||||
{
|
||||
ref var bn = ref boneNames[i];
|
||||
var includeBodyPartUIEntry = includedBoneNameInfoAsset.Instantiate();
|
||||
|
||||
if (i % 2 == 0)
|
||||
includeBodyPartUIEntry.style.backgroundColor = new StyleColor(new Color(0.3f, 0.3f, 0.3f, 1));
|
||||
|
||||
var nameLabelP = includeBodyPartUIEntry.Q<Label>("nameLabel");
|
||||
nameLabelP.text = bn.ToString();
|
||||
includedBonesFoldout.Add(includeBodyPartUIEntry);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Fill included human body parts names
|
||||
var humanBodyPartsFoldout = rootVisualElement.Q<Foldout>("humanBodyPartsFoldout");
|
||||
var totalPartsCount = 0;
|
||||
var humanBodyPartsCount = (int)AvatarMaskBodyPart.LastBodyPart;
|
||||
for (int i = 0; i < humanBodyPartsCount; ++i)
|
||||
{
|
||||
var ambp = (AvatarMaskBodyPart)i;
|
||||
if ((b.humanBodyPartsAvatarMask & 1 << i) != 0)
|
||||
{
|
||||
var humanBodyPartUIEntry = includedBoneNameInfoAsset.Instantiate();
|
||||
|
||||
if (i % 2 == 0)
|
||||
humanBodyPartUIEntry.style.backgroundColor = new StyleColor(new Color(0.3f, 0.3f, 0.3f, 1));
|
||||
|
||||
var nameLabelP = humanBodyPartUIEntry.Q<Label>("nameLabel");
|
||||
var hashLabelP = humanBodyPartUIEntry.Q<Label>("hashLabel");
|
||||
|
||||
nameLabelP.text = ambp.ToString();
|
||||
hashLabelP.text = i.ToString();
|
||||
|
||||
humanBodyPartsFoldout.Add(humanBodyPartUIEntry);
|
||||
totalPartsCount++;
|
||||
}
|
||||
}
|
||||
humanBodyPartsFoldout.text = $"{totalPartsCount} Included Human Body Parts";
|
||||
|
||||
// Referenced entities view
|
||||
var relatedEntitiesView = rootVisualElement.Q("relatedEntitiesView");
|
||||
var relatedEntitieLabel = rootVisualElement.Q<Label>("relatedEntitiesLabel");
|
||||
AnimatorClipBlobInfoWindow.PopulateReferencedEntities(relatedEntitiesView, relatedEntitieLabel, avatarMaskBlob.refEntities, entityRefAsset);
|
||||
}
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 294ab3a893cd38640a0012da8d97c839
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- m_ViewDataDictionary: {instanceID: 0}
|
||||
- visualTreeAsset: {fileID: 9197481963319205126, guid: 6ca489fd9028a3142bff9e42f2868ae3, type: 3}
|
||||
- includedBoneNameInfoAsset: {fileID: 9197481963319205126, guid: 6359bcda08d7e544f9f48ab95859de29, 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/AvatarMaskInfoWindow/AvatarMaskInfoWindow.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: 16713f8956625e44fad249eca2490acd
|
||||
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/AvatarMaskInfoWindow/AvatarMaskInfoWindow.uss
|
||||
uploadId: 897522
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<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/AvatarMaskInfoWindow/AvatarMaskInfoWindow.uss?fileID=7433441132597879392&guid=16713f8956625e44fad249eca2490acd&type=3#AvatarMaskInfoWindow" />
|
||||
<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="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="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="includedBonesFoldout" 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: 6ca489fd9028a3142bff9e42f2868ae3
|
||||
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/AvatarMaskInfoWindow/AvatarMaskInfoWindow.uxml
|
||||
uploadId: 897522
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<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" parse-escape-sequences="true" display-tooltip-when-elided="true" name="hashLabel" style="width: 332px; border-right-color: rgb(127, 127, 127); border-right-width: 1px;" />
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="nameLabel" style="flex-grow: 1;" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6359bcda08d7e544f9f48ab95859de29
|
||||
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/AvatarMaskInfoWindow/IncludedBoneNameInfoAsset.uxml
|
||||
uploadId: 897522
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a8b46e6832e8e64b9ec5480be87849f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<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="Path" parse-escape-sequences="true" display-tooltip-when-elided="true" name="pathLabel" style="flex-grow: 1; border-right-color: rgb(127, 127, 127); border-right-width: 1px;" />
|
||||
<ui:Label tabindex="-1" text="Size" parse-escape-sequences="true" display-tooltip-when-elided="true" name="sizeLabel" style="width: 100px;" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 61a006cdc2118e0479cd93bf6e8fe271
|
||||
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/BlobCachePane/BlobCacheEntry.uxml
|
||||
uploadId: 897522
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<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="True">
|
||||
<ui:VisualElement style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; 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; border-left-color: rgb(123, 122, 122); border-right-color: rgb(123, 122, 122); border-top-color: rgb(123, 122, 122); border-bottom-color: rgb(123, 122, 122); flex-grow: 1;">
|
||||
<ui:Label tabindex="-1" text="Blob Asset Cache" parse-escape-sequences="true" display-tooltip-when-elided="true" name="header" style="font-size: 16px; padding-right: 4px; padding-bottom: 8px; padding-left: 1px;" />
|
||||
<ui:VisualElement name="blobCacheDisabledLabel" style="flex-grow: 0; flex-direction: row; align-items: center; margin-bottom: 3px;">
|
||||
<ui:Label tabindex="-1" text="⚠" parse-escape-sequences="true" display-tooltip-when-elided="true" style="font-size: 18px; color: rgb(255, 255, 0);" />
|
||||
<ui:Label tabindex="-1" text="Blob cache is disabled. Animation clips and animator controllers will be rebaked on every subscene bake." parse-escape-sequences="true" display-tooltip-when-elided="true" />
|
||||
</ui:VisualElement>
|
||||
<ui:Label tabindex="-1" text="LabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabel" parse-escape-sequences="true" display-tooltip-when-elided="true" name="blobCachePathLabel" />
|
||||
<ui:Label tabindex="-1" text="LabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabel" parse-escape-sequences="true" display-tooltip-when-elided="true" name="totalAnimationsMemLabel" />
|
||||
<ui:Label tabindex="-1" text="LabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabel" parse-escape-sequences="true" display-tooltip-when-elided="true" name="totalControllerMemLabel" />
|
||||
<ui:VisualElement style="flex-grow: 0; flex-direction: row; height: 40px; flex-shrink: 0;">
|
||||
<ui:Button text="Clear Cache" parse-escape-sequences="true" display-tooltip-when-elided="true" name="clearCacheBtn" style="flex-grow: 1;" />
|
||||
<ui:Button text="Disable Cache" parse-escape-sequences="true" display-tooltip-when-elided="true" name="disableEnableCacheBtn" style="flex-grow: 1;" />
|
||||
</ui:VisualElement>
|
||||
<ui:ScrollView scroll-deceleration-rate="0,135" elasticity="0,1" style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-right-radius: 6px; border-bottom-left-radius: 6px; 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);">
|
||||
<ui:Foldout text="Animation Blobs" value="false" name="animationBlobsFoldout" />
|
||||
<ui:Foldout text="Animator Controller Blobs" value="false" name="animatorControllerBlobsFoldout" />
|
||||
</ui:ScrollView>
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 202b212f6ad9b4047a8ac662c7e74ce5
|
||||
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/BlobCachePane/BlobInspectorBlobCache.uxml
|
||||
uploadId: 897522
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<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:Button text="Info" name="btn" style="flex-grow: 1;" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc67005ecd9cc2d4fa5acf24bb390f45
|
||||
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/BlobInfoDefaultInfoBtn.uxml
|
||||
uploadId: 897522
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<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:Label text="Label" name="label" style="margin-left: 6px; flex-grow: 1; -unity-text-align: middle-left;" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5460ee29626c92b47a703070f7c106ba
|
||||
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/BlobInfoDefaultListViewLabel.uxml
|
||||
uploadId: 897522
|
||||
@@ -0,0 +1,644 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Rukhanka.Hybrid;
|
||||
using Rukhanka.Toolbox;
|
||||
using Unity.Collections;
|
||||
using Unity.Entities;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEditor.Compilation;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Rukhanka.Editor
|
||||
{
|
||||
public class BlobInspector : EditorWindow
|
||||
{
|
||||
[SerializeField]
|
||||
private VisualTreeAsset menuAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset blobDBPaneAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset blobCachePaneAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset blobCacheEntryAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset listViewLabelAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset listViewInfoBtnAsset = default;
|
||||
|
||||
VisualElement
|
||||
menuElem,
|
||||
blobCachePane,
|
||||
blobDBPane
|
||||
;
|
||||
|
||||
TwoPaneSplitView splitView;
|
||||
|
||||
internal enum BlobType
|
||||
{
|
||||
AnimatorController,
|
||||
AnimationClip,
|
||||
RigInfo,
|
||||
SkinnedMeshInfo,
|
||||
AvatarMask,
|
||||
Total
|
||||
}
|
||||
|
||||
internal class BlobAssetInfo<T> where T: unmanaged
|
||||
{
|
||||
public BlobAssetReference<T> blobAsset;
|
||||
public List<Entity> refEntities;
|
||||
}
|
||||
|
||||
class BlobAssetsSummary
|
||||
{
|
||||
public int sizeInBytes;
|
||||
public int totalCount;
|
||||
}
|
||||
|
||||
List<BlobAssetInfo<ControllerBlob>> allControllerBlobAssets = new ();
|
||||
List<BlobAssetInfo<AnimationClipBlob>> allAnimationClipBlobAssets = new ();
|
||||
List<BlobAssetInfo<RigDefinitionBlob>> allRigBlobAssets = new ();
|
||||
List<BlobAssetInfo<SkinnedMeshInfoBlob>> allSkinnedMeshBlobAssets = new ();
|
||||
List<BlobAssetInfo<AvatarMaskBlob>> allAvatarMaskBlobAssets = new ();
|
||||
BlobAssetsSummary blobAssetsSummary;
|
||||
|
||||
readonly string nameColumnName = "name";
|
||||
readonly string hashColumnName = "hash";
|
||||
readonly string referencesColumnName = "references";
|
||||
readonly string sizeColumnName = "size";
|
||||
readonly string bakingTimeColumnName = "bakingTime";
|
||||
readonly string infoColumnName = "info";
|
||||
|
||||
internal static World currentWorld;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
[MenuItem("Window/Rukhanka Animation/Blob Inspector")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
var wnd = GetWindow<BlobInspector>();
|
||||
wnd.minSize = new Vector2(1000, 400);
|
||||
wnd.titleContent = new GUIContent("Rukhanka.Animation Blob Inspector");
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public void CreateGUI()
|
||||
{
|
||||
// Each editor window contains a root VisualElement object
|
||||
var root = rootVisualElement;
|
||||
|
||||
splitView = new TwoPaneSplitView(0, 250, TwoPaneSplitViewOrientation.Horizontal);
|
||||
root.Add(splitView);
|
||||
|
||||
menuElem = menuAsset.Instantiate();
|
||||
menuElem.Query<Button>().ForEach((btn) => {btn.RegisterCallback<ClickEvent>(ev => MenuButtonClick(btn));});
|
||||
splitView.Add(menuElem);
|
||||
|
||||
blobDBPane = blobDBPaneAsset.Instantiate()[0];
|
||||
blobCachePane = blobCachePaneAsset.Instantiate()[0];
|
||||
splitView.Add(blobDBPane);
|
||||
|
||||
MenuButtonClick(menuElem.Q("blobDBBtn") as Button);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void MenuButtonClick(Button btn)
|
||||
{
|
||||
menuElem.Query<Button>().ForEach((btn) => {btn.style.backgroundColor = new StyleColor(Color.clear);});
|
||||
btn.style.backgroundColor = new StyleColor(new Color(0.4f, 0.4f, 0.4f, 1));
|
||||
|
||||
splitView.RemoveAt(1);
|
||||
switch (btn.name)
|
||||
{
|
||||
case "blobDBBtn":
|
||||
SwitchToBlobDBPane();
|
||||
break;
|
||||
case "blobCacheBtn":
|
||||
SwitchToBlobCachePane();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void FillBlobDBInifo()
|
||||
{
|
||||
FillWorldList();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void FillWorldList()
|
||||
{
|
||||
var worldSelector = blobDBPane.Q<DropdownField>("worldSelector");
|
||||
worldSelector.RegisterValueChangedCallback((worldName) => { ChangeWorld(worldName.newValue); });
|
||||
worldSelector.choices.Clear();
|
||||
foreach (var world in World.All)
|
||||
{
|
||||
worldSelector.choices.Add(world.Name);
|
||||
}
|
||||
if (worldSelector.index < 0 || worldSelector.index > worldSelector.choices.Count)
|
||||
worldSelector.index = 0;
|
||||
worldSelector.value = worldSelector.choices[worldSelector.index];
|
||||
|
||||
var worldReloadBtn = worldSelector.Q<Button>("worldReloadBtn");
|
||||
Action clickLambda = () => { SwitchToBlobDBPane(); ChangeWorld(worldSelector.choices[worldSelector.index]); };
|
||||
var clk = new Clickable(clickLambda);
|
||||
worldReloadBtn.clickable = clk;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void ChangeWorld(string worldName)
|
||||
{
|
||||
World world = null;
|
||||
for (var i = 0; i < World.All.Count && world == null; ++i)
|
||||
{
|
||||
if (World.All[i].Name == worldName)
|
||||
world = World.All[i];
|
||||
}
|
||||
|
||||
if (world != null)
|
||||
{
|
||||
GatherAllBlobAssets(world);
|
||||
var totalInfoLabel = blobDBPane.Q<Label>("blobInfoTotal");
|
||||
totalInfoLabel.text = GatherBlobDBInfo();
|
||||
CreateBlobAssetList();
|
||||
}
|
||||
currentWorld = world;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
unsafe BlobAssetInfo<T> RegisterBlobAsset<T>(BlobAssetReference<T> bar, List<BlobAssetInfo<T>> allBlobs) where T: unmanaged, GenericAssetBlob
|
||||
{
|
||||
blobAssetsSummary.totalCount += 1;
|
||||
blobAssetsSummary.sizeInBytes += bar.m_data.Header->Length;
|
||||
var alreadyExistIndex = allBlobs.FindIndex(x => x.blobAsset.Value.Hash() == bar.Value.Hash());
|
||||
if (alreadyExistIndex >= 0)
|
||||
return allBlobs[alreadyExistIndex];
|
||||
|
||||
var rv = new BlobAssetInfo<T>()
|
||||
{
|
||||
blobAsset = bar,
|
||||
refEntities = new ()
|
||||
};
|
||||
allBlobs.Add(rv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void GatherAllBlobAssets(World world)
|
||||
{
|
||||
blobAssetsSummary = new ();
|
||||
|
||||
// Gather blob assets from database
|
||||
var dbQ = new EntityQueryBuilder(Allocator.Temp)
|
||||
.WithAll<BlobDatabaseSingleton>()
|
||||
.Build(world.EntityManager);
|
||||
|
||||
if (dbQ.TryGetSingleton<BlobDatabaseSingleton>(out var db))
|
||||
{
|
||||
allAnimationClipBlobAssets.Clear();
|
||||
foreach (var kv in db.animations)
|
||||
{
|
||||
if (!kv.Value.IsCreated)
|
||||
continue;
|
||||
|
||||
RegisterBlobAsset(kv.Value, allAnimationClipBlobAssets);
|
||||
}
|
||||
|
||||
allAvatarMaskBlobAssets.Clear();
|
||||
foreach (var kv in db.avatarMasks)
|
||||
{
|
||||
if (!kv.Value.IsCreated)
|
||||
continue;
|
||||
|
||||
RegisterBlobAsset(kv.Value, allAvatarMaskBlobAssets);
|
||||
}
|
||||
}
|
||||
|
||||
// Gather animator, animation and avatar mask blob assets from entities
|
||||
allControllerBlobAssets.Clear();
|
||||
var eQ = new EntityQueryBuilder(Allocator.Temp)
|
||||
.WithAll<AnimatorControllerLayerComponent>()
|
||||
.Build(world.EntityManager);
|
||||
|
||||
var animControllersChunks = eQ.ToArchetypeChunkArray(Allocator.Temp);
|
||||
var controllerLayerBufHandle = world.EntityManager.GetBufferTypeHandle<AnimatorControllerLayerComponent>(true);
|
||||
var entityHandle = world.EntityManager.GetEntityTypeHandle();
|
||||
for (var i = 0; i < animControllersChunks.Length; ++i)
|
||||
{
|
||||
var chunk = animControllersChunks[i];
|
||||
var bufAcc = chunk.GetBufferAccessor(ref controllerLayerBufHandle);
|
||||
var entities = chunk.GetNativeArray(entityHandle);
|
||||
for (var k = 0; k < chunk.Count; ++k)
|
||||
{
|
||||
var lb = bufAcc[k];
|
||||
var e = entities[k];
|
||||
for (var l = 0; l < lb.Length; ++l)
|
||||
{
|
||||
var acl = lb[l];
|
||||
|
||||
var controllerBlobInfo = RegisterBlobAsset(acl.controller, allControllerBlobAssets);
|
||||
controllerBlobInfo.refEntities.Add(e);
|
||||
|
||||
ref var layers = ref acl.controller.Value.layers;
|
||||
for (var m = 0; m < layers.Length; ++m)
|
||||
{
|
||||
ref var layer = ref layers[m];
|
||||
foreach (var amb in allAvatarMaskBlobAssets)
|
||||
{
|
||||
if (amb.blobAsset.Value.Hash() == layer.avatarMaskBlobHash)
|
||||
amb.refEntities.Add(e);
|
||||
}
|
||||
}
|
||||
|
||||
ref var anims = ref acl.animations.Value.animations;
|
||||
for (var m = 0; m < anims.Length; ++m)
|
||||
{
|
||||
var anmHash = anims[m];
|
||||
foreach (var acb in allAnimationClipBlobAssets)
|
||||
{
|
||||
if (acb.blobAsset.Value.Hash() == anmHash)
|
||||
acb.refEntities.Add(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Gather skinned mesh blob assets from entities
|
||||
allSkinnedMeshBlobAssets.Clear();
|
||||
var eSMR = new EntityQueryBuilder(Allocator.Temp)
|
||||
.WithAll<SkinnedMeshRendererComponent>()
|
||||
.Build(world.EntityManager);
|
||||
|
||||
var smrChunks = eSMR.ToArchetypeChunkArray(Allocator.Temp);
|
||||
var smrTypeHandle = world.EntityManager.GetComponentTypeHandle<SkinnedMeshRendererComponent>(true);
|
||||
for (var i = 0; i < smrChunks.Length; ++i)
|
||||
{
|
||||
var chunk = smrChunks[i];
|
||||
var smrs = chunk.GetNativeArray(ref smrTypeHandle);
|
||||
var entities = chunk.GetNativeArray(entityHandle);
|
||||
for (var k = 0; k < chunk.Count; ++k)
|
||||
{
|
||||
var smr = smrs[k];
|
||||
var e = entities[k];
|
||||
|
||||
var skinnedMeshBlobInfo = RegisterBlobAsset(smr.smrInfoBlob, allSkinnedMeshBlobAssets);
|
||||
skinnedMeshBlobInfo.refEntities.Add(e);
|
||||
}
|
||||
}
|
||||
|
||||
// Gather rig definition blob assets from entities
|
||||
allRigBlobAssets.Clear();
|
||||
var eRig = new EntityQueryBuilder(Allocator.Temp)
|
||||
.WithAll<RigDefinitionComponent>()
|
||||
.Build(world.EntityManager);
|
||||
|
||||
var rigChunks = eRig.ToArchetypeChunkArray(Allocator.Temp);
|
||||
var rigDefTypeHandle = world.EntityManager.GetComponentTypeHandle<RigDefinitionComponent>(true);
|
||||
for (var i = 0; i < rigChunks.Length; ++i)
|
||||
{
|
||||
var chunk = rigChunks[i];
|
||||
var rigs = chunk.GetNativeArray(ref rigDefTypeHandle);
|
||||
var entities = chunk.GetNativeArray(entityHandle);
|
||||
for (var k = 0; k < chunk.Count; ++k)
|
||||
{
|
||||
var rigDef = rigs[k];
|
||||
var e = entities[k];
|
||||
|
||||
var rigBlobInfo = RegisterBlobAsset(rigDef.rigBlob, allRigBlobAssets);
|
||||
rigBlobInfo.refEntities.Add(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
string GatherBlobDBInfo()
|
||||
{
|
||||
var rv = $"Summary: {blobAssetsSummary.totalCount} blob assets, total memory {CommonTools.FormatMemory(blobAssetsSummary.sizeInBytes)}";
|
||||
return rv;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void SwitchToBlobCachePane()
|
||||
{
|
||||
splitView.Add(blobCachePane);
|
||||
var clearCacheBtn = rootVisualElement.Q<Button>("clearCacheBtn");
|
||||
var disableEnableCacheBtn = rootVisualElement.Q<Button>("disableEnableCacheBtn");
|
||||
|
||||
Action clearCacheLambda = () =>
|
||||
{
|
||||
Directory.Delete(BlobCache.GetControllerBlobCacheDirPath(), true);
|
||||
Directory.Delete(BlobCache.GetAnimationBlobCacheDirPath(), true);
|
||||
FillBlobCacheInfo();
|
||||
};
|
||||
clearCacheBtn.clickable = new Clickable(clearCacheLambda);
|
||||
|
||||
Action disableEnableCacheLambda = () =>
|
||||
{
|
||||
var bt = EditorUserBuildSettings.activeBuildTarget;
|
||||
var btg = BuildPipeline.GetBuildTargetGroup(bt);
|
||||
var target = NamedBuildTarget.FromBuildTargetGroup(btg);
|
||||
PlayerSettings.GetScriptingDefineSymbols(target, out var defines);
|
||||
#if RUKHANKA_NO_BLOB_CACHE
|
||||
var l = new List<string>(defines);
|
||||
l.Remove("RUKHANKA_NO_BLOB_CACHE");
|
||||
defines = l.ToArray();
|
||||
#else
|
||||
var newDefines = new string[defines.Length + 1];
|
||||
Array.Copy(defines, newDefines, defines.Length);
|
||||
newDefines[^1] = "RUKHANKA_NO_BLOB_CACHE";
|
||||
defines = newDefines;
|
||||
#endif
|
||||
PlayerSettings.SetScriptingDefineSymbols(target, defines);
|
||||
CompilationPipeline.RequestScriptCompilation();
|
||||
};
|
||||
disableEnableCacheBtn.clickable = new Clickable(disableEnableCacheLambda);
|
||||
#if RUKHANKA_NO_BLOB_CACHE
|
||||
disableEnableCacheBtn.text = "Enable Cache";
|
||||
#else
|
||||
disableEnableCacheBtn.text = "Disable Cache";
|
||||
var blobCacheDisabledLabel = rootVisualElement.Q<VisualElement>("blobCacheDisabledLabel");
|
||||
blobCacheDisabledLabel.style.display = DisplayStyle.None;
|
||||
#endif
|
||||
|
||||
FillBlobCacheInfo();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void SwitchToBlobDBPane()
|
||||
{
|
||||
splitView.Add(blobDBPane);
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
var noDebugInfoWarning = blobDBPane.Q("noRukhankaDebugInfoWarning");
|
||||
noDebugInfoWarning.style.display = DisplayStyle.None;
|
||||
#endif
|
||||
FillBlobDBInifo();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
unsafe void FillMultiColumnViewList<T>(MultiColumnListView lv, List<BlobAssetInfo<T>> allBlobAssets, Action<int> infoBtnClickAction) where T: unmanaged, GenericAssetBlob
|
||||
{
|
||||
lv.itemsSource = allBlobAssets;
|
||||
|
||||
lv.columns[infoColumnName].makeCell = () => listViewInfoBtnAsset.Instantiate().Q<Button>("btn");
|
||||
lv.columns[nameColumnName].makeCell = () => listViewLabelAsset.Instantiate().Q<Label>("label");
|
||||
lv.columns[hashColumnName].makeCell = () => listViewLabelAsset.Instantiate().Q<Label>("label");
|
||||
lv.columns[referencesColumnName].makeCell = () => listViewLabelAsset.Instantiate().Q<Label>("label");
|
||||
lv.columns[bakingTimeColumnName].makeCell = () => listViewLabelAsset.Instantiate().Q<Label>("label");
|
||||
lv.columns[sizeColumnName].makeCell = () => listViewLabelAsset.Instantiate().Q<Label>("label");
|
||||
|
||||
lv.columns[infoColumnName].bindCell = (VisualElement ve, int index) =>
|
||||
(ve as Button).clicked += () => infoBtnClickAction(index);
|
||||
lv.columns[referencesColumnName].bindCell = (VisualElement ve, int index) =>
|
||||
(ve as Label).text = allBlobAssets[index].refEntities.Count.ToString();
|
||||
lv.columns[nameColumnName].bindCell = (VisualElement ve, int index) =>
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
(ve as Label).text = allBlobAssets[index].blobAsset.Value.Name();
|
||||
#else
|
||||
(ve as Label).text = "-";
|
||||
#endif
|
||||
lv.columns[hashColumnName].bindCell = (VisualElement ve, int index) =>
|
||||
(ve as Label).text = allBlobAssets[index].blobAsset.Value.Hash().ToString();
|
||||
lv.columns[bakingTimeColumnName].bindCell = (VisualElement ve, int index) =>
|
||||
{
|
||||
var bt = -1.0f;
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
bt = allBlobAssets[index].blobAsset.Value.BakingTime();
|
||||
#endif
|
||||
(ve as Label).text = bt < 0 ? "-" : $"{bt:F3} sec";
|
||||
};
|
||||
|
||||
lv.columns[sizeColumnName].bindCell = (VisualElement ve, int index) =>
|
||||
(ve as Label).text = CommonTools.FormatMemory(allBlobAssets[index].blobAsset.m_data.Header->Length);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CreateBlobAssetList()
|
||||
{
|
||||
var animationClipsList = blobDBPane.Q<MultiColumnListView>("animationClipList");
|
||||
Action<int> infoCallback = (idx) =>
|
||||
{
|
||||
AnimatorClipBlobInfoWindow.animationClipBlob = allAnimationClipBlobAssets[idx];
|
||||
var wnd = GetWindow<AnimatorClipBlobInfoWindow>();
|
||||
wnd.Show();
|
||||
};
|
||||
FillMultiColumnViewList(animationClipsList, allAnimationClipBlobAssets, infoCallback);
|
||||
|
||||
var animatorControllersList = blobDBPane.Q<MultiColumnListView>("controllerList");
|
||||
infoCallback = (idx) =>
|
||||
{
|
||||
AnimatorControllerBlobInfoWindow.controllerBlob = allControllerBlobAssets[idx];
|
||||
var wnd = GetWindow<AnimatorControllerBlobInfoWindow>();
|
||||
wnd.Show();
|
||||
};
|
||||
FillMultiColumnViewList(animatorControllersList, allControllerBlobAssets, infoCallback);
|
||||
|
||||
var rigList = blobDBPane.Q<MultiColumnListView>("rigList");
|
||||
infoCallback = (idx) =>
|
||||
{
|
||||
RigBlobInfoWindow.rigBlob = allRigBlobAssets[idx];
|
||||
var wnd = GetWindow<RigBlobInfoWindow>();
|
||||
wnd.Show();
|
||||
};
|
||||
FillMultiColumnViewList(rigList, allRigBlobAssets, infoCallback);
|
||||
|
||||
var avatarMaskList = blobDBPane.Q<MultiColumnListView>("avatarMaskList");
|
||||
infoCallback = (idx) =>
|
||||
{
|
||||
AvatarMaskInfoWindow.avatarMaskBlob = allAvatarMaskBlobAssets[idx];
|
||||
var wnd = GetWindow<AvatarMaskInfoWindow>();
|
||||
wnd.Show();
|
||||
};
|
||||
FillMultiColumnViewList(avatarMaskList, allAvatarMaskBlobAssets, infoCallback);
|
||||
|
||||
var smrList = blobDBPane.Q<MultiColumnListView>("smrList");
|
||||
infoCallback = (idx) =>
|
||||
{
|
||||
SkinnedMeshBlobInfoWindow.skinnedMeshBlob = allSkinnedMeshBlobAssets[idx];
|
||||
var wnd = GetWindow<SkinnedMeshBlobInfoWindow>();
|
||||
wnd.Show();
|
||||
};
|
||||
FillMultiColumnViewList(smrList, allSkinnedMeshBlobAssets, infoCallback);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
unsafe void FillBlobAssetInfoText(BlobAssetListInfo li, BlobAssetInfo ba)
|
||||
{
|
||||
switch (ba.blobType)
|
||||
{
|
||||
case BlobType.AnimationClip:
|
||||
{
|
||||
var acb = ba.blobAsset.Reinterpret<AnimationClipBlob>();
|
||||
li.name = "-";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
li.name = acb.Value.name.ToString();
|
||||
#endif
|
||||
li.references = ba.refEntities.Count;
|
||||
li.size = ba.blobAsset.m_data.Header->Length;
|
||||
li.bakingTime = -1;
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
li.bakingTime = acb.Value.bakingTime;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case BlobType.AnimatorController:
|
||||
{
|
||||
var acb = ba.blobAsset.Reinterpret<ControllerBlob>();
|
||||
var nameText = $"[{acb.Value.hash}]";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
nameText += $" '{acb.Value.name.ToString()}'";
|
||||
#endif
|
||||
var infoText = $"References: {ba.refEntities.Count}, Size: { CommonTools.FormatMemory(ba.blobAsset.m_data.Header->Length) }";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
infoText += $" Baking time: {acb.Value.bakingTime:F3} sec";
|
||||
#endif
|
||||
infoLabel.text = infoText;
|
||||
nameLabel.text = nameText;
|
||||
infoBtn.clicked += () =>
|
||||
{
|
||||
AnimatorControllerBlobInfoWindow.controllerBlob = ba;
|
||||
var wnd = GetWindow<AnimatorControllerBlobInfoWindow>();
|
||||
wnd.Show();
|
||||
};
|
||||
break;
|
||||
}
|
||||
case BlobType.RigInfo:
|
||||
{
|
||||
var acb = ba.blobAsset.Reinterpret<RigDefinitionBlob>();
|
||||
var nameText = $"[{acb.Value.hash}]";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
nameText = $" '{acb.Value.name.ToString()}'";
|
||||
#endif
|
||||
var infoText = $"References: {ba.refEntities.Count}, Size: {CommonTools.FormatMemory(ba.blobAsset.m_data.Header->Length)}";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
infoText += $" Baking time: {acb.Value.bakingTime:F3} sec";
|
||||
#endif
|
||||
infoLabel.text = infoText;
|
||||
nameLabel.text = nameText;
|
||||
infoBtn.clicked += () =>
|
||||
{
|
||||
RigBlobInfoWindow.rigBlob = ba;
|
||||
var wnd = GetWindow<RigBlobInfoWindow>();
|
||||
wnd.Show();
|
||||
};
|
||||
break;
|
||||
}
|
||||
case BlobType.AvatarMask:
|
||||
{
|
||||
var acb = ba.blobAsset.Reinterpret<AvatarMaskBlob>();
|
||||
var nameText = $"[{acb.Value.hash}]";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
nameText += $" '{acb.Value.name.ToString()}'";
|
||||
#endif
|
||||
var infoText = $"References: {ba.refEntities.Count}, Size: { CommonTools.FormatMemory(ba.blobAsset.m_data.Header->Length) }";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
infoText += $" Baking time: {acb.Value.bakingTime:F3} sec";
|
||||
#endif
|
||||
infoLabel.text = infoText;
|
||||
nameLabel.text = nameText;
|
||||
infoBtn.clicked += () =>
|
||||
{
|
||||
AvatarMaskInfoWindow.avatarMaskBlob = ba;
|
||||
var wnd = GetWindow<AvatarMaskInfoWindow>();
|
||||
wnd.Show();
|
||||
};
|
||||
break;
|
||||
}
|
||||
case BlobType.SkinnedMeshInfo:
|
||||
{
|
||||
var acb = ba.blobAsset.Reinterpret<SkinnedMeshInfoBlob>();
|
||||
var nameText = $"[{acb.Value.hash}]";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
nameText += $" '{acb.Value.skeletonName.ToString()}'";
|
||||
#endif
|
||||
var infoText = $"References: {ba.refEntities.Count}, Size: {CommonTools.FormatMemory(ba.blobAsset.m_data.Header->Length)}";
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
infoText += $" Baking time: {acb.Value.bakingTime:F3} sec";
|
||||
#endif
|
||||
infoLabel.text = infoText;
|
||||
nameLabel.text = nameText;
|
||||
infoBtn.clicked += () =>
|
||||
{
|
||||
SkinnedMeshBlobInfoWindow.skinnedMeshBlob = ba;
|
||||
var wnd = GetWindow<SkinnedMeshBlobInfoWindow>();
|
||||
wnd.Show();
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void FillBlobCacheInfo()
|
||||
{
|
||||
var cachePathLabel = rootVisualElement.Q<Label>("blobCachePathLabel");
|
||||
cachePathLabel.text = $"Cache Path: '{BlobCache.GetBlobCacheDirPath()}'";
|
||||
|
||||
var controllerMem = FillBlobList("animatorControllerBlobsFoldout", "Animator Controller Blobs", BlobCache.GetControllerBlobCacheDirPath());
|
||||
var animationsMem = FillBlobList("animationBlobsFoldout", "Animation Clip Blobs", BlobCache.GetAnimationBlobCacheDirPath());
|
||||
|
||||
var animMemLabel = rootVisualElement.Q<Label>("totalAnimationsMemLabel");
|
||||
var controllerMemLabel = rootVisualElement.Q<Label>("totalControllerMemLabel");
|
||||
animMemLabel.text = $"Total animation blob cache size: {CommonTools.FormatMemory(animationsMem)}";
|
||||
controllerMemLabel.text = $"Total animator controller blob cache size: {CommonTools.FormatMemory(controllerMem)}";
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
long FillBlobList(string foldoutName, string foldoutCaption, string cachePath)
|
||||
{
|
||||
var foldout = rootVisualElement.Q<Foldout>(foldoutName);
|
||||
foldout.Clear();
|
||||
var numCachedBlobs = 0;
|
||||
var rv = 0L;
|
||||
|
||||
if (Directory.Exists(cachePath))
|
||||
{
|
||||
var files = Directory.GetFiles(cachePath);
|
||||
for (var i = 0; i < files.Length; ++i)
|
||||
{
|
||||
var entry = blobCacheEntryAsset.Instantiate();
|
||||
var file = files[i].Replace('\\', '/');
|
||||
|
||||
if (i % 2 == 0)
|
||||
entry.style.backgroundColor = new StyleColor(new Color(0.3f, 0.3f, 0.3f, 1));
|
||||
|
||||
var entryPath = entry.Q<Label>("pathLabel");
|
||||
var sizeLabel = entry.Q<Label>("sizeLabel");
|
||||
entryPath.text = file.Replace(BlobCache.GetBlobCacheDirPath(), "");
|
||||
var fs = new FileInfo(file).Length;
|
||||
sizeLabel.text = CommonTools.FormatMemory(fs);
|
||||
rv += fs;
|
||||
|
||||
foldout.Add(entry);
|
||||
}
|
||||
numCachedBlobs += files.Length;
|
||||
}
|
||||
foldout.text = $"{numCachedBlobs} {foldoutCaption}";
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa076ec4336df4f46947f60ce8404cf9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- m_ViewDataDictionary: {instanceID: 0}
|
||||
- menuAsset: {fileID: 9197481963319205126, guid: 3e3246b4cd78cb84da58702492c804d9, type: 3}
|
||||
- blobDBPaneAsset: {fileID: 9197481963319205126, guid: 55574cc96c16a36439b8b5868bda3802, type: 3}
|
||||
- blobCachePaneAsset: {fileID: 9197481963319205126, guid: 202b212f6ad9b4047a8ac662c7e74ce5, type: 3}
|
||||
- blobEntryAsset: {fileID: 9197481963319205126, guid: 22a82583551fa7a4bbb99ebbde09a9ec, type: 3}
|
||||
- blobCacheEntryAsset: {fileID: 9197481963319205126, guid: 61a006cdc2118e0479cd93bf6e8fe271, type: 3}
|
||||
- listViewLabelAsset: {fileID: 9197481963319205126, guid: 5460ee29626c92b47a703070f7c106ba, type: 3}
|
||||
- listViewInfoBtnAsset: {fileID: 9197481963319205126, guid: cc67005ecd9cc2d4fa5acf24bb390f45, 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/BlobInspector.cs
|
||||
uploadId: 897522
|
||||
@@ -0,0 +1,5 @@
|
||||
.custom-label {
|
||||
font-size: 20px;
|
||||
-unity-font-style: bold;
|
||||
color: rgb(68, 138, 255);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bf0fc2bfc0154a4bb8547a45c588659
|
||||
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/BlobInspector.uss
|
||||
uploadId: 897522
|
||||
@@ -0,0 +1,3 @@
|
||||
<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="True">
|
||||
<Style src="project://database/Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/BlobInspector.uss?fileID=7433441132597879392&guid=1bf0fc2bfc0154a4bb8547a45c588659&type=3#BlobInspector" />
|
||||
</ui:UXML>
|
||||
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d1b63d7ef2f32d41bbba873160e8aa9
|
||||
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/BlobInspector.uxml
|
||||
uploadId: 897522
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
<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="True">
|
||||
<ui:VisualElement name="VisualElement" style="border-left-color: rgb(123, 122, 122); border-right-color: rgb(123, 122, 122); border-top-color: rgb(123, 122, 122); border-bottom-color: rgb(123, 122, 122); 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:Label tabindex="-1" text="Blob Asset Runtime Database" parse-escape-sequences="true" display-tooltip-when-elided="true" name="blobAssetRuntimeDBHeader" style="font-size: 16px; padding-right: 4px; padding-bottom: 8px; padding-left: 1px;" />
|
||||
<ui:VisualElement name="noRukhankaDebugInfoWarning" style="flex-grow: 0; flex-direction: row; -unity-text-align: middle-left;">
|
||||
<ui:Label tabindex="-1" text="⚠" parse-escape-sequences="true" display-tooltip-when-elided="true" style="color: rgb(255, 255, 0); font-size: 18px;" />
|
||||
<ui:Label tabindex="-1" text="No 'RUKHANKA_DEBUG_INFO' defined. Asset names and baking times will be unavailable." parse-escape-sequences="true" display-tooltip-when-elided="true" />
|
||||
</ui:VisualElement>
|
||||
<ui:DropdownField label="World:" name="worldSelector" style="padding-top: 4px; padding-right: 2px; padding-bottom: 4px; padding-left: 1px;">
|
||||
<ui:Button text="Reload" parse-escape-sequences="true" display-tooltip-when-elided="true" name="worldReloadBtn" />
|
||||
</ui:DropdownField>
|
||||
<ui:Label tabindex="-1" parse-escape-sequences="true" display-tooltip-when-elided="true" text="Skinned mesh blob assets:" name="blobInfoTotal" style="padding-left: 1px; padding-right: 2px; padding-top: 4px; padding-bottom: 4px;" />
|
||||
<ui:ScrollView scroll-deceleration-rate="0,135" elasticity="0,1" vertical-scroller-visibility="AlwaysVisible" style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-left-color: rgb(123, 122, 122); border-right-color: rgb(123, 122, 122); border-top-color: rgb(123, 122, 122); border-bottom-color: rgb(123, 122, 122); 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;">
|
||||
<ui:MultiColumnListView name="animationClipList" show-alternating-row-backgrounds="ContentOnly" show-foldout-header="true" header-title="Animation Clip Blobs" allow-add="false" allow-remove="false" show-border="true" selection-type="Single" show-bound-collection-size="true" virtualization-method="FixedHeight" style="margin-top: 4px; margin-right: 4px; margin-bottom: 4px; margin-left: 4px;">
|
||||
<ui:Columns stretch-mode="GrowAndFill" resize-preview="false" reorderable="false">
|
||||
<ui:Column name="info" width="40px" resizable="false" />
|
||||
<ui:Column stretchable="true" title="Hash" name="hash" />
|
||||
<ui:Column title="Name" stretchable="true" name="name" />
|
||||
<ui:Column title="References" stretchable="true" name="references" />
|
||||
<ui:Column title="Size" stretchable="true" name="size" />
|
||||
<ui:Column name="bakingTime" title="Baking Time" stretchable="true" />
|
||||
</ui:Columns>
|
||||
</ui:MultiColumnListView>
|
||||
<ui:MultiColumnListView name="controllerList" show-alternating-row-backgrounds="ContentOnly" show-foldout-header="true" header-title="Animator Controllers" allow-add="false" allow-remove="false" show-border="true" selection-type="Single" show-bound-collection-size="true" virtualization-method="FixedHeight" style="margin-top: 4px; margin-right: 4px; margin-bottom: 4px; margin-left: 4px;">
|
||||
<ui:Columns stretch-mode="GrowAndFill" resize-preview="false">
|
||||
<ui:Column stretchable="true" title="Hash" name="hash" />
|
||||
<ui:Column title="Name" stretchable="true" name="name" />
|
||||
<ui:Column title="References" stretchable="true" name="references" />
|
||||
<ui:Column title="Size" stretchable="true" name="size" />
|
||||
<ui:Column name="bakingTime" title="Baking Time" stretchable="true" />
|
||||
<ui:Column name="info" width="40px" resizable="false" />
|
||||
</ui:Columns>
|
||||
</ui:MultiColumnListView>
|
||||
<ui:MultiColumnListView name="rigList" show-alternating-row-backgrounds="ContentOnly" show-foldout-header="true" header-title="Rigs" allow-add="false" allow-remove="false" show-border="true" selection-type="Single" show-bound-collection-size="true" virtualization-method="FixedHeight" style="margin-top: 4px; margin-right: 4px; margin-bottom: 4px; margin-left: 4px;">
|
||||
<ui:Columns stretch-mode="GrowAndFill" resize-preview="false">
|
||||
<ui:Column stretchable="true" title="Hash" name="hash" />
|
||||
<ui:Column title="Name" stretchable="true" name="name" />
|
||||
<ui:Column title="References" stretchable="true" name="references" />
|
||||
<ui:Column title="Size" stretchable="true" name="size" />
|
||||
<ui:Column name="bakingTime" title="Baking Time" stretchable="true" />
|
||||
<ui:Column name="info" resizable="false" width="40px" />
|
||||
</ui:Columns>
|
||||
</ui:MultiColumnListView>
|
||||
<ui:MultiColumnListView name="avatarMaskList" show-alternating-row-backgrounds="ContentOnly" show-foldout-header="true" header-title="Avatar Masks" allow-add="false" allow-remove="false" show-border="true" selection-type="Single" show-bound-collection-size="true" virtualization-method="FixedHeight" style="margin-top: 4px; margin-right: 4px; margin-bottom: 4px; margin-left: 4px;">
|
||||
<ui:Columns stretch-mode="GrowAndFill" resize-preview="false">
|
||||
<ui:Column stretchable="true" title="Hash" name="hash" />
|
||||
<ui:Column title="Name" stretchable="true" name="name" />
|
||||
<ui:Column title="References" stretchable="true" name="references" />
|
||||
<ui:Column title="Size" stretchable="true" name="size" />
|
||||
<ui:Column name="bakingTime" title="Baking Time" stretchable="true" />
|
||||
<ui:Column name="info" resizable="false" width="40px" />
|
||||
</ui:Columns>
|
||||
</ui:MultiColumnListView>
|
||||
<ui:MultiColumnListView name="smrList" show-alternating-row-backgrounds="ContentOnly" show-foldout-header="true" header-title="Skinned Meshes" allow-add="false" allow-remove="false" show-border="true" selection-type="Single" show-bound-collection-size="true" virtualization-method="FixedHeight" style="margin-top: 4px; margin-right: 4px; margin-bottom: 4px; margin-left: 4px;">
|
||||
<ui:Columns stretch-mode="GrowAndFill" resize-preview="false">
|
||||
<ui:Column stretchable="true" title="Hash" name="hash" />
|
||||
<ui:Column title="Name" stretchable="true" name="name" />
|
||||
<ui:Column title="References" stretchable="true" name="references" />
|
||||
<ui:Column title="Size" stretchable="true" name="size" />
|
||||
<ui:Column name="bakingTime" title="Baking Time" stretchable="true" />
|
||||
<ui:Column name="info" width="40px" resizable="false" />
|
||||
</ui:Columns>
|
||||
</ui:MultiColumnListView>
|
||||
</ui:ScrollView>
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55574cc96c16a36439b8b5868bda3802
|
||||
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/BlobInspectorBlobDB.uxml
|
||||
uploadId: 897522
|
||||
@@ -0,0 +1,7 @@
|
||||
<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="True">
|
||||
<ui:Button text="Blob Asset Database" parse-escape-sequences="true" display-tooltip-when-elided="true" name="blobDBBtn" style="height: 50px; font-size: 16px;" />
|
||||
<ui:Button text="Blob Asset Cache" parse-escape-sequences="true" display-tooltip-when-elided="true" name="blobCacheBtn" style="height: 50px; font-size: 16px;" />
|
||||
<ui:VisualElement style="flex-grow: 1; flex-direction: row; align-items: flex-start;">
|
||||
<ui:VisualElement name="Logo" style="flex-grow: 1; height: 113px; width: 280px; background-image: url("project://database/Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/RukhankaLogoSmall.png?fileID=2800000&guid=9152f2aee957bdc488befd900ff896e4&type=3#RukhankaLogoSmall"); -unity-background-scale-mode: scale-to-fit; justify-content: flex-start; align-self: flex-start; margin-top: 20px;" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e3246b4cd78cb84da58702492c804d9
|
||||
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/BlobInspectorMenu.uxml
|
||||
uploadId: 897522
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<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; justify-content: flex-start; align-items: center; flex-shrink: 0;">
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="nameAndHashLabel" />
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="infoLabel" style="flex-grow: 1; -unity-text-align: middle-right;" />
|
||||
<ui:Button text="Info" parse-escape-sequences="true" display-tooltip-when-elided="true" name="infoBtn" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 22a82583551fa7a4bbb99ebbde09a9ec
|
||||
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/BlobInspectorSingleBlobEntry.uxml
|
||||
uploadId: 897522
|
||||
@@ -0,0 +1,6 @@
|
||||
<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="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="entityIDLabel" style="width: 96px;" />
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="nameLabel" style="flex-grow: 1;" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dba65a86cda2861448a7ae7891041b16
|
||||
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/EntityRefEntry.uxml
|
||||
uploadId: 897522
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92098ddd309dc0048b8aa027e9965c3f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+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
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0b07c4f9006927403f888bfd692e356f5c9f108dc7a0854ab7f4c4aeb1778173
|
||||
size 34272
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9152f2aee957bdc488befd900ff896e4
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 0
|
||||
wrapV: 0
|
||||
wrapW: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 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/RukhankaLogoSmall.png
|
||||
uploadId: 897522
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e900011faaac85042ac88a822829eec1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
using Rukhanka.Toolbox;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Rukhanka.Editor
|
||||
{
|
||||
public class SkinnedMeshBlobInfoWindow : EditorWindow
|
||||
{
|
||||
[SerializeField]
|
||||
private VisualTreeAsset visualTreeAsset = default;
|
||||
|
||||
[SerializeField]
|
||||
private VisualTreeAsset boneInfoAsset = default;
|
||||
|
||||
[SerializeField]
|
||||
private VisualTreeAsset entityRefAsset = default;
|
||||
|
||||
internal static BlobInspector.BlobAssetInfo<SkinnedMeshInfoBlob> skinnedMeshBlob;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public void CreateGUI()
|
||||
{
|
||||
var root = rootVisualElement;
|
||||
var doc = visualTreeAsset.Instantiate();
|
||||
root.Add(doc);
|
||||
|
||||
titleContent = new GUIContent("Rukhanka.Animation Skinned Mesh Mask Info");
|
||||
FillSkinnedMeshInfo();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
unsafe void FillSkinnedMeshInfo()
|
||||
{
|
||||
ref var b = ref skinnedMeshBlob.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.skeletonName.ToString();
|
||||
bakingTimeLabel.text = $"{b.bakingTime:F3} sec";
|
||||
#else
|
||||
nameLabel.text = "-";
|
||||
bakingTimeLabel.text = "-";
|
||||
#endif
|
||||
|
||||
var sizeLabel = rootVisualElement.Q<Label>("sizeLabel");
|
||||
sizeLabel.text = CommonTools.FormatMemory(skinnedMeshBlob.blobAsset.m_data.Header->Length);
|
||||
|
||||
var verticesCountLabel = rootVisualElement.Q<Label>("verticesCountLabel");
|
||||
verticesCountLabel.text = $"{b.meshVerticesCount}";
|
||||
|
||||
var boneWeightsCountLabel = rootVisualElement.Q<Label>("boneWeightsCountLabel");
|
||||
boneWeightsCountLabel.text = $"{b.meshBoneWeightsCount}";
|
||||
|
||||
ref var bones = ref b.bones;
|
||||
|
||||
// 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 hashLabelB = boneInfoUIEntry.Q<Label>("hashLabel");
|
||||
var nameLabelB = boneInfoUIEntry.Q<Label>("nameLabel");
|
||||
//var bindPoseLabelB = boneInfoUIEntry.Q<Label>("bindPoseLabel");
|
||||
|
||||
hashLabelB.text = bone.hash.ToString();
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
nameLabelB.text = bone.name.ToString();
|
||||
#else
|
||||
nameLabelB.text = "-";
|
||||
#endif
|
||||
//bindPoseLabelB.text = bone.bindPose.ToString();
|
||||
|
||||
bonesFoldout.Add(boneInfoUIEntry);
|
||||
}
|
||||
|
||||
// Fill blend shapes data
|
||||
var blendShapesFoldout = rootVisualElement.Q<Foldout>("blendShapesFoldout");
|
||||
ref var blendShapes = ref b.blendShapes;
|
||||
blendShapesFoldout.text = $"{blendShapes.Length} Blend Shapes";
|
||||
|
||||
blendShapesFoldout.Add(boneInfoAsset.Instantiate());
|
||||
for (var i = 0; i < blendShapes.Length; ++i)
|
||||
{
|
||||
ref var bs = ref blendShapes[i];
|
||||
var boneInfoUIEntry = boneInfoAsset.Instantiate();
|
||||
if (i % 2 == 0)
|
||||
boneInfoUIEntry.style.backgroundColor = new StyleColor(new Color(0.3f, 0.3f, 0.3f, 1));
|
||||
|
||||
var hashLabelB = boneInfoUIEntry.Q<Label>("hashLabel");
|
||||
var nameLabelB = boneInfoUIEntry.Q<Label>("nameLabel");
|
||||
|
||||
hashLabelB.text = bs.hash.ToString();
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
nameLabelB.text = bs.name.ToString();
|
||||
#else
|
||||
nameLabelB.text = "-";
|
||||
#endif
|
||||
|
||||
blendShapesFoldout.Add(boneInfoUIEntry);
|
||||
}
|
||||
|
||||
// Referenced entities view
|
||||
var relatedEntitiesView = rootVisualElement.Q("relatedEntitiesView");
|
||||
var relatedEntitieLabel = rootVisualElement.Q<Label>("relatedEntitiesLabel");
|
||||
AnimatorClipBlobInfoWindow.PopulateReferencedEntities(relatedEntitiesView, relatedEntitieLabel, skinnedMeshBlob.refEntities, entityRefAsset);
|
||||
}
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 81ee75d06dc383a42b4f763d5cf13fe7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- m_ViewDataDictionary: {instanceID: 0}
|
||||
- visualTreeAsset: {fileID: 9197481963319205126, guid: 06c6e9527627135448712b749ece8773, type: 3}
|
||||
- boneInfoAsset: {fileID: 9197481963319205126, guid: c9320b9b2ed0f1942a921cdc76fd4072, 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/SkinnedMeshBlobInfoWindow/SkinnedMeshBlobInfoWindow.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: 6e371b466073a1848895a5824af0da1b
|
||||
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/SkinnedMeshBlobInfoWindow/SkinnedMeshBlobInfoWindow.uss
|
||||
uploadId: 897522
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<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: 164px; 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="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:Label tabindex="-1" text="Vertices Count:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Bone Weights Count:" 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="bakingTimeLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="sizeLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="verticesCountLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="boneWeightsCountLabel" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:ScrollView scroll-deceleration-rate="0,135" elasticity="0,1" mode="VerticalAndHorizontal" 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" name="blendShapesFoldout" value="false" style="align-items: stretch;" />
|
||||
</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: 06c6e9527627135448712b749ece8773
|
||||
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/SkinnedMeshBlobInfoWindow/SkinnedMeshBlobInfoWindow.uxml
|
||||
uploadId: 897522
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<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="hashLabel" style="width: 296px; 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-width: 1px; border-right-color: rgb(127, 127, 127);" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c9320b9b2ed0f1942a921cdc76fd4072
|
||||
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/SkinnedMeshBlobInfoWindow/SkinnedMeshBoneInfoEntry.uxml
|
||||
uploadId: 897522
|
||||
@@ -0,0 +1,20 @@
|
||||
using Rukhanka.Hybrid;
|
||||
using UnityEditor;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Rukhanka.Editor
|
||||
{
|
||||
[CustomEditor(typeof(BoneVisualizationAuthoring))]
|
||||
public class BoneVisualizationAuthoringEditor: UnityEditor.Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
DrawDefaultInspector();
|
||||
#else
|
||||
EditorGUILayout.HelpBox("No RUKHANKA_DEBUG_INFO scripting symbol defined\n\nBone visualization is not available", MessageType.Warning);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a035cf488ce39084eaf7eff05e31fc88
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
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/BoneVisualizationAuthoringEditor.cs
|
||||
uploadId: 897522
|
||||
@@ -0,0 +1,26 @@
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEngine;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Rukhanka.Editor
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
public class RukhankaEditorAutorun
|
||||
{
|
||||
static RukhankaEditorAutorun()
|
||||
{
|
||||
#if !UNITY_BURST_EXPERIMENTAL_ATOMIC_INTRINSICS
|
||||
// Add obligatory UNITY_BURST_EXPERIMENTAL_ATOMIC_INTRINSICS script symbol
|
||||
ProjectScriptSymbolManager.AddScriptSymbol("UNITY_BURST_EXPERIMENTAL_ATOMIC_INTRINSICS");
|
||||
#endif
|
||||
|
||||
#if RUKHANKA_SHADER_DEBUG
|
||||
var scc = new ShaderConfigManager(SettingsWindow.SHADER_CONFIG_PATH);
|
||||
scc.AddScriptSymbol("RUKHANKA_SHADER_DEBUG");
|
||||
scc.ApplyChanges();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user