Problem with MegaSplat Output

Issue #18 resolved
Denis Pahunov repo owner created an issue

@slipster216

Hi Jason,

I've finally got my hands on MegaSplat and MegaSplat Output. I should congratulate you with a great asset!

But it seems that MegaSplat Output is not working.

It has nor inputs, neither outputs. In OnGUI it just displays textures list field, no control for layers. There's no way to connect it to any generator to apply it to terrain.

Comments (24)

  1. Jason Booth

    Thats odd - I'll take a look tonight, did you change anything with the framework? Oh, did you assign the texture array config it requires in the GUI? This gives it the list of texture clusters, which are each represented as an input..

  2. Denis Pahunov reporter

    Okay, I guess it is what was commented out, uncommenting it causes errors:

    #!
    
    Assets/MapMagic/Generators/MegaSplatOutput.cs(458,24): error CS0123: A method or delegate `MapMagic.MegaSplatOutput.Layer.OnGUI(Plugins.Layout, bool)' parameters do not match delegate `System.Action<Plugins.Layout,bool,int>(Plugins.Layout, bool, int)' parameters
    

    I'll try to fix them if you don't mind

  3. Denis Pahunov reporter

    Maybe it's a problem with git on my side and I commented that out and just forgot it, but SourceTree displays no change in file. Sure, I've tried to assign texture array from MegaSplat demo, but nothing happened :)

  4. Jason Booth

    So I just pulled from the repros (map magic and plugins). The voxel land output complains because I don't have voxel land, so I deleted it for now, and then get this:

    Assets/mapmagic/plugins/Matrix3.cs(166,23): warning CS0661: Plugins.CoordCube' defines operator == or operator != but does not override Object.GetHashCode() Assets/mapmagic/plugins/Matrix3.cs(166,23): warning CS0659:Plugins.CoordCube' overrides Object.Equals(object) but does not override Object.GetHashCode() Assets/mapmagic/Generators/MatrixGenerators.cs(117,32): warning CS0219: The variable mask' is assigned but its value is never used Assets/mapmagic/plugins/Layout.cs(1442,38): warning CS0219: The variablebackgroundStartCursor' is assigned but its value is never used Assets/mapmagic/plugins/Layout.cs(1441,38): warning CS0219: The variable backgroundRect' is assigned but its value is never used Assets/mapmagic/Generators/OutputGenerators.cs(513,39): warning CS0219: The variablechunk' is assigned but its value is never used

    Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at Mono.CSharp.TypeInference.DoSecondPhase (Mono.CSharp.ResolveContext ec, Mono.CSharp.TypeInferenceContext tic, System.Type[] methodParameters, Boolean fixDependent) [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeInference.InferInPhases (Mono.CSharp.ResolveContext ec, Mono.CSharp.TypeInferenceContext tic, Mono.CSharp.AParametersCollection methodParameters) [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeInference.InferMethodArguments (Mono.CSharp.ResolveContext ec, System.Reflection.MethodBase method) [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeManager.InferTypeArguments (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments arguments, System.Reflection.MethodBase& method) [0x00000] in <filename unknown>:0 at Mono.CSharp.MethodGroupExpr.IsApplicable (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& arguments, Int32 arg_count, System.Reflection.MethodBase& method, System.Boolean& params_expanded_form) [0x00000] in <filename unknown>:0 at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& Arguments, Boolean may_fail, Location loc) [0x00000] in <filename unknown>:0 at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0 at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Assign.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.SimpleAssign.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0 at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.FlowBranching parent, Mono.CSharp.BlockContext rc, Mono.CSharp.ParametersCompiled ip, IMethodData md) [0x00000] in <filename unknown>:0

    Internal compiler error at Assets/mapmagic/Main/Generator.cs(504,38):: exception caught while emitting MethodBuilder [Biome::OnGUI]

  5. Jason Booth

    After fixing those errors:

    Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at Mono.CSharp.TypeInference.DoSecondPhase (Mono.CSharp.ResolveContext ec, Mono.CSharp.TypeInferenceContext tic, System.Type[] methodParameters, Boolean fixDependent) [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeInference.InferInPhases (Mono.CSharp.ResolveContext ec, Mono.CSharp.TypeInferenceContext tic, Mono.CSharp.AParametersCollection methodParameters) [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeInference.InferMethodArguments (Mono.CSharp.ResolveContext ec, System.Reflection.MethodBase method) [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeManager.InferTypeArguments (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments arguments, System.Reflection.MethodBase& method) [0x00000] in <filename unknown>:0 at Mono.CSharp.MethodGroupExpr.IsApplicable (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& arguments, Int32 arg_count, System.Reflection.MethodBase& method, System.Boolean& params_expanded_form) [0x00000] in <filename unknown>:0 at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& Arguments, Boolean may_fail, Location loc) [0x00000] in <filename unknown>:0 at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0 at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Assign.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.SimpleAssign.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0 at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.FlowBranching parent, Mono.CSharp.BlockContext rc, Mono.CSharp.ParametersCompiled ip, IMethodData md) [0x00000] in <filename unknown>:0

    Internal compiler error at Assets/mapmagic/Main/Generator.cs(504,38):: exception caught while emitting MethodBuilder [Biome::OnGUI]

  6. Denis Pahunov reporter

    Internal compile error on warning. I've encountered it once about a year ago, but already forgot what is it and how I've fixed it. The bad thing that it's hard to reproduce since I've just removed voxeland, restarted Unity and everything seems to be fine.

  7. Denis Pahunov reporter

    Okay, seems to be my fault, I've changed Layout.cs week ago or so, that made it incompatable with megasplat.

  8. Jason Booth

    I just removed plugintools and Map Magic and re-pulled from the repository, and I'm getting the same errors. Any chance you could fix this up? I made some changes to how cluster noise is handled, and like to make sure the MapMagic version has/uses the same changes correctly..

  9. Jason Booth

    still getting this:

    Assets/MapMagic/plugintools/Matrix3.cs(166,23): warning CS0661: Plugins.CoordCube' defines operator == or operator != but does not override Object.GetHashCode() Assets/MapMagic/plugintools/Matrix3.cs(166,23): warning CS0659:Plugins.CoordCube' overrides Object.Equals(object) but does not override Object.GetHashCode() Assets/MapMagic/mapmagic/Generators/MatrixGenerators.cs(117,32): warning CS0219: The variable mask' is assigned but its value is never used Assets/MapMagic/plugintools/Layout.cs(1442,38): warning CS0219: The variablebackgroundStartCursor' is assigned but its value is never used Assets/MapMagic/plugintools/Layout.cs(1441,38): warning CS0219: The variable `backgroundRect' is assigned but its value is never used

  10. Jason Booth

    Once i fix all those errors (just put something in for the hash code to get it to compile), I'm back at this one:

    Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at Mono.CSharp.TypeInference.DoSecondPhase (Mono.CSharp.ResolveContext ec, Mono.CSharp.TypeInferenceContext tic, System.Type[] methodParameters, Boolean fixDependent) [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeInference.InferInPhases (Mono.CSharp.ResolveContext ec, Mono.CSharp.TypeInferenceContext tic, Mono.CSharp.AParametersCollection methodParameters) [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeInference.InferMethodArguments (Mono.CSharp.ResolveContext ec, System.Reflection.MethodBase method) [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeManager.InferTypeArguments (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments arguments, System.Reflection.MethodBase& method) [0x00000] in <filename unknown>:0 at Mono.CSharp.MethodGroupExpr.IsApplicable (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& arguments, Int32 arg_count, System.Reflection.MethodBase& method, System.Boolean& params_expanded_form) [0x00000] in <filename unknown>:0 at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& Arguments, Boolean may_fail, Location loc) [0x00000] in <filename unknown>:0 at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0 at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Assign.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.SimpleAssign.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0 at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.FlowBranching parent, Mono.CSharp.BlockContext rc, Mono.CSharp.ParametersCompiled ip, IMethodData md) [0x00000] in <filename unknown>:0

    Internal compiler error at Assets/MapMagic/mapmagic/Main/Generator.cs(504,38):: exception caught while emitting MethodBuilder [Biome::OnGUI]

  11. Jason Booth

    Note, I have just pulled these into Assets/MapMagic/mapmagic and Assets/MapMagic/plugintools, respectively. Do you have any special pathing requirements or something?

  12. Denis Pahunov reporter
    #!
    
    Assets/MapMagic/plugintools/Matrix3.cs(166,23): warning CS0661: 
    

    It's a warning. I'll deal with them a bit later, they should not prevent scripts from compile. But in your case they are treated as errors for some reason.

    Does restarting Unity help?

    Tried moving PluginTools and MM to MapMagic folder, no effect.

  13. Jason Booth

    No, and the rest of my project treats warnings as warnings. After I fix all the warnings, I get the compiler error posted above, notice:

    Internal compiler error at Assets/MapMagic/mapmagic/Main/Generator.cs(504,38):: exception caught while emitting MethodBuilder [Biome::OnGUI]

    I think this is likely the real issue- though I'm not sure why it throws an exception on your OnGUI method. (I'm using 5.4, btw..)

  14. Denis Pahunov reporter

    I'm starting to recall how I fixed it. I have removed all of the csproj and sln files in project directory. Obviously, it's better make a backup - just in case.

  15. Jason Booth

    Tried deleting the project files and fixing the warnings - no luck, I still get the compiler exception for the OnGUI method.. Also, the MegaSplat output node had some #if #endif around the variables that it uses; this was causing a compile issue when MegaSplat wasn't installed, so those should really be around the whole class, not just the megasplat variables.

  16. Jason Booth

    public override System.Func<CoordRect, Terrain, object, ThreadWorker, IEnumerator> GetApply () { return null; }

    Perhaps this?

  17. Denis Pahunov reporter

    Does it happens in a clear project?

    I have a question, though. As far as I understand every terrain chunk should use an unique material or material property block to assign a proper unique control texture - but I cannot find where it is done in the code.

    If you find skype chat more convenient here is my acc name: akaWraith

  18. Log in to comment