fix(camera-ai): auto-prefer bundled runtime

This commit is contained in:
KINDNICK 2026-08-07 01:21:47 +09:00
parent 36ae6f11c4
commit 2f71eecfd0
3 changed files with 46 additions and 18 deletions

View File

@ -208,3 +208,6 @@
- Added a self-contained `RuntimeData~` reference bundle (263 prepared songs). - Added a self-contained `RuntimeData~` reference bundle (263 prepared songs).
- The packaged worker auto-discovers the bundle; raw CW-AI source audio and a separate checkout are no longer required for generation. - The packaged worker auto-discovers the bundle; raw CW-AI source audio and a separate checkout are no longer required for generation.
- Generation caches remain project-local and writable. - Generation caches remain project-local and writable.
## 0.4.4
- Automatically prefers bundled `RuntimeData~`, including Unity Git PackageCache installs, over stale serialized external roots.

View File

@ -4182,24 +4182,18 @@ namespace Streamingle.Editor
var normalizedProjectRoot = string.IsNullOrWhiteSpace(projectRoot) var normalizedProjectRoot = string.IsNullOrWhiteSpace(projectRoot)
? Environment.CurrentDirectory ? Environment.CurrentDirectory
: Path.GetFullPath(projectRoot); : Path.GetFullPath(projectRoot);
var candidates = new[] var candidates = new List<string>();
{ // Prefer the self-contained package, including Unity's resolved
configuredRoot, // Git PackageCache path. A stale serialized external CW-AI root
// Self-contained package install: RuntimeData~ is shipped // must not silently override the bundled reference library.
// beside the editor scripts, so artists do not need a candidates.AddRange(EnumeratePackagedRuntimeRoots(normalizedProjectRoot));
// separate CW-AI checkout. candidates.Add(configuredRoot);
Path.Combine( candidates.Add(normalizedProjectRoot);
normalizedProjectRoot, candidates.Add(Path.Combine(
"Packages",
"com.mingle.cw-ai",
"RuntimeData~"),
normalizedProjectRoot,
Path.Combine(
Directory.GetParent(normalizedProjectRoot)?.FullName ?? Directory.GetParent(normalizedProjectRoot)?.FullName ??
normalizedProjectRoot, normalizedProjectRoot,
"CW-AI"), "CW-AI"));
Environment.CurrentDirectory candidates.Add(Environment.CurrentDirectory);
};
foreach (var candidate in candidates) foreach (var candidate in candidates)
{ {
@ -4230,6 +4224,37 @@ namespace Streamingle.Editor
"CW-AI"); "CW-AI");
} }
private static IEnumerable<string> EnumeratePackagedRuntimeRoots(
string projectRoot)
{
yield return Path.Combine(
projectRoot,
"Packages",
"com.mingle.cw-ai",
"RuntimeData~");
var packageCache = Path.Combine(projectRoot, "Library", "PackageCache");
if (!Directory.Exists(packageCache))
{
yield break;
}
IEnumerable<string> matches;
try
{
matches = Directory.EnumerateDirectories(
packageCache,
"com.mingle.cw-ai@*",
SearchOption.TopDirectoryOnly);
}
catch (Exception)
{
yield break;
}
foreach (var match in matches.OrderByDescending(path => path))
{
yield return Path.Combine(match, "RuntimeData~");
}
}
private static string ResolveProjectCacheRoot() private static string ResolveProjectCacheRoot()
{ {
var projectRoot = Directory.GetParent(Application.dataPath)?.FullName var projectRoot = Directory.GetParent(Application.dataPath)?.FullName

View File

@ -1,6 +1,6 @@
{ {
"name": "com.mingle.cw-ai", "name": "com.mingle.cw-ai",
"version": "0.4.3", "version": "0.4.4",
"displayName": "Mingle Camera Work AI", "displayName": "Mingle Camera Work AI",
"description": "Self-contained high-quality Unity Timeline camera generation with an embedded prepared reference library, per-shot editable clips, and A/B review tools.", "description": "Self-contained high-quality Unity Timeline camera generation with an embedded prepared reference library, per-shot editable clips, and A/B review tools.",
"unity": "6000.0", "unity": "6000.0",