3D 리플레이 실감 2단계: 게임 스킬 효과 추출(Abilities.cs: Cascade 파티클 · 메시 · 텍스처 → abilities.json) · 사이트 파티클 재생기(lib/vfx.ts: 시간만으로 계산 · 연막 돔 · 장판 칸 · 투사체 꼬리 · 설치물 메시) · maps3d json/png 제공 · update.sh/pack.py 연결
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1547
tools/map-extract/src/Abilities.cs
Normal file
1547
tools/map-extract/src/Abilities.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -11,11 +11,15 @@ public sealed class MatParams
|
||||
public readonly Dictionary<string, string> Textures = new(StringComparer.OrdinalIgnoreCase);
|
||||
public readonly Dictionary<string, FLinearColor> Vectors = new(StringComparer.OrdinalIgnoreCase);
|
||||
public readonly Dictionary<string, float> Scalars = new(StringComparer.OrdinalIgnoreCase);
|
||||
public readonly Dictionary<string, bool> Switches = new(StringComparer.OrdinalIgnoreCase);
|
||||
public string? BlendMode;
|
||||
public bool TwoSided;
|
||||
public string? ShadingModel;
|
||||
|
||||
public static MatParams Resolve(UMaterialInterface mat)
|
||||
{
|
||||
var r = new MatParams { Path = mat.GetPathName() };
|
||||
bool? twoSided = null;
|
||||
UMaterialInterface? cur = mat;
|
||||
for (var d = 0; d < 12 && cur != null; d++)
|
||||
{
|
||||
@@ -28,8 +32,17 @@ public sealed class MatParams
|
||||
if (v.ParameterValue is { } c && !r.Vectors.ContainsKey(v.Name)) r.Vectors[v.Name] = c;
|
||||
foreach (var s in mi.ScalarParameterValues)
|
||||
if (!r.Scalars.ContainsKey(s.Name)) r.Scalars[s.Name] = s.ParameterValue;
|
||||
if (r.BlendMode == null && mi.TryGetValue(out CUE4Parse.UE4.Assets.Objects.FStructFallback bpo, "BasePropertyOverrides") && bpo.TryGetValue(out bool ov, "bOverride_BlendMode") && ov)
|
||||
r.BlendMode = bpo.GetOrDefault<EBlendMode>("BlendMode").ToString();
|
||||
if (mi.TryGetValue(out CUE4Parse.UE4.Assets.Objects.FStructFallback bpo, "BasePropertyOverrides"))
|
||||
{
|
||||
if (r.BlendMode == null && bpo.TryGetValue(out bool ov, "bOverride_BlendMode") && ov)
|
||||
r.BlendMode = bpo.GetOrDefault<EBlendMode>("BlendMode").ToString();
|
||||
if (twoSided == null && bpo.TryGetValue(out bool ots, "bOverride_TwoSided") && ots)
|
||||
twoSided = bpo.GetOrDefault<bool>("TwoSided");
|
||||
}
|
||||
// 정적 스위치 (StaticParameters): 덮어쓴 것만, 자식 값이 먼저
|
||||
if (mi.StaticParameters?.StaticSwitchParameters is { } sws)
|
||||
foreach (var sp in sws)
|
||||
if (sp.bOverride && !r.Switches.ContainsKey(sp.Name)) r.Switches[sp.Name] = sp.Value;
|
||||
UMaterialInterface? parent = null;
|
||||
try { parent = mi.Parent?.Load<UMaterialInterface>(); } catch { }
|
||||
cur = parent;
|
||||
@@ -37,10 +50,16 @@ public sealed class MatParams
|
||||
else
|
||||
{
|
||||
r.Base = cur.GetPathName();
|
||||
if (r.BlendMode == null && cur is UMaterial m) r.BlendMode = m.BlendMode.ToString();
|
||||
if (cur is UMaterial m)
|
||||
{
|
||||
r.BlendMode ??= m.BlendMode.ToString();
|
||||
twoSided ??= m.TwoSided;
|
||||
r.ShadingModel = m.ShadingModel.ToString();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
r.TwoSided = twoSided ?? false;
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ using GvrMapExtract;
|
||||
// gvr-map-extract extract <출력 폴더> [맵...] 맵마다 <코드>.glb (UE 월드 좌표 cm, 위치 + 삼각형) + <코드>.json
|
||||
// gvr-map-extract agents <출력 폴더> [요원...] 요원 몸 agent_<코드>.glb · 무기 weapon_<이름>.glb + agents.json
|
||||
// gvr-map-extract anims <출력 폴더> 모든 요원 공용 애니메이션 anims.glb
|
||||
// gvr-map-extract abilities <출력 폴더> [요원 · 클래스...] 스킬 재료 abilities.json + m_*.glb + t_*.png
|
||||
//
|
||||
// 환경변수
|
||||
// GVR_USMAP 매핑 파일 (.usmap, 필수: 13.08 부터 패키지에 형 정보가 없다). uedb.dev 에서 받는다
|
||||
@@ -178,6 +179,9 @@ switch (args[0])
|
||||
Console.WriteLine($"끝: 공용 애니메이션 {r.Clips} · 실패 {r.Failed}{(r.Missing.Count > 0 ? " · 빠짐 " + string.Join(',', r.Missing) : "")} · 받은 양 {store.DownloadedBytes >> 20}MB · {sw.Elapsed.TotalMinutes:F1}분");
|
||||
return r.Failed == 0 ? 0 : 1;
|
||||
}
|
||||
case "abilities":
|
||||
// 요원 스킬 3D 재료: abilities.json + m_*.glb + t_*.png (Abilities.cs)
|
||||
return Abilities.Run(provider, args[1], args.Skip(2).ToList(), store);
|
||||
case "anim":
|
||||
foreach (var a in args.Skip(1)) ProbeAnim.Anim(provider, a);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user