Xlinka / NeosPlus

NeosVR Plugin Extra Logix nodes and features
https://discord.gg/9QAaMtXwke
Other
29 stars 19 forks source link

RandomCharacter LogiX node causes null reference exception in connected display node if there is no string input #164

Open Nytra opened 9 months ago

Nytra commented 9 months ago

πŸ” Issue Description

Describe the bug in detail:

When the RandomCharacter LogiX node does not have a string input it breaks any Display node connected to the output because of a NullReferenceException

Expected Behavior

The display node does not break

Actual Behavior

The display node breaks (turns red)

Steps to Reproduce

Create RandomCharacter node and don't connect any inputs, then pull a Display node from the output

Screenshots/Logs

21:48:32.574 ( 48 FPS)  Exception when Updating object: Element: ID29903706, Type: FrooxEngine.LogiX.Display.Display_Char, World: Neos+ World Test, IsRemoved: False, IsDestroyed: False, IsDisposed: False, Enabled: False
Element: ID298EAF06, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: Display, T: [0.00607037; 0.001069858; -0.01247676], R: [0.1485792; 0.5338739; -0.09593219; 0.8268615], S: [0.5419227; 0.5419226; 0.5419227], ActiveSelf: True, IsDestroyed: False
Element: ID962D500, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: Holder, T: [0.04959531; 0.6572429; 0.08546517], R: [0.5717716; 0.7439248; 0.2575237; -0.2309431], S: [2.276728; 2.276728; 2.276728], ActiveSelf: True, IsDestroyed: False
Element: ID962B000, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: Grabber, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False
Element: ID9DDE100, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: GrabArea Anchor, T: [0.0006470337; 0.01834286; -0.01439434], R: [0; 0; 0; 1], S: [0.25; 0.25; 0.25], ActiveSelf: True, IsDestroyed: False
Element: ID9DC6200, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: R.Hand, T: [-2.436057E-07; 0.08125468; 1.046582E-07], R: [0.1712375; 0.2100782; 0.1695811; 0.9475164], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False
Element: ID9DC4C00, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: R.Elbow, T: [1.547515E-07; 0.09444244; -1.549957E-08], R: [-0.2541983; -0.1411281; -0.8596736; 0.4200328], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False
Element: ID9DC3600, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: R.UpperArm, T: [4.741941E-08; 0.01674832; 3.9596E-07], R: [-0.4507018; 0.683081; 0.330732; 0.4699837], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False
Element: ID9DC2B00, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: R.Shoulder, T: [0.03146341; 0.05609065; -0.007636965], R: [0.7226189; 0.6726742; -0.05910079; 0.1477784], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False
Element: ID9AFA300, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: Chest, T: [1.548667E-15; 0.04279982; -7.583482E-09], R: [-0.0751473; -0.03052537; 0.04848042; 0.9955254], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False
Element: ID9AF9800, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: Slouch b gone, T: [-5.242326E-07; -0.006290545; -0.01723397], R: [0.1017897; -7.603147E-06; -2.251332E-06; -0.994806], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False
Element: ID9AF6C00, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: Spine, T: [-2.874743E-15; 0.02972315; -1.707865E-08], R: [0.2862118; -0.00166751; -0.004624814; 0.9581538], S: [0.9999999; 1; 0.9999999], ActiveSelf: True, IsDestroyed: False
Element: ID9AF6100, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: Anti Slouch Bone, T: [-7.952151E-08; -3.311187E-08; -3.125065E-08], R: [2.784282E-10; 4.623845E-09; -1.143343E-10; 1], S: [0.9999999; 1; 0.9999999], ActiveSelf: True, IsDestroyed: False
Element: ID9AF5600, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: Another Anti Slouch Bone, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False
Element: ID9ABDD00, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: Hips, T: [0.003883016; -0.03502386; 0.2599056], R: [0.6933587; 0.0008464149; -0.009870763; 0.7205245], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False
Element: ID9ABD200, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: Armature, T: [0; 0; 0], R: [-0.7071068; 0; 0; 0.7071068], S: [100; 100; 100], ActiveSelf: True, IsDestroyed: False
Element: ID9ABC700, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: RootNode, T: [6.66181E-06; 0.002157011; -8.158976], R: [0; -3.250282E-15; 0; 1], S: [1.8; 1.8; 1.8], ActiveSelf: True, IsDestroyed: False
Element: ID9ABB100, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: <color=purple>CenteredRoot, T: [-38.01288; 2.337028E-07; 36.90818], R: [-7.358717E-06; 0.1402681; -3.986443E-06; -0.9901136], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False
Element: ID9A8BC00, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: Face-Tracking Kita'vali Minimal v118, T: [0; 0; 0], R: [0; 0; 0; 1], S: [0.01801104; 0.01801104; 0.01801104], ActiveSelf: True, IsDestroyed: False
Element: ID95AE600, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: User <noparse=5>Nytra (ID9514100), T: [8.822042; 0.04314217; 7.46752], R: [0; 0.9009399; 0; -0.4339442], S: [0.5419227; 0.5419227; 0.5419227], ActiveSelf: True, IsDestroyed: False
Element: ID172006, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: Nytra User Space, T: [0.01173729; -0.0002761629; 1.973364], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False
Element: ID2100, Type: FrooxEngine.Slot, World: Neos+ World Test, IsRemoved: False, Slot name: Root, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False
Element: ID0, Type: FrooxEngine.World, World: Neos+ World Test, IsRemoved: False

Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at FrooxEngine.LogiX.Math.RandomCharacter.OnEvaluate () [0x0001a] in <e7a4077c20304e0e894bcfef3e4b1968>:0 
  at FrooxEngine.LogiX.LogixNode.CheckEvaluate () [0x00050] in <a6ff441fca7c4a97bc5b9dca720b524b>:0 
  at FrooxEngine.LogiX.Output`1[T].get_Value () [0x00008] in <a6ff441fca7c4a97bc5b9dca720b524b>:0 
  at FrooxEngine.LogiX.Output`1[T].get_Content () [0x00000] in <a6ff441fca7c4a97bc5b9dca720b524b>:0 
  at FrooxEngine.LogiX.Input`1[T].EvaluateRaw (T def) [0x0005c] in <a6ff441fca7c4a97bc5b9dca720b524b>:0 
  at FrooxEngine.LogiX.Input`1[T].Evaluate (T def) [0x00010] in <a6ff441fca7c4a97bc5b9dca720b524b>:0 
  at (wrapper dynamic-method) FrooxEngine.LogiX.Display.Display_Char.FrooxEngine.LogiX.Display.Display_Char.OnChanges_Patch1(FrooxEngine.LogiX.Display.Display_Char)
  at FrooxEngine.ComponentBase`1[C].InternalRunApplyChanges (System.Int32 updateIndex) [0x00017] in <a6ff441fca7c4a97bc5b9dca720b524b>:0 
  at FrooxEngine.UpdateManager.ProcessChange (FrooxEngine.IUpdatable updatable) [0x00024] in <a6ff441fca7c4a97bc5b9dca720b524b>:0 
  at FrooxEngine.UpdateManager.RunQueue[T] (System.Collections.Generic.Queue`1[T] queue, System.Action`1[T] action) [0x00009] in <a6ff441fca7c4a97bc5b9dca720b524b>:0 
21:48:32.597 ( 44 FPS)  Evaluate depth is above zero on LogiX Update
21:48:32.600 ( 44 FPS)  Restoring currently updating root. Stack:

   at void BaseX.UniLog.Error(string message, bool stackTrace)
   at void BaseX.UniLog.Warning(string message, bool stackTrace)
   at void FrooxEngine.UpdateManager.RestoreRootCurrentlyUpdating()
   at bool FrooxEngine.UpdateManager.RunQueue<IUpdatable>(Queue<IUpdatable> queue, Action<IUpdatable> action)
   at bool FrooxEngine.UpdateManager.RunChangeApplications()
   at bool FrooxEngine.World.RefreshStep()
   at bool FrooxEngine.World.Refresh()
   at void FrooxEngine.WorldManager.UpdateStep(double maxMilliseconds)
   at bool FrooxEngine.WorldManager.RunUpdateLoop(double maxMilliseconds)
   at void FrooxEngine.Engine.UpdateStep(double maxMilliseconds)
   at void FrooxEngine.Engine.RunUpdateLoop(double maxMilliseconds)
   at void FrooxEngineRunner.FrooxEngineRunner.Update_Patch1(FrooxEngineRunner)

πŸ”— Related Issues/PRs

N/a

πŸ’‘ Additional Context

N/a

🧐 Extra Hardware (if applicable)

N/a

πŸ“Ž Attachments (if any)

N/a

πŸš€ NeosPlus Version

v2023.09.13

Xlinka commented 9 months ago

made a fix in https://github.com/Xlinka/NeosPlus/commit/e0609fe6044b75b3b746b416614ca7ed4077f063