Publish current live selection and graphics source with external keys
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Linq;
|
||||
@@ -331,7 +331,7 @@ namespace Gallop.Live.Cutt
|
||||
public event HdrBloomUpdateInfoDelegate OnUpdateHdrBloom;
|
||||
|
||||
public event Action<PostEffectUpdateInfo_BloomDiffusion> OnUpdatePostEffect_BloomDiffusion;
|
||||
public event Action<LiveTimelineKeyPostEffectDOFData> OnUpdatePostEffect_Dof;
|
||||
public event Action<LiveTimelineKeyPostEffectDOFData, Vector3?> OnUpdatePostEffect_Dof;
|
||||
public bool HasDofCameraLookAt { get; private set; }
|
||||
public Vector3 DofCameraLookAt { get; private set; }
|
||||
public Camera DofTrackCamera { get; private set; }
|
||||
@@ -395,6 +395,7 @@ namespace Gallop.Live.Cutt
|
||||
public event Action RecordUma;
|
||||
|
||||
public Dictionary<string, GameObject> StageObjectMap = new Dictionary<string, GameObject>();
|
||||
public Dictionary<string, StageObjectUnit> StageObjectUnitMap = new Dictionary<string, StageObjectUnit>();
|
||||
|
||||
public float currentLiveTime
|
||||
{
|
||||
@@ -553,16 +554,18 @@ namespace Gallop.Live.Cutt
|
||||
|
||||
public void InitCharaMotionSequence(int[] motionSequence)
|
||||
{
|
||||
//Create Animation
|
||||
foreach (var obj in Director.instance.charaObjs)
|
||||
var director = Director.instance;
|
||||
// Native InitCharaMotionSequence retains an entry for each physical slot.
|
||||
foreach (var obj in director.charaObjs)
|
||||
{
|
||||
var container = obj.GetComponentInChildren<UmaContainer>();
|
||||
if (container)
|
||||
var container = obj != null ? obj.GetComponentInChildren<UmaContainer>() : null;
|
||||
Animation animation = null;
|
||||
if (container != null)
|
||||
{
|
||||
EnsureMicMotionTransforms(container.transform);
|
||||
var animation = container.gameObject.AddComponent<Animation>();
|
||||
Director.instance.charaAnims.Add(animation);
|
||||
animation = container.gameObject.AddComponent<Animation>();
|
||||
}
|
||||
director.charaAnims.Add(animation);
|
||||
}
|
||||
|
||||
//Get KeyArray
|
||||
@@ -578,14 +581,14 @@ namespace Gallop.Live.Cutt
|
||||
if (Director.instance.liveMode == 1)
|
||||
{
|
||||
//Set Motion
|
||||
int CharaPositionMax = Director.instance.allowCount;
|
||||
int CharaPositionMax = Mathf.Max(0, Mathf.Min(director.allowCount,
|
||||
Mathf.Min(director.charaObjs.Count, motionSequence != null ? motionSequence.Length : 0)));
|
||||
|
||||
_motionSequenceArray = new LiveTimelineMotionSequence[CharaPositionMax];
|
||||
|
||||
|
||||
for (int i = 0; i < CharaPositionMax; i++)
|
||||
{
|
||||
Debug.Log(i);
|
||||
_motionSequenceArray[i] = new LiveTimelineMotionSequence();
|
||||
_motionSequenceArray[i].Initialize(Director.instance.charaObjs[i], i, motionSequence[i], this);
|
||||
}
|
||||
@@ -597,7 +600,10 @@ namespace Gallop.Live.Cutt
|
||||
foreach (var motion in UmaViewerMain.Instance.AbMotions.Where(a => a.Name.StartsWith($"3d/motion/live/body/son{Director.instance.live.MusicId}") && Path.GetFileName(a.Name).Split('_').Length == 4))
|
||||
{
|
||||
AssetBundle motionAB = UmaAssetManager.LoadAssetBundle(motion);
|
||||
AnimationClip motionAnim = motionAB.LoadAsset<AnimationClip>(Path.GetFileName(motion.Name).Split('.')[0]);
|
||||
AnimationClip motionAnim = motionAB != null
|
||||
? motionAB.LoadAsset<AnimationClip>(Path.GetFileName(motion.Name).Split('.')[0]) : null;
|
||||
if (motionAnim == null)
|
||||
Debug.LogError("[LiveTimelineControl] Basic motion clip load failed: " + motion.Name);
|
||||
if (Gallop.Live.LiveRuntimeDiagnostics.Enabled)
|
||||
Gallop.Live.LiveRuntimeDiagnostics.RecordAssetLoad(motion.Name, "LoadAsset", typeof(AnimationClip),
|
||||
new UnityEngine.Object[] { motionAnim }, motionAnim, Path.GetFileName(motion.Name).Split('.')[0]);
|
||||
@@ -605,7 +611,8 @@ namespace Gallop.Live.Cutt
|
||||
}
|
||||
|
||||
//Set Motion
|
||||
int CharaPositionMax = Director.instance.allowCount;
|
||||
int CharaPositionMax = Mathf.Max(0, Mathf.Min(director.allowCount,
|
||||
Mathf.Min(director.charaObjs.Count, Mathf.Min(director.charaAnims.Count, Anims.Count))));
|
||||
|
||||
_motionSequenceArray = new LiveTimelineMotionSequence[CharaPositionMax];
|
||||
|
||||
@@ -613,7 +620,7 @@ namespace Gallop.Live.Cutt
|
||||
for (int i = 0; i < CharaPositionMax; i++)
|
||||
{
|
||||
_motionSequenceArray[i] = new LiveTimelineMotionSequence();
|
||||
_motionSequenceArray[i].Initialize(Director.instance.charaObjs[i], i, motionSequence[i], this, Anims);
|
||||
_motionSequenceArray[i].Initialize(director.charaObjs[i], i, i, this, Anims);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1585,26 +1592,15 @@ namespace Gallop.Live.Cutt
|
||||
LiveTimelineKeyCameraPositionData liveTimelineKeyCameraPositionData = curKey as LiveTimelineKeyCameraPositionData;
|
||||
camera.camera.nearClipPlane = liveTimelineKeyCameraPositionData.nearClip;
|
||||
camera.camera.farClipPlane = liveTimelineKeyCameraPositionData.farClip;
|
||||
// Native AlterUpdate_CameraPos (0x1acd38c..0x1acd3f4) preserves unflagged state.
|
||||
if (((int)liveTimelineKeyCameraPositionData.attribute & 0x20000) != 0)
|
||||
camera.camera.cullingMask = liveTimelineKeyCameraPositionData.GetCullingMask();
|
||||
if (((int)liveTimelineKeyCameraPositionData.attribute & 0x40000) != 0)
|
||||
camera.camera.backgroundColor = liveTimelineKeyCameraPositionData.BgColor;
|
||||
if (CalculateCameraPos(out var pos, sheet, curKey, nextKey, currentFrame))
|
||||
{
|
||||
camera.cacheTransform.position = pos;
|
||||
|
||||
// TODO 锟斤拷锟斤拷锟矫的伙拷锟斤拷CGSS锟斤拷layer枚锟劫o拷要锟斤拷锟斤拷锟芥换
|
||||
/*
|
||||
int num = liveTimelineKeyCameraPositionData.GetCullingMask();
|
||||
if (num == 0)
|
||||
{
|
||||
num = LiveTimelineKeyCameraPositionData.GetDefaultCullingMask();
|
||||
}
|
||||
camera.camera.cullingMask = num;
|
||||
if (OnUpdateCameraPos != null)
|
||||
{
|
||||
CameraPosUpdateInfo updateInfo = default(CameraPosUpdateInfo);
|
||||
updateInfo.outlineZOffset = liveTimelineKeyCameraPositionData.outlineZOffset;
|
||||
updateInfo.characterLODMask = (int)liveTimelineKeyCameraPositionData.characterLODMask;
|
||||
OnUpdateCameraPos(ref updateInfo);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2440,7 +2436,7 @@ namespace Gallop.Live.Cutt
|
||||
private void AlterUpdate_MobControl(LiveTimelineWorkSheet sheet, float currentFrame)
|
||||
{
|
||||
AlterUpdate_MobCyalumeControl(
|
||||
sheet != null ? sheet.mobControlList : null,
|
||||
sheet != null ? sheet.MobControlKeys : null,
|
||||
currentFrame,
|
||||
OnUpdateMobControl);
|
||||
}
|
||||
@@ -2448,7 +2444,7 @@ namespace Gallop.Live.Cutt
|
||||
private void AlterUpdate_CyalumeControl(LiveTimelineWorkSheet sheet, float currentFrame)
|
||||
{
|
||||
AlterUpdate_MobCyalumeControl(
|
||||
sheet != null ? sheet.cyalumeControlList : null,
|
||||
sheet != null ? sheet.CyalumeControlKeys : null,
|
||||
currentFrame,
|
||||
OnUpdateCyalumeControl);
|
||||
}
|
||||
@@ -2465,10 +2461,10 @@ namespace Gallop.Live.Cutt
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var controlData = dataList[i];
|
||||
if (controlData == null || controlData.keys == null)
|
||||
if (controlData == null || controlData.Keys == null || (uint)controlData.GroupIndex >= 11u)
|
||||
continue;
|
||||
|
||||
var keys = controlData.keys;
|
||||
var keys = controlData.Keys;
|
||||
if (keys.Count <= 0)
|
||||
continue;
|
||||
if (keys.HasAttribute(LiveTimelineKeyDataListAttr.Disable))
|
||||
@@ -2485,22 +2481,22 @@ namespace Gallop.Live.Cutt
|
||||
|
||||
MobCyalumeUpdateInfo info = default;
|
||||
info.data = controlData;
|
||||
info.unk0 = (uint)keys.unk48 < 11u ? keys.unk48 : i;
|
||||
info.unk0 = controlData.GroupIndex;
|
||||
info.currentFrame = currentFrame;
|
||||
info.currentLiveTime = currentLiveTime;
|
||||
|
||||
if (next != null && next.interpolateType != 0)
|
||||
{
|
||||
float t = CalculateInterpolationValue(current, next, currentFrame);
|
||||
info.position = Vector3.Lerp(current.position, next.position, t);
|
||||
info.position = Vector3.Lerp(current.Position, next.Position, t);
|
||||
info.rotation = Quaternion.Lerp(current.GetRotation(), next.GetRotation(), t);
|
||||
info.scale = Vector3.Lerp(current.scale, next.scale, t);
|
||||
info.scale = Vector3.Lerp(current.Scale, next.Scale, t);
|
||||
}
|
||||
else
|
||||
{
|
||||
info.position = current.position;
|
||||
info.position = current.Position;
|
||||
info.rotation = current.GetRotation();
|
||||
info.scale = current.scale;
|
||||
info.scale = current.Scale;
|
||||
}
|
||||
|
||||
callback.Invoke(ref info);
|
||||
@@ -2975,7 +2971,8 @@ namespace Gallop.Live.Cutt
|
||||
continue;
|
||||
}
|
||||
|
||||
if (StageObjectMap == null || !StageObjectMap.ContainsKey(objectEntry.name))
|
||||
if ((StageObjectMap == null || !StageObjectMap.ContainsKey(objectEntry.name)) &&
|
||||
(StageObjectUnitMap == null || !StageObjectUnitMap.ContainsKey(objectEntry.name)))
|
||||
continue;
|
||||
|
||||
FindTimelineKey(out var curKey, out var nextKey, keys, currentFrame);
|
||||
@@ -3207,6 +3204,27 @@ namespace Gallop.Live.Cutt
|
||||
}
|
||||
}
|
||||
|
||||
private Vector3? ResolveDofWorldFocus(LiveTimelineKeyPostEffectDOFData key)
|
||||
{
|
||||
if (((int)key.attribute & (1 << 16)) != 0)
|
||||
return HasDofCameraLookAt ? DofCameraLookAt : (Vector3?)null;
|
||||
bool valid = key.charactor == 0;
|
||||
for (int i = 0; !valid && i < liveCharactorLocators.Length && i < liveCharaPositionMax; ++i)
|
||||
valid = (key.charactor & (1 << i)) != 0 && liveCharactorLocators[i] != null;
|
||||
return valid ? GetPositionWithCharacters(key.FocusCharacters, LiveCameraCharaParts.Face,
|
||||
Vector3.zero, Vector3.zero) : (Vector3?)null;
|
||||
}
|
||||
|
||||
private Vector3? SetupDofWorldFocus(LiveTimelineKeyPostEffectDOFData current,
|
||||
LiveTimelineKeyPostEffectDOFData next, float progress)
|
||||
{
|
||||
var start = ResolveDofWorldFocus(current);
|
||||
if (ReferenceEquals(current, next)) return start;
|
||||
var end = ResolveDofWorldFocus(next);
|
||||
return start.HasValue && end.HasValue
|
||||
? Vector3.LerpUnclamped(start.Value, end.Value, progress) : (Vector3?)null;
|
||||
}
|
||||
|
||||
private void AlterUpdate_PostEffect_Dof(LiveTimelineWorkSheet sheet, int frame)
|
||||
{
|
||||
DofTrackCamera = GetCamera(sheet.targetCameraIndex)?.camera;
|
||||
@@ -3214,32 +3232,32 @@ namespace Gallop.Live.Cutt
|
||||
if (keys == null || keys.HasAttribute(LiveTimelineKeyDataListAttr.Disable) ||
|
||||
!keys.EnablePlayModeTimeline(_playMode))
|
||||
{
|
||||
OnUpdatePostEffect_Dof?.Invoke(null);
|
||||
OnUpdatePostEffect_Dof?.Invoke(null, null);
|
||||
return;
|
||||
}
|
||||
FindTimelineKey(out var currentBase, out var nextBase, keys, frame);
|
||||
var current = currentBase as LiveTimelineKeyPostEffectDOFData;
|
||||
var next = nextBase as LiveTimelineKeyPostEffectDOFData;
|
||||
if (current == null) { OnUpdatePostEffect_Dof?.Invoke(null); return; }
|
||||
if (current == null) { OnUpdatePostEffect_Dof?.Invoke(null, null); return; }
|
||||
float t = next != null && next.IsInterpolateKey()
|
||||
? CalculateInterpolationValue(current, next, frame) : 0f;
|
||||
if (next == null) next = current;
|
||||
if (next == null || !next.IsInterpolateKey()) next = current;
|
||||
var sample = _dofSample;
|
||||
sample.frame = current.frame;
|
||||
sample.attribute = current.attribute;
|
||||
sample.charactor = current.charactor;
|
||||
sample.dofBlurType = current.dofBlurType;
|
||||
sample.dofQuality = current.dofQuality;
|
||||
sample.forcalSize = Mathf.Lerp(current.forcalSize, next.forcalSize, t);
|
||||
sample.blurSpread = Mathf.Lerp(current.blurSpread, next.blurSpread, t);
|
||||
sample.dofForegroundSize = Mathf.Lerp(current.dofForegroundSize, next.dofForegroundSize, t);
|
||||
sample.dofFocalPoint = Mathf.Lerp(current.dofFocalPoint, next.dofFocalPoint, t);
|
||||
sample.dofSmoothness = Mathf.Lerp(current.dofSmoothness, next.dofSmoothness, t);
|
||||
sample.BallBlurPowerFactor = Mathf.Lerp(current.BallBlurPowerFactor, next.BallBlurPowerFactor, t);
|
||||
sample.BallBlurBrightnessThreshhold = Mathf.Lerp(current.BallBlurBrightnessThreshhold, next.BallBlurBrightnessThreshhold, t);
|
||||
sample.BallBlurBrightnessIntensity = Mathf.Lerp(current.BallBlurBrightnessIntensity, next.BallBlurBrightnessIntensity, t);
|
||||
sample.BallBlurSpread = Mathf.Lerp(current.BallBlurSpread, next.BallBlurSpread, t);
|
||||
OnUpdatePostEffect_Dof?.Invoke(sample);
|
||||
sample.forcalSize = LerpWithoutClamp(current.forcalSize, next.forcalSize, t);
|
||||
sample.blurSpread = LerpWithoutClamp(current.blurSpread, next.blurSpread, t);
|
||||
sample.dofForegroundSize = LerpWithoutClamp(current.dofForegroundSize, next.dofForegroundSize, t);
|
||||
sample.dofFocalPoint = LerpWithoutClamp(current.dofFocalPoint, next.dofFocalPoint, t);
|
||||
sample.dofSmoothness = LerpWithoutClamp(current.dofSmoothness, next.dofSmoothness, t);
|
||||
sample.BallBlurPowerFactor = LerpWithoutClamp(current.BallBlurPowerFactor, next.BallBlurPowerFactor, t);
|
||||
sample.BallBlurBrightnessThreshhold = LerpWithoutClamp(current.BallBlurBrightnessThreshhold, next.BallBlurBrightnessThreshhold, t);
|
||||
sample.BallBlurBrightnessIntensity = LerpWithoutClamp(current.BallBlurBrightnessIntensity, next.BallBlurBrightnessIntensity, t);
|
||||
sample.BallBlurSpread = LerpWithoutClamp(current.BallBlurSpread, next.BallBlurSpread, t);
|
||||
OnUpdatePostEffect_Dof?.Invoke(sample, SetupDofWorldFocus(current, next, t));
|
||||
}
|
||||
|
||||
private void AlterUpdate_PostEffect_BloomDiffusion( LiveTimelineWorkSheet sheet, int currentFrame)
|
||||
|
||||
@@ -225,6 +225,9 @@ namespace Gallop.Live.Cutt
|
||||
public float maxForcalSize;
|
||||
public bool isUseMirrorScanMotionDictionary;
|
||||
public bool isUseGameSettingToParticle;
|
||||
public bool IsChangedCharaLayerOnlyMirrorRendering;
|
||||
public bool IsRenderMirrorObjectOnlyOnBaseCamera;
|
||||
public bool UseDepthOnlyCube;
|
||||
public LiveTimelineStageObjectsSettings stageObjectsSettings;
|
||||
public LiveTimelineDebugSettings debugSettings;
|
||||
}
|
||||
|
||||
+6
-6
@@ -10,9 +10,9 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
get{return LiveTimelineKeyDataType.CyalumeControl;}
|
||||
}
|
||||
public Vector3 position;
|
||||
public Vector3 angle;
|
||||
public Vector3 scale = Vector3.one;
|
||||
public Vector3 Position;
|
||||
public Vector3 Angle;
|
||||
public Vector3 Scale = Vector3.one;
|
||||
|
||||
[NonSerialized]
|
||||
private Quaternion _rotationCache = Quaternion.identity;
|
||||
@@ -24,7 +24,7 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
if (!_hasRotationCache)
|
||||
{
|
||||
_rotationCache = Quaternion.Euler(angle);
|
||||
_rotationCache = Quaternion.Euler(Angle);
|
||||
_hasRotationCache = true;
|
||||
}
|
||||
|
||||
@@ -35,13 +35,13 @@ namespace Gallop.Live.Cutt
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyMobCyalumeControlDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyMobCyalumeControlData>
|
||||
{
|
||||
public int unk48;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineMobCyalumeControlData : ILiveTimelineGroupDataWithName
|
||||
{
|
||||
public LiveTimelineKeyMobCyalumeControlDataList keys;
|
||||
public int GroupIndex;
|
||||
public LiveTimelineKeyMobCyalumeControlDataList Keys;
|
||||
}
|
||||
|
||||
public delegate void MobCyalumeUpdateInfoDelegate(ref MobCyalumeUpdateInfo updateInfo);
|
||||
|
||||
+5
-11
@@ -34,17 +34,11 @@ namespace Gallop.Live.Cutt
|
||||
/// </summary>
|
||||
public LiveCharaPositionFlag FocusCharacters => (LiveCharaPositionFlag)charactor;
|
||||
|
||||
// High `attribute` bits are per-track flags (same convention as
|
||||
// LiveTimelineMonitorData). Across the 4427 authored keys only bits 16..19
|
||||
// appear, in the combinations 0x50000 (3117), 0x70000 (923), 0x60000 (108),
|
||||
// 0x10000 (106), 0x40000 (77), 0x30000 (72), 0x20000 (22), 0x00000 (1) and
|
||||
// 0xF0000 (1). Bit 17 covaries with an authored dofFocalPoint: 95.1% of the
|
||||
// 3301 bit17-clear keys leave it at the 1.0 default, while 88.1% of the 1126
|
||||
// bit17-set keys carry a real distance. Bit 16 covaries the other way with
|
||||
// `charactor`: only 1.4% of the 4219 bit16-set keys move it off Center,
|
||||
// against 56.7% of the 208 bit16-clear keys. The flag names are still
|
||||
// unknown. Timeline mode tests the inferred bit17=metric / bit16=camera
|
||||
// target mapping; see docs/LIVE_DOF_TIMELINE_2026-09-06.md for pixel evidence.
|
||||
// Actual game metadata and SetupDOFUpdateInfo RVA 0x726a610 confirm:
|
||||
// bit16 ATTR_USE_LOOKAT; bit17 ATTR_USE_FOCAL_POINT;
|
||||
// bit18 ATTR_ENABLE_DOF; bit19 ATTR_IS_POINT_BALL_BLUR.
|
||||
// Current-key flags select the mode; both endpoints resolve world focus
|
||||
// independently before the next key's unclamped interpolation is applied.
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using RootMotion.FinalIK;
|
||||
|
||||
@@ -43,56 +44,96 @@ namespace Gallop.Live.Cutt
|
||||
|
||||
public void Initialize(Transform target, int targetIndex, int seqDataIndex, LiveTimelineControl timelineControl, List<AnimationClip> animclips = null)
|
||||
{
|
||||
if(animclips != null)
|
||||
{
|
||||
if (targetIndex < Director.instance.charaAnims.Count)
|
||||
{
|
||||
_targetAnim = animclips[targetIndex];
|
||||
|
||||
_tempAnim = Director.instance.charaAnims[targetIndex];
|
||||
_tempAnim.AddClip(_targetAnim, _targetAnim.name);
|
||||
}
|
||||
var animations = Director.instance.charaAnims;
|
||||
if (targetIndex < 0 || targetIndex >= animations.Count || animations[targetIndex] == null)
|
||||
return;
|
||||
}
|
||||
|
||||
_tempTarget = target;
|
||||
_targetIndex = targetIndex;
|
||||
|
||||
charaIndex = targetIndex;
|
||||
_tempAnim = animations[targetIndex];
|
||||
|
||||
if (animclips != null)
|
||||
{
|
||||
if (targetIndex >= animclips.Count) return;
|
||||
_targetAnim = animclips[targetIndex];
|
||||
if (_targetAnim != null) _tempAnim.AddClip(_targetAnim, _targetAnim.name);
|
||||
return;
|
||||
}
|
||||
|
||||
_keyArray = timelineControl._keyArray;
|
||||
|
||||
if (seqDataIndex < _keyArray.Length)
|
||||
if (seqDataIndex < 0 || seqDataIndex >= _keyArray.Length) return;
|
||||
_currentKey = _keyArray[seqDataIndex];
|
||||
_sampleIk = _tempAnim.GetComponent<BipedIK>();
|
||||
if (_sampleIk != null)
|
||||
{
|
||||
_currentKey = _keyArray[seqDataIndex];
|
||||
// SolverManager.Update otherwise restores the bind pose after our manual sample.
|
||||
_resetIkBeforeSample = _sampleIk.fixTransforms;
|
||||
if (_resetIkBeforeSample) _sampleIk.fixTransforms = false;
|
||||
}
|
||||
|
||||
if (targetIndex < Director.instance.charaAnims.Count)
|
||||
{
|
||||
_tempAnim = Director.instance.charaAnims[targetIndex];
|
||||
_sampleIk = _tempAnim.GetComponent<BipedIK>();
|
||||
if (_sampleIk != null)
|
||||
{
|
||||
// SolverManager.Update otherwise restores the bind pose after our manual sample.
|
||||
_resetIkBeforeSample = _sampleIk.fixTransforms;
|
||||
if (_resetIkBeforeSample) _sampleIk.fixTransforms = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(_currentKey != null && _tempAnim != null)
|
||||
if (_currentKey != null)
|
||||
{
|
||||
foreach (var key in _currentKey.thisList)
|
||||
{
|
||||
if(key.clip != null)
|
||||
{
|
||||
_tempAnim.AddClip(key.clip, key.clip.name);
|
||||
}
|
||||
}
|
||||
SetupAnimationClip(key);
|
||||
}
|
||||
_tempAnim.wrapMode = WrapMode.Clamp;
|
||||
_tempAnim.enabled = false;
|
||||
}
|
||||
|
||||
private void SetupAnimationClip(LiveTimelineKeyCharaMotionData key)
|
||||
{
|
||||
// Native SetupAnimationClip (0x1af9ed0) ignores unnamed main-motion keys.
|
||||
if (key == null || string.IsNullOrEmpty(key.motionName)) return;
|
||||
// Native LoadAnimationClip (0x1ae4780) uses the existing clip triplet first.
|
||||
if (key.clip == null)
|
||||
{
|
||||
key.clip = LoadLiveAnimationClip(key.motionName, key.clip);
|
||||
key.clip2 = LoadLiveAnimationClip(key.motionName2, key.clip2);
|
||||
key.clip3 = LoadLiveAnimationClip(key.motionName3, key.clip3);
|
||||
}
|
||||
if (key.clip != null) _tempAnim.AddClip(key.clip, key.clip.name);
|
||||
if (key.clip2 != null) _tempAnim.AddClip(key.clip2, key.clip2.name);
|
||||
if (key.clip3 != null) _tempAnim.AddClip(key.clip3, key.clip3.name);
|
||||
}
|
||||
|
||||
private static AnimationClip LoadLiveAnimationClip(string motionName, AnimationClip existingClip)
|
||||
{
|
||||
if (existingClip != null || string.IsNullOrEmpty(motionName)) return existingClip;
|
||||
// ResourcePath.GetLiveAnimationClipPath: original body motion, not a substitute action.
|
||||
string path = "3d/motion/live/body/" + motionName;
|
||||
var entry = LiveEffectController.FindResourceEntry(path);
|
||||
if (entry == null)
|
||||
{
|
||||
Debug.LogError("[LiveTimelineMotionSequence] Motion resource not found: " + path);
|
||||
return null;
|
||||
}
|
||||
var bundle = UmaAssetManager.LoadAssetBundle(entry);
|
||||
if (bundle == null)
|
||||
{
|
||||
Debug.LogError("[LiveTimelineMotionSequence] Motion bundle load failed: " + path);
|
||||
return null;
|
||||
}
|
||||
string assetName = Path.GetFileNameWithoutExtension(entry.Name);
|
||||
var clip = bundle.LoadAsset<AnimationClip>(assetName);
|
||||
if (clip == null)
|
||||
{
|
||||
foreach (string asset in bundle.GetAllAssetNames())
|
||||
{
|
||||
if (!string.Equals(Path.GetFileNameWithoutExtension(asset), assetName, StringComparison.OrdinalIgnoreCase))
|
||||
continue;
|
||||
clip = bundle.LoadAsset<AnimationClip>(asset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (LiveRuntimeDiagnostics.Enabled)
|
||||
LiveRuntimeDiagnostics.RecordAssetLoad(entry.Name, "LoadAsset", typeof(AnimationClip),
|
||||
new UnityEngine.Object[] { clip }, clip, assetName);
|
||||
if (clip == null)
|
||||
Debug.LogError("[LiveTimelineMotionSequence] Motion clip load failed: " + path + " (" + assetName + ")");
|
||||
return clip;
|
||||
}
|
||||
|
||||
public void AlterUpdate(float currentTime, LiveTimelineKeyTimescaleDataList timescaleKeys)
|
||||
{
|
||||
var director = Director.instance;
|
||||
@@ -122,6 +163,7 @@ namespace Gallop.Live.Cutt
|
||||
|
||||
_curIndex = curKey.index;
|
||||
LiveTimelineKeyCharaMotionData arg = curKey.key as LiveTimelineKeyCharaMotionData;
|
||||
if (arg == null || string.IsNullOrEmpty(arg.motionName) || arg.clip == null) return;
|
||||
AnimationClip anim = arg.clip;
|
||||
|
||||
double start;
|
||||
|
||||
@@ -172,13 +172,11 @@ namespace Gallop.Live.Cutt
|
||||
|
||||
public bool newBezierCalcMethod;
|
||||
|
||||
public CullingLayer cullingMask = defCameraCullingLayer;
|
||||
|
||||
public float outlineZOffset = 1f;
|
||||
|
||||
public CharacterLOD characterLODMask = (CharacterLOD)((uint)outlineLODMask + (uint)shaderLODMask);
|
||||
|
||||
protected const CullingLayer defCameraCullingLayer = (CullingLayer)0x7FE;
|
||||
|
||||
protected const CharacterLOD outlineLODMask = (CharacterLOD)0x3FF;
|
||||
|
||||
@@ -186,92 +184,21 @@ namespace Gallop.Live.Cutt
|
||||
|
||||
public int GetCullingMask()
|
||||
{
|
||||
return GetCullingMask(cullingMask);
|
||||
}
|
||||
|
||||
protected static int GetCullingMask(CullingLayer layer)
|
||||
{
|
||||
int num = 257;
|
||||
if ((layer & CullingLayer.TransparentFX) != 0)
|
||||
{
|
||||
num |= 2;
|
||||
}
|
||||
if ((layer & CullingLayer.Background3D_NotReflect) != 0)
|
||||
{
|
||||
num |= 0x80000;
|
||||
}
|
||||
if ((layer & CullingLayer.Background3d) != 0)
|
||||
{
|
||||
num |= 0x100000;
|
||||
}
|
||||
if ((layer & CullingLayer.Character3d) != 0)
|
||||
{
|
||||
num |= 0x200000;
|
||||
}
|
||||
if ((layer & CullingLayer.Character3d_0) != 0)
|
||||
{
|
||||
num |= 0x400000;
|
||||
}
|
||||
if ((layer & CullingLayer.Character3d_1) != 0)
|
||||
{
|
||||
num |= 0x800000;
|
||||
}
|
||||
if ((layer & CullingLayer.Character3d_2) != 0)
|
||||
{
|
||||
num |= 0x1000000;
|
||||
}
|
||||
if ((layer & CullingLayer.Character3d_3) != 0)
|
||||
{
|
||||
num |= 0x2000000;
|
||||
}
|
||||
if ((layer & CullingLayer.Character3d_4) != 0)
|
||||
{
|
||||
num |= 0x4000000;
|
||||
}
|
||||
if ((layer & CullingLayer.Character3D_NotReflect) != 0)
|
||||
{
|
||||
num |= 0x8000000;
|
||||
}
|
||||
if ((layer & CullingLayer.Background3D_Other) != 0)
|
||||
{
|
||||
num |= 0x40000;
|
||||
}
|
||||
return num;
|
||||
|
||||
/*
|
||||
uint bittest = (uint)layer;
|
||||
|
||||
uint result = (uint)LayerMask.GetMask("Default");
|
||||
|
||||
if ((bittest & (uint)CullingLayer.TransparentFX) > 0)
|
||||
result |= (uint)LayerMask.GetMask("TransparentFX");
|
||||
if ((bittest & (uint)CullingLayer.Background3D_NotReflect) > 0)
|
||||
result |= (uint)LayerMask.GetMask("background_NotReflect");
|
||||
if ((bittest & (uint)CullingLayer.Background3d) > 0)
|
||||
result |= (uint)LayerMask.GetMask("background");
|
||||
if ((bittest & (uint)CullingLayer.Character3d) > 0)
|
||||
result |= (uint)LayerMask.GetMask("charas");
|
||||
if ((bittest & (uint)CullingLayer.Character3d_0) > 0)
|
||||
result |= (uint)LayerMask.GetMask("chara1");
|
||||
if ((bittest & (uint)CullingLayer.Character3d_1) > 0)
|
||||
result |= (uint)LayerMask.GetMask("chara2");
|
||||
if ((bittest & (uint)CullingLayer.Character3d_2) > 0)
|
||||
result |= (uint)LayerMask.GetMask("chara3");
|
||||
if ((bittest & (uint)CullingLayer.Character3d_3) > 0)
|
||||
result |= (uint)LayerMask.GetMask("chara4");
|
||||
if ((bittest & (uint)CullingLayer.Character3d_4) > 0)
|
||||
result |= (uint)LayerMask.GetMask("chara5");
|
||||
if ((bittest & (uint)CullingLayer.Character3D_NotReflect) > 0)
|
||||
result |= (uint)LayerMask.GetMask("otherChara");
|
||||
if ((bittest & (uint)CullingLayer.Background3D_Other) > 0)
|
||||
result |= (uint)LayerMask.GetMask("background_Other");
|
||||
return (int)result;
|
||||
*/
|
||||
}
|
||||
|
||||
public static int GetDefaultCullingMask()
|
||||
{
|
||||
return GetCullingMask(defCameraCullingLayer);
|
||||
// Native GetCullingMask (0x1af50a0) reads cullingLayer, not the legacy CGSS mask.
|
||||
int mask = 0;
|
||||
if ((cullingLayer & LiveCameraCullingLayer.TransparentFX) != 0) mask |= 1 << 1;
|
||||
if ((cullingLayer & LiveCameraCullingLayer.Effect) != 0) mask |= 1 << 11;
|
||||
if ((cullingLayer & LiveCameraCullingLayer.Background3d_NotReflect) != 0) mask |= 1 << 25;
|
||||
if ((cullingLayer & LiveCameraCullingLayer.Background3d) != 0) mask |= 1 << 12;
|
||||
if ((cullingLayer & LiveCameraCullingLayer.Character3d) != 0) mask |= 1 << 13;
|
||||
if ((cullingLayer & LiveCameraCullingLayer.Character3d_0) != 0) mask |= 1 << 27;
|
||||
if ((cullingLayer & LiveCameraCullingLayer.Character3d_1) != 0) mask |= 1 << 28;
|
||||
if ((cullingLayer & LiveCameraCullingLayer.Character3d_NotReflect) != 0) mask |= 1 << 26;
|
||||
if ((cullingLayer & LiveCameraCullingLayer.NotLayerDefault) == 0)
|
||||
mask |= GraphicSettings.GetCullingLayer(GraphicSettings.LayerIndex.LayerDefault);
|
||||
if ((cullingLayer & LiveCameraCullingLayer.NotLayer3d) == 0)
|
||||
mask |= GraphicSettings.GetCullingLayer(GraphicSettings.LayerIndex.Layer3D);
|
||||
return mask;
|
||||
}
|
||||
|
||||
public virtual Vector3 GetValue(LiveTimelineControl timelineControl)
|
||||
@@ -498,8 +425,8 @@ namespace Gallop.Live.Cutt
|
||||
|
||||
[SerializeField] public List<LiveTimelineTransformData> transformList;
|
||||
[SerializeField] public List<LiveTimelineObjectData> objectList;
|
||||
[SerializeField] public List<LiveTimelineMobCyalumeControlData> mobControlList;
|
||||
[SerializeField] public List<LiveTimelineMobCyalumeControlData> cyalumeControlList;
|
||||
[SerializeField] public List<LiveTimelineMobCyalumeControlData> MobControlKeys;
|
||||
[SerializeField] public List<LiveTimelineMobCyalumeControlData> CyalumeControlKeys;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user