ugh
This commit is contained in:
parent
6031db6620
commit
4809e7cfa0
17 changed files with 276 additions and 159 deletions
|
|
@ -164,18 +164,18 @@ namespace gay.lilyy.aaccore
|
|||
// Start overall timer
|
||||
var overallStopwatch = Stopwatch.StartNew();
|
||||
|
||||
V5AACLogger.LogInfo("Starting Lillith V5 AAC generation...");
|
||||
AACLogger.LogInfo("Starting AAC generation...");
|
||||
var root = ComponentHelper.GetComponentInChildrenWithError<AACRoot>(ctx.AvatarRootObject);
|
||||
if (root == null)
|
||||
{
|
||||
V5AACLogger.LogInfo("No LillithV5AACRoot component found. Skipping.");
|
||||
AACLogger.LogInfo("No AACRoot component found. Skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip if the root GameObject or the component itself is disabled
|
||||
if (!root.enabled || !root.gameObject.activeInHierarchy)
|
||||
{
|
||||
V5AACLogger.LogInfo($"LillithV5AACRoot on GameObject '{root.name}' is disabled or inactive. Skipping.");
|
||||
AACLogger.LogInfo($"AACRoot on GameObject '{root.name}' is disabled or inactive. Skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -193,7 +193,7 @@ namespace gay.lilyy.aaccore
|
|||
|
||||
// Time AAC initialization
|
||||
var initStopwatch = Stopwatch.StartNew();
|
||||
V5AACLogger.LogInfo("Initializing Animator As Code...");
|
||||
AACLogger.LogInfo("Initializing Animator As Code...");
|
||||
assets.aac = AacV1.Create(new AacConfiguration
|
||||
{
|
||||
SystemName = SystemName,
|
||||
|
|
@ -209,11 +209,11 @@ namespace gay.lilyy.aaccore
|
|||
|
||||
assets.fx = assets.aac.NewAnimatorController();
|
||||
initStopwatch.Stop();
|
||||
V5AACLogger.LogInfo($"AAC initialization completed in {initStopwatch.ElapsedMilliseconds}ms");
|
||||
AACLogger.LogInfo($"AAC initialization completed in {initStopwatch.ElapsedMilliseconds}ms");
|
||||
|
||||
// Process layer groups with individual timing
|
||||
// Filter out the template LayerGroup (by SystemName)
|
||||
V5AACLogger.LogInfo($"Processing {layerGroups.Count} layer groups...");
|
||||
AACLogger.LogInfo($"Processing {layerGroups.Count} layer groups...");
|
||||
|
||||
var totalLayerGroupTime = 0L;
|
||||
var processedCount = 0;
|
||||
|
|
@ -236,25 +236,25 @@ namespace gay.lilyy.aaccore
|
|||
|
||||
if (!layerGroup.enabled)
|
||||
{
|
||||
V5AACLogger.LogWarning($"Skipping layer group: {layerGroup.DisplayName} (disabled)");
|
||||
AACLogger.LogWarning($"Skipping layer group: {layerGroup.DisplayName} (disabled)");
|
||||
skipped = true;
|
||||
}
|
||||
else if (layerGroup.experimental && !assets.experimentalEnabled)
|
||||
{
|
||||
V5AACLogger.LogWarning($"Skipping layer group: {layerGroup.DisplayName} (Experimental)");
|
||||
AACLogger.LogWarning($"Skipping layer group: {layerGroup.DisplayName} (Experimental)");
|
||||
skipped = true;
|
||||
}
|
||||
else if (!layerGroup.IsApplicable(assets))
|
||||
{
|
||||
if (layerGroup.shouldWarnIfNotApplicable)
|
||||
V5AACLogger.LogWarning($"Skipping layer group: {layerGroup.DisplayName} (Not applicable)");
|
||||
AACLogger.LogWarning($"Skipping layer group: {layerGroup.DisplayName} (Not applicable)");
|
||||
|
||||
skipped = true;
|
||||
}
|
||||
|
||||
if (!skipped)
|
||||
{
|
||||
V5AACLogger.LogInfo($"Running layer group: {layerGroup.DisplayName}");
|
||||
AACLogger.LogInfo($"Running layer group: {layerGroup.DisplayName}");
|
||||
layerGroup.Run(assets);
|
||||
processedCount++;
|
||||
}
|
||||
|
|
@ -265,26 +265,26 @@ namespace gay.lilyy.aaccore
|
|||
|
||||
layerStopwatch.Stop();
|
||||
totalLayerGroupTime += layerStopwatch.ElapsedMilliseconds;
|
||||
V5AACLogger.LogInfo($"Layer group '{layerGroup.DisplayName}' completed in {layerStopwatch.ElapsedMilliseconds}ms");
|
||||
AACLogger.LogInfo($"Layer group '{layerGroup.DisplayName}' completed in {layerStopwatch.ElapsedMilliseconds}ms");
|
||||
}
|
||||
|
||||
// Time Modular Avatar setup
|
||||
var maStopwatch = Stopwatch.StartNew();
|
||||
V5AACLogger.LogInfo("Creating Modular Avatar merge animator...");
|
||||
AACLogger.LogInfo("Creating Modular Avatar merge animator...");
|
||||
|
||||
assets.modularAvatar.NewMergeAnimator(assets.fx.AnimatorController, VRCAvatarDescriptor.AnimLayerType.FX);
|
||||
maStopwatch.Stop();
|
||||
V5AACLogger.LogInfo($"Modular Avatar setup completed in {maStopwatch.ElapsedMilliseconds}ms");
|
||||
AACLogger.LogInfo($"Modular Avatar setup completed in {maStopwatch.ElapsedMilliseconds}ms");
|
||||
|
||||
// Final timing summary
|
||||
overallStopwatch.Stop();
|
||||
V5AACLogger.LogSuccess($"Lillith V5 AAC generation completed successfully!");
|
||||
V5AACLogger.LogInfo($"=== TIMING SUMMARY ===");
|
||||
V5AACLogger.LogInfo($"Total time: {overallStopwatch.ElapsedMilliseconds}ms ({overallStopwatch.Elapsed.TotalSeconds:F2}s)");
|
||||
V5AACLogger.LogInfo($"AAC initialization: {initStopwatch.ElapsedMilliseconds}ms");
|
||||
V5AACLogger.LogInfo($"Layer groups: {totalLayerGroupTime}ms (processed: {processedCount}, skipped: {skippedCount})");
|
||||
V5AACLogger.LogInfo($"Modular Avatar: {maStopwatch.ElapsedMilliseconds}ms");
|
||||
V5AACLogger.LogInfo($"Average per layer group: {(processedCount > 0 ? totalLayerGroupTime / processedCount : 0)}ms");
|
||||
AACLogger.LogSuccess($"Lillith AAC generation completed successfully!");
|
||||
AACLogger.LogInfo($"=== TIMING SUMMARY ===");
|
||||
AACLogger.LogInfo($"Total time: {overallStopwatch.ElapsedMilliseconds}ms ({overallStopwatch.Elapsed.TotalSeconds:F2}s)");
|
||||
AACLogger.LogInfo($"AAC initialization: {initStopwatch.ElapsedMilliseconds}ms");
|
||||
AACLogger.LogInfo($"Layer groups: {totalLayerGroupTime}ms (processed: {processedCount}, skipped: {skippedCount})");
|
||||
AACLogger.LogInfo($"Modular Avatar: {maStopwatch.ElapsedMilliseconds}ms");
|
||||
AACLogger.LogInfo($"Average per layer group: {(processedCount > 0 ? totalLayerGroupTime / processedCount : 0)}ms");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ namespace gay.lilyy.aaccore {
|
|||
{
|
||||
public virtual bool enabled { get { return true; } }
|
||||
public virtual bool experimental { get { return false; } }
|
||||
private V5AACLayerGroupLogger _logger;
|
||||
private AACLayerGroupLogger _logger;
|
||||
|
||||
|
||||
protected V5AACLayerGroupLogger Logger => _logger ??= new V5AACLayerGroupLogger(SystemName);
|
||||
protected AACLayerGroupLogger Logger => _logger ??= new AACLayerGroupLogger(SystemName);
|
||||
|
||||
private static readonly List<LayerGroup> instances = new();
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ using gay.lilyy.logger;
|
|||
using UnityEngine;
|
||||
|
||||
namespace gay.lilyy.aaccore {
|
||||
public class V5AACLogger : BaseLogger
|
||||
public class AACLogger : BaseLogger
|
||||
{
|
||||
private static V5AACLogger _instance;
|
||||
public static V5AACLogger Instance => _instance ??= new V5AACLogger();
|
||||
private static AACLogger _instance;
|
||||
public static AACLogger Instance => _instance ??= new AACLogger();
|
||||
|
||||
protected override string SystemName => "AACCore";
|
||||
|
||||
|
|
@ -36,11 +36,11 @@ namespace gay.lilyy.aaccore {
|
|||
public static void LogDebug(string message, Object context = null) => Instance.Debug(message, context);
|
||||
}
|
||||
|
||||
public class V5AACLayerGroupLogger : BaseLogger
|
||||
public class AACLayerGroupLogger : BaseLogger
|
||||
{
|
||||
private readonly string _layerName;
|
||||
|
||||
public V5AACLayerGroupLogger(string layerName)
|
||||
public AACLayerGroupLogger(string layerName)
|
||||
{
|
||||
_layerName = layerName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ namespace gay.lilyy.aaccore {
|
|||
/// <summary>
|
||||
/// Adding this to the avatar root will build the FX layer.
|
||||
/// </summary>
|
||||
[AddComponentMenu("LillithRosePup/AAC Root")]
|
||||
public class AACRoot : MonoBehaviour, IEditorOnly {
|
||||
public bool experimentalPlayMode = true;
|
||||
public bool experimentalUpload = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue