Skip to content

Commit

Permalink
Fixed null reference crash in Unity 2019 regarding Custom Render Text…
Browse files Browse the repository at this point in the history
…ures

Referencing long custom render texture chains on scene load crashes the editor, the fix is to just not reference on load and swap with an animation in play mode.
  • Loading branch information
SCRN-VRC committed Aug 23, 2021
1 parent 1cb23b0 commit f912de7
Show file tree
Hide file tree
Showing 150 changed files with 1,230 additions and 281 deletions.
8 changes: 8 additions & 0 deletions FaceLandmarkDetection/Animations.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions FaceLandmarkDetection/Animations/TestHead.controller
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1102 &-3233915782644603891
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: TurnOnBlending
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 2bf3edcf4a507a6468ea43ae2267e7d2, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &-1269572589789706522
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: -3233915782644603891}
m_Position: {x: 240, y: 220, z: 0}
- serializedVersion: 1
m_State: {fileID: 5287467534025926445}
m_Position: {x: 240, y: 110, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 5287467534025926445}
--- !u!1101 &-1010509475587481383
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -3233915782644603891}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: TestHead
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: -1269572589789706522}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1102 &5287467534025926445
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: TurnOffBlending
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: -1010509475587481383}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 9a970817e99dca84b9a2668a01df3707, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
8 changes: 8 additions & 0 deletions FaceLandmarkDetection/Animations/TestHead.controller.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 89 additions & 0 deletions FaceLandmarkDetection/Animations/TurnOffBlending.anim
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: TurnOffBlending
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 2100000, guid: 910608a272b111742855df9b23231589, type: 2}
- time: 1
value: {fileID: 2100000, guid: 910608a272b111742855df9b23231589, type: 2}
attribute: m_Materials.Array.data[0]
path: head
classID: 137
script: {fileID: 0}
- curve:
- time: 0
value: {fileID: 2100000, guid: cc3c4682ac151fa43b4db7d0837095a1, type: 2}
- time: 1
value: {fileID: 2100000, guid: cc3c4682ac151fa43b4db7d0837095a1, type: 2}
attribute: m_Materials.Array.data[1]
path: head
classID: 137
script: {fileID: 0}
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 2817783452
attribute: 0
script: {fileID: 0}
typeID: 137
customType: 21
isPPtrCurve: 1
- serializedVersion: 2
path: 2817783452
attribute: 1
script: {fileID: 0}
typeID: 137
customType: 21
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 2100000, guid: 910608a272b111742855df9b23231589, type: 2}
- {fileID: 2100000, guid: 910608a272b111742855df9b23231589, type: 2}
- {fileID: 2100000, guid: cc3c4682ac151fa43b4db7d0837095a1, type: 2}
- {fileID: 2100000, guid: cc3c4682ac151fa43b4db7d0837095a1, type: 2}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1.0166667
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
8 changes: 8 additions & 0 deletions FaceLandmarkDetection/Animations/TurnOffBlending.anim.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 83 additions & 0 deletions FaceLandmarkDetection/Animations/TurnOnBlending.anim
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: TurnOnBlending
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 2100000, guid: 535b853cd9f7a5c419a77ae64e921096, type: 2}
attribute: m_Materials.Array.data[0]
path: head
classID: 137
script: {fileID: 0}
- curve:
- time: 0
value: {fileID: 2100000, guid: a23e059fb15b09a4eb6947fc111f345c, type: 2}
attribute: m_Materials.Array.data[1]
path: head
classID: 137
script: {fileID: 0}
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 2817783452
attribute: 0
script: {fileID: 0}
typeID: 137
customType: 21
isPPtrCurve: 1
- serializedVersion: 2
path: 2817783452
attribute: 1
script: {fileID: 0}
typeID: 137
customType: 21
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 2100000, guid: 535b853cd9f7a5c419a77ae64e921096, type: 2}
- {fileID: 2100000, guid: a23e059fb15b09a4eb6947fc111f345c, type: 2}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.016666668
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
8 changes: 8 additions & 0 deletions FaceLandmarkDetection/Animations/TurnOnBlending.anim.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions FaceLandmarkDetection/CRTs/BlendValues.asset
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@ CustomRenderTexture:
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 8
m_Height: 8
m_AntiAliasing: 1
m_MipCount: -1
m_DepthFormat: 0
m_ColorFormat: 11
m_ColorFormat: 52
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
Expand All @@ -38,7 +41,7 @@ CustomRenderTexture:
m_InitColor: {r: 0, g: 0, b: 0, a: 1}
m_InitTexture: {fileID: 0}
m_UpdateMode: 1
m_InitializationMode: 2
m_InitializationMode: 0
m_UpdateZoneSpace: 0
m_CurrentUpdateZoneSpace: 0
m_UpdateZones:
Expand Down
7 changes: 5 additions & 2 deletions FaceLandmarkDetection/CRTs/FaceMesh/L0.asset
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@ CustomRenderTexture:
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 384
m_Height: 384
m_AntiAliasing: 1
m_MipCount: -1
m_DepthFormat: 0
m_ColorFormat: 14
m_ColorFormat: 49
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 0
Expand All @@ -38,7 +41,7 @@ CustomRenderTexture:
m_InitColor: {r: 0, g: 0, b: 0, a: 1}
m_InitTexture: {fileID: 0}
m_UpdateMode: 1
m_InitializationMode: 2
m_InitializationMode: 0
m_UpdateZoneSpace: 0
m_CurrentUpdateZoneSpace: 0
m_UpdateZones:
Expand Down
Loading

0 comments on commit f912de7

Please sign in to comment.