Bring in AAC!
project ive been working on for a while, just felt confident enough to move it here
This commit is contained in:
parent
e608e2a56b
commit
1d7052a258
209 changed files with 1561 additions and 74738 deletions
8
AAC/AACCore/Editor.meta
Normal file
8
AAC/AACCore/Editor.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4d93bb3c8aebb5a4980d314c9c09afb7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
300
AAC/AACCore/Editor/AACCore.cs
Normal file
300
AAC/AACCore/Editor/AACCore.cs
Normal file
|
|
@ -0,0 +1,300 @@
|
|||
using System.Linq;
|
||||
using System.Diagnostics;
|
||||
using AnimatorAsCode.V1;
|
||||
using gay.lilyy.aaccore;
|
||||
using nadena.dev.ndmf;
|
||||
using AnimatorAsCode.V1.ModularAvatar;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using VRC.SDK3.Avatars.Components;
|
||||
using VRC.SDK3.Dynamics.Constraint.Components;
|
||||
using System.Collections.Generic;
|
||||
using gay.lilyy.EditorNotes;
|
||||
|
||||
[assembly: ExportsPlugin(typeof(AACPlugin))]
|
||||
|
||||
namespace gay.lilyy.aaccore
|
||||
{
|
||||
|
||||
|
||||
|
||||
public class AACAssets
|
||||
{
|
||||
public AacFlBase aac;
|
||||
public AacFlController fx;
|
||||
public AacFlClip emptyClip;
|
||||
public BuildContext ctx;
|
||||
public AACRoot root;
|
||||
public MaAc modularAvatar;
|
||||
|
||||
public bool experimentalEnabled;
|
||||
public bool isPC;
|
||||
}
|
||||
|
||||
public static class AACUtils
|
||||
{
|
||||
public static GameObject FindChildRecursive(GameObject parent, string name)
|
||||
{
|
||||
return FindChildRecursive(parent.transform, name)?.gameObject;
|
||||
}
|
||||
public static Transform FindChildRecursive(Transform parent, string name)
|
||||
{
|
||||
Transform childTransform = parent.GetComponentsInChildren<Transform>()
|
||||
.FirstOrDefault(t => t.gameObject.name == name);
|
||||
return childTransform;
|
||||
}
|
||||
|
||||
public static AacFlClip CreateConstraintWeightClip(AACAssets assets, VRCParentConstraint constraint, int index, int indexCount) {
|
||||
return assets.aac.NewClip()
|
||||
.Animating(action => {
|
||||
action.Animates(constraint, $"Sources.source{index}.Weight").WithOneFrame(1f);
|
||||
for (int i = 0; i < indexCount; i++) {
|
||||
if (i == index) continue;
|
||||
action.Animates(constraint, $"Sources.source{i}.Weight").WithOneFrame(0f);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static AacFlClip CreateEmptyClipWithFrames(AACAssets assets, int frames) {
|
||||
if (frames == 0) return assets.emptyClip;
|
||||
var emptyGo = new GameObject();
|
||||
emptyGo.name = "_EmptyClipInstant";
|
||||
emptyGo.transform.SetParent(assets.ctx.AvatarRootTransform);
|
||||
var clip = assets.aac.NewClip().Animating(action => {
|
||||
action.Animates(emptyGo.transform, "m_LocalScale.z").WithFrameCountUnit(unit => {
|
||||
unit.Constant(0, 0);
|
||||
unit.Constant(frames, 1);
|
||||
});
|
||||
});
|
||||
Object.DestroyImmediate(emptyGo);
|
||||
return clip;
|
||||
}
|
||||
|
||||
public static AacFlClip CreateEmptyClipWithSeconds(AACAssets assets, float seconds) {
|
||||
if (seconds == 0) return assets.emptyClip;
|
||||
var emptyGo = new GameObject();
|
||||
emptyGo.name = "_EmptyClipInstant";
|
||||
emptyGo.transform.SetParent(assets.ctx.AvatarRootTransform);
|
||||
var clip = assets.aac.NewClip().Animating(action => {
|
||||
action.Animates(emptyGo.transform, "m_LocalScale.z").WithFrameCountUnit(unit => {
|
||||
unit.Constant(0, 0);
|
||||
unit.Constant(seconds, 1);
|
||||
});
|
||||
});
|
||||
Object.DestroyImmediate(emptyGo);
|
||||
return clip;
|
||||
}
|
||||
|
||||
public static List<SkinnedMeshRenderer> FindWithBlendshape(AACAssets assets, string shapeName) {
|
||||
var list = new List<SkinnedMeshRenderer>();
|
||||
foreach (var smr in assets.ctx.AvatarRootObject.GetComponentsInChildren<SkinnedMeshRenderer>(true)) {
|
||||
var mesh = smr.sharedMesh;
|
||||
if (!mesh) continue;
|
||||
|
||||
int count = mesh.blendShapeCount;
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (mesh.GetBlendShapeName(i) == shapeName) {
|
||||
list.Add(smr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<T> FindNamedComponents<T>(Transform parent, string name) where T : Component {
|
||||
var list = new List<T>();
|
||||
foreach (var component in parent.GetComponentsInChildren<T>(true)) {
|
||||
if (component.gameObject.name == name) {
|
||||
list.Add(component);
|
||||
}
|
||||
}
|
||||
UnityEngine.Debug.Log($"Found {list.Count} {name} components");
|
||||
foreach (var component in list) {
|
||||
UnityEngine.Debug.Log($"Component: {component.gameObject.name}");
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<T> FindNamedComponents<T>(AACAssets assets, string name) where T : Component {
|
||||
return FindNamedComponents<T>(assets.ctx.AvatarRootTransform, name);
|
||||
}
|
||||
|
||||
public static List<Transform> FindTransformWithNote(Transform parent, string tag) {
|
||||
var notes = parent.GetComponentsInChildren<EditorNote>(true);
|
||||
var matched = new List<Transform>();
|
||||
foreach (var note in notes) {
|
||||
if (note.valueType != EditorNote.ValueType.String) continue;
|
||||
if (note.stringValue != "aactag") continue;
|
||||
if (note.note == tag) {
|
||||
matched.Add(note.transform);
|
||||
}
|
||||
}
|
||||
return matched;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class AACPlugin : Plugin<AACPlugin>
|
||||
{
|
||||
public override string QualifiedName => "gay.lilyy.aaccore.plugin";
|
||||
public override string DisplayName => "AACCore";
|
||||
|
||||
private const string SystemName = "AACCore";
|
||||
private const bool UseWriteDefaults = true;
|
||||
protected override void Configure()
|
||||
{
|
||||
InPhase(BuildPhase.PlatformInit).BeforePlugin("nadena.dev.modular-avatar").Run($"Platform Init {DisplayName}", (ctx) => RunPhase(ctx, BuildPhase.PlatformInit));
|
||||
InPhase(BuildPhase.Resolving).BeforePlugin("nadena.dev.modular-avatar").Run($"Resolving {DisplayName}", (ctx) => RunPhase(ctx, BuildPhase.Resolving));
|
||||
InPhase(BuildPhase.Generating).BeforePlugin("nadena.dev.modular-avatar").Run($"Generating {DisplayName}", (ctx) => RunPhase(ctx, BuildPhase.Generating));
|
||||
InPhase(BuildPhase.Transforming).BeforePlugin("nadena.dev.modular-avatar").Run($"Transforming {DisplayName}", (ctx) => RunPhase(ctx, BuildPhase.Transforming));
|
||||
InPhase(BuildPhase.Optimizing).BeforePlugin("nadena.dev.modular-avatar").Run($"Optimizing {DisplayName}", (ctx) => RunPhase(ctx, BuildPhase.Optimizing));
|
||||
InPhase(BuildPhase.PlatformFinish).BeforePlugin("nadena.dev.modular-avatar").Run($"Platform Finish {DisplayName}", (ctx) => RunPhase(ctx, BuildPhase.PlatformFinish));
|
||||
}
|
||||
|
||||
private void RunPhase(BuildContext ctx, BuildPhase phase)
|
||||
{
|
||||
|
||||
var allLayerGroups = LayerGroup.Instances.ToList();
|
||||
var layerGroups = allLayerGroups
|
||||
.Where(lg => lg.SystemName != "template" && lg.buildPhase == phase)
|
||||
.ToList();
|
||||
|
||||
// Start overall timer
|
||||
var overallStopwatch = Stopwatch.StartNew();
|
||||
|
||||
V5AACLogger.LogInfo("Starting Lillith V5 AAC generation...");
|
||||
var root = ctx.AvatarRootObject.GetComponent<AACRoot>();
|
||||
if (root == null)
|
||||
{
|
||||
V5AACLogger.LogInfo("No LillithV5AACRoot 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.");
|
||||
return;
|
||||
}
|
||||
|
||||
AACAssets assets = new();
|
||||
assets.ctx = ctx;
|
||||
assets.root = root;
|
||||
assets.modularAvatar = MaAc.Create(new GameObject(SystemName)
|
||||
{
|
||||
transform = { parent = ctx.AvatarRootTransform }
|
||||
});
|
||||
|
||||
assets.isPC = EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows
|
||||
|| EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows64;
|
||||
|
||||
|
||||
// Time AAC initialization
|
||||
var initStopwatch = Stopwatch.StartNew();
|
||||
V5AACLogger.LogInfo("Initializing Animator As Code...");
|
||||
assets.aac = AacV1.Create(new AacConfiguration
|
||||
{
|
||||
SystemName = SystemName,
|
||||
AnimatorRoot = ctx.AvatarRootTransform,
|
||||
DefaultValueRoot = ctx.AvatarRootTransform,
|
||||
AssetKey = GUID.Generate().ToString(),
|
||||
AssetContainer = ctx.AssetContainer,
|
||||
ContainerMode = AacConfiguration.Container.OnlyWhenPersistenceRequired,
|
||||
AssetContainerProvider = new NDMFContainerProvider(ctx),
|
||||
DefaultsProvider = new AacDefaultsProvider(UseWriteDefaults)
|
||||
});
|
||||
assets.emptyClip = assets.aac.NewClip();
|
||||
|
||||
assets.fx = assets.aac.NewAnimatorController();
|
||||
initStopwatch.Stop();
|
||||
V5AACLogger.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...");
|
||||
|
||||
var totalLayerGroupTime = 0L;
|
||||
var processedCount = 0;
|
||||
var skippedCount = 0;
|
||||
|
||||
if (root.experimentalPlayMode && Application.isPlaying)
|
||||
{
|
||||
assets.experimentalEnabled = true;
|
||||
}
|
||||
if (root.experimentalUpload && !Application.isPlaying)
|
||||
{
|
||||
assets.experimentalEnabled = true;
|
||||
}
|
||||
|
||||
foreach (var layerGroup in layerGroups)
|
||||
{
|
||||
var layerStopwatch = Stopwatch.StartNew();
|
||||
|
||||
bool skipped = false;
|
||||
|
||||
if (!layerGroup.enabled)
|
||||
{
|
||||
V5AACLogger.LogWarning($"Skipping layer group: {layerGroup.DisplayName} (disabled)");
|
||||
skipped = true;
|
||||
}
|
||||
else if (layerGroup.experimental && !assets.experimentalEnabled)
|
||||
{
|
||||
V5AACLogger.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)");
|
||||
|
||||
skipped = true;
|
||||
}
|
||||
|
||||
if (!skipped)
|
||||
{
|
||||
V5AACLogger.LogInfo($"Running layer group: {layerGroup.DisplayName}");
|
||||
layerGroup.Run(assets);
|
||||
processedCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
skippedCount++;
|
||||
}
|
||||
|
||||
layerStopwatch.Stop();
|
||||
totalLayerGroupTime += layerStopwatch.ElapsedMilliseconds;
|
||||
V5AACLogger.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...");
|
||||
|
||||
assets.modularAvatar.NewMergeAnimator(assets.fx.AnimatorController, VRCAvatarDescriptor.AnimLayerType.FX);
|
||||
maStopwatch.Stop();
|
||||
V5AACLogger.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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
internal class NDMFContainerProvider : IAacAssetContainerProvider
|
||||
{
|
||||
private readonly BuildContext _ctx;
|
||||
public NDMFContainerProvider(BuildContext ctx) => _ctx = ctx;
|
||||
public void SaveAsPersistenceRequired(Object objectToAdd) => _ctx.AssetSaver.SaveAsset(objectToAdd);
|
||||
public void SaveAsRegular(Object objectToAdd) { } // Let NDMF crawl our assets when it finishes
|
||||
public void ClearPreviousAssets() { } // ClearPreviousAssets is never used in non-destructive contexts
|
||||
}
|
||||
}
|
||||
11
AAC/AACCore/Editor/AACCore.cs.meta
Normal file
11
AAC/AACCore/Editor/AACCore.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 130146287c9f763418ba1890a11f5633
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
27
AAC/AACCore/Editor/AACCoreEditor.asmdef
Normal file
27
AAC/AACCore/Editor/AACCoreEditor.asmdef
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "AACCoreEditor",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:165b54f9f25c92d48859a4f1a962cac0",
|
||||
"GUID:5718fb738711cd34ea54e9553040911d",
|
||||
"GUID:b906909fcc54f634db50f2cad0f988d9",
|
||||
"GUID:d689052aa981bf8459346a530f6e6678",
|
||||
"GUID:71d9dcc7d30ab1c45866d01afa59b6cf",
|
||||
"GUID:62ced99b048af7f4d8dfe4bed8373d76",
|
||||
"GUID:901e56b065a857d4483a77f8cae73588",
|
||||
"GUID:04a7e5cf006503242b1db329a84d694d",
|
||||
"GUID:95124d49b8c897e4286f0bf6c6e57f4d",
|
||||
"GUID:a65a5779a3702144986d83fca255f5da"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
7
AAC/AACCore/Editor/AACCoreEditor.asmdef.meta
Normal file
7
AAC/AACCore/Editor/AACCoreEditor.asmdef.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8d0a4403a05276c4087dd785a3c7818d
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
31
AAC/AACCore/Editor/LayerGroup.cs
Normal file
31
AAC/AACCore/Editor/LayerGroup.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System.Collections.Generic;
|
||||
using nadena.dev.ndmf;
|
||||
|
||||
namespace gay.lilyy.aaccore {
|
||||
public abstract class LayerGroup
|
||||
{
|
||||
public virtual bool enabled { get { return true; } }
|
||||
public virtual bool experimental { get { return false; } }
|
||||
private V5AACLayerGroupLogger _logger;
|
||||
|
||||
|
||||
protected V5AACLayerGroupLogger Logger => _logger ??= new V5AACLayerGroupLogger(SystemName);
|
||||
|
||||
private static readonly List<LayerGroup> instances = new();
|
||||
|
||||
protected LayerGroup() => instances.Add(this);
|
||||
|
||||
public static IEnumerable<LayerGroup> Instances => instances;
|
||||
|
||||
public virtual bool shouldWarnIfNotApplicable => true;
|
||||
public virtual BuildPhase buildPhase => BuildPhase.Generating;
|
||||
|
||||
public virtual bool IsApplicable(AACAssets assets) {
|
||||
return true;
|
||||
}
|
||||
public abstract string DisplayName { get; }
|
||||
public abstract string SystemName { get; }
|
||||
|
||||
public abstract void Run(AACAssets assets);
|
||||
}
|
||||
}
|
||||
11
AAC/AACCore/Editor/LayerGroup.cs.meta
Normal file
11
AAC/AACCore/Editor/LayerGroup.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b62c5c48d33ff344184e9d2af6229e52
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
68
AAC/AACCore/Editor/Logger.cs
Normal file
68
AAC/AACCore/Editor/Logger.cs
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
using System.Collections.Generic;
|
||||
using gay.lilyy.logger;
|
||||
using UnityEngine;
|
||||
|
||||
namespace gay.lilyy.aaccore {
|
||||
public class V5AACLogger : BaseLogger
|
||||
{
|
||||
private static V5AACLogger _instance;
|
||||
public static V5AACLogger Instance => _instance ??= new V5AACLogger();
|
||||
|
||||
protected override string SystemName => "AACCore";
|
||||
|
||||
protected override Dictionary<LogLevel, string> LogColors => new()
|
||||
{
|
||||
{ LogLevel.Info, "#87CEEB" }, // Sky Blue
|
||||
{ LogLevel.Warning, "#FFA500" }, // Orange
|
||||
{ LogLevel.Error, "#FF6B6B" }, // Red
|
||||
{ LogLevel.Success, "#90EE90" }, // Light Green
|
||||
{ LogLevel.Debug, "#DDA0DD" } // Plum
|
||||
};
|
||||
|
||||
protected override Dictionary<LogLevel, string> LogPrefixes => new()
|
||||
{
|
||||
{ LogLevel.Info, "ℹ️" },
|
||||
{ LogLevel.Warning, "⚠️" },
|
||||
{ LogLevel.Error, "❌" },
|
||||
{ LogLevel.Success, "✅" },
|
||||
{ LogLevel.Debug, "🐛" }
|
||||
};
|
||||
|
||||
// Static convenience methods for easy access
|
||||
public static void LogInfo(string message, Object context = null) => Instance.Info(message, context);
|
||||
public static void LogWarning(string message, Object context = null) => Instance.Warning(message, context);
|
||||
public static void LogError(string message, Object context = null) => Instance.Error(message, context);
|
||||
public static void LogSuccess(string message, Object context = null) => Instance.Success(message, context);
|
||||
public static void LogDebug(string message, Object context = null) => Instance.Debug(message, context);
|
||||
}
|
||||
|
||||
public class V5AACLayerGroupLogger : BaseLogger
|
||||
{
|
||||
private readonly string _layerName;
|
||||
|
||||
public V5AACLayerGroupLogger(string layerName)
|
||||
{
|
||||
_layerName = layerName;
|
||||
}
|
||||
|
||||
protected override string SystemName => $"AACCore [{_layerName}] ";
|
||||
|
||||
protected override Dictionary<LogLevel, string> LogColors => new()
|
||||
{
|
||||
{ LogLevel.Info, "#87CEEB" },
|
||||
{ LogLevel.Warning, "#FFA500" },
|
||||
{ LogLevel.Error, "#FF6B6B" },
|
||||
{ LogLevel.Success, "#90EE90" },
|
||||
{ LogLevel.Debug, "#DDA0DD" }
|
||||
};
|
||||
|
||||
protected override Dictionary<LogLevel, string> LogPrefixes => new();
|
||||
|
||||
// Convenience methods for easy access
|
||||
public void LogInfo(string message, Object context = null) => Info(message, context);
|
||||
public void LogWarning(string message, Object context = null) => Warning(message, context);
|
||||
public void LogError(string message, Object context = null) => Error(message, context);
|
||||
public void LogSuccess(string message, Object context = null) => Success(message, context);
|
||||
public void LogDebug(string message, Object context = null) => Debug(message, context);
|
||||
}
|
||||
}
|
||||
11
AAC/AACCore/Editor/Logger.cs.meta
Normal file
11
AAC/AACCore/Editor/Logger.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b4fd8b997bc1c544e83e5ed5014361c4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
AAC/AACCore/Runtime.meta
Normal file
8
AAC/AACCore/Runtime.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7613e1079336b844dbd75b28c6cf9050
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
16
AAC/AACCore/Runtime/AACCoreRuntime.asmdef
Normal file
16
AAC/AACCore/Runtime/AACCoreRuntime.asmdef
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "AACCoreRuntime",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:5718fb738711cd34ea54e9553040911d"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
7
AAC/AACCore/Runtime/AACCoreRuntime.asmdef.meta
Normal file
7
AAC/AACCore/Runtime/AACCoreRuntime.asmdef.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 165b54f9f25c92d48859a4f1a962cac0
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
50
AAC/AACCore/Runtime/AACRoot.cs
Normal file
50
AAC/AACCore/Runtime/AACRoot.cs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using VRC.SDKBase;
|
||||
|
||||
namespace gay.lilyy.aaccore {
|
||||
/// <summary>
|
||||
/// Adding this to the avatar root will build the FX layer.
|
||||
/// </summary>
|
||||
public class AACRoot : MonoBehaviour, IEditorOnly {
|
||||
public bool experimentalPlayMode = true;
|
||||
public bool experimentalUpload = false;
|
||||
|
||||
// unity needs this to show the enable/disable box
|
||||
void Start(){}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(AACRoot))]
|
||||
private class Editor : UnityEditor.Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
// Draw the default message
|
||||
EditorGUILayout.HelpBox(
|
||||
"Adding this to the avatar root will build the FX layer.",
|
||||
MessageType.Info
|
||||
);
|
||||
|
||||
// Draw the 'Enable Experimental Layers' toggle
|
||||
var component = (AACRoot)target;
|
||||
EditorGUI.BeginChangeCheck();
|
||||
bool newValPlay = EditorGUILayout.Toggle("Enable Experimental Layers in Play Mode", component.experimentalPlayMode);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
Undo.RecordObject(component, "Toggle Experimental Layers in Play Mode");
|
||||
component.experimentalPlayMode = newValPlay;
|
||||
EditorUtility.SetDirty(component);
|
||||
}
|
||||
EditorGUI.BeginChangeCheck();
|
||||
bool newValUpload = EditorGUILayout.Toggle("Enable Experimental Layers in Uploads", component.experimentalUpload);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
Undo.RecordObject(component, "Toggle Experimental Layers in Uploads");
|
||||
component.experimentalPlayMode = newValUpload;
|
||||
EditorUtility.SetDirty(component);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
11
AAC/AACCore/Runtime/AACRoot.cs.meta
Normal file
11
AAC/AACCore/Runtime/AACRoot.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3a0c8f4a9a1d73e4ab34270b10988813
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
AAC/AACCore/Template.meta
Normal file
8
AAC/AACCore/Template.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 02ed31c0bed0fd045b53f2a08b792152
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
23
AAC/AACCore/Template/Template.cs
Normal file
23
AAC/AACCore/Template/Template.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
using gay.lilyy.aaccore;
|
||||
using UnityEditor;
|
||||
|
||||
namespace gay.lilyy.avatarname.version.aac {
|
||||
[InitializeOnLoad]
|
||||
public class Template : LayerGroup
|
||||
{
|
||||
// remove when ready for uploaded
|
||||
public override bool experimental => true;
|
||||
private static readonly Template _instance = new();
|
||||
|
||||
static Template() {}
|
||||
|
||||
public override string DisplayName => "Template";
|
||||
|
||||
public override string SystemName => "template";
|
||||
|
||||
public override void Run(AACAssets assets)
|
||||
{
|
||||
Logger.LogInfo("LayerGroup Template.Run() Called!");
|
||||
}
|
||||
}
|
||||
}
|
||||
11
AAC/AACCore/Template/Template.cs.meta
Normal file
11
AAC/AACCore/Template/Template.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a63a02520572be74b9866f7c32915518
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
25
AAC/AACCore/Template/TemplateAAC.asmdef
Normal file
25
AAC/AACCore/Template/TemplateAAC.asmdef
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "TemplateAAC",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:8d0a4403a05276c4087dd785a3c7818d",
|
||||
"GUID:95124d49b8c897e4286f0bf6c6e57f4d",
|
||||
"GUID:5718fb738711cd34ea54e9553040911d",
|
||||
"GUID:b906909fcc54f634db50f2cad0f988d9",
|
||||
"GUID:d689052aa981bf8459346a530f6e6678",
|
||||
"GUID:71d9dcc7d30ab1c45866d01afa59b6cf",
|
||||
"GUID:04a7e5cf006503242b1db329a84d694d",
|
||||
"GUID:62ced99b048af7f4d8dfe4bed8373d76"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
7
AAC/AACCore/Template/TemplateAAC.asmdef.meta
Normal file
7
AAC/AACCore/Template/TemplateAAC.asmdef.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b13df479673c65d4785814fc8079202f
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Add table
Add a link
Reference in a new issue