SourceUtils icon indicating copy to clipboard operation
SourceUtils copied to clipboard

WebExport crashes on (skybox) files

Open DevRuto opened this issue 7 years ago • 3 comments

https://i.imgur.com/6aYcS1W.png (thanks to Ocelot) Occurs on attempting to export kz_unity_01 and kz_ziggurath_final

DevRuto avatar Jul 21 '18 05:07 DevRuto

Unable to export kz_zxp_interstellar_v2, kz_htc_purgatory, and kz_blackness

DevRuto avatar Feb 28 '19 15:02 DevRuto

turning off --verbose option prevents it from crashes

I'm facing exactly the same problem when the program tries to export the vertigoblue skybox which is the standard csgo one

It seems that its name should contain "_hdr", so it should be vertigoblue_hdr instead But this is what happens during surf_ameliorate export

[19/336] Exporting '/materials/skybox/vertigoblue_rt.vtf.json' ... Failed
[20/336] Exporting '/materials/skybox/vertigoblue_lf.vtf.json' ... Failed
[21/336] Exporting '/materials/skybox/vertigoblue_bk.vtf.json' ... Failed
[22/336] Exporting '/materials/skybox/vertigoblue_ft.vtf.json' ... Failed
[23/336] Exporting '/materials/skybox/vertigoblue_up.vtf.json' ... Failed
[24/336] Exporting '/materials/skybox/vertigoblue_dn.vtf.json' ... Failed

I decompiled surf_ameliorate using bspsrc. It turned out that the map itself uses skyname with "_hdr" postfix

"skyname" "vertigoblue_hdr"

Perhaps the program incorrectly reads the skyname from the .bsp file, so it looks like this issue is duplicate of https://github.com/Metapyziks/SourceUtils/issues/12

DaLLuZZ avatar Aug 11 '22 06:08 DaLLuZZ

There is a way to get rid of program crashes without removing the --verbose option from the program launch options https://github.com/Metapyziks/SourceUtils/blob/0f15906b4d1f2a6afb4e781aa648c4e5ede68663/SourceUtils.WebExport/Export.cs#L233-L250 It is necessary to check e.Response for null in order to avoid crashing the program

catch ( WebException e )
{
    ++failed;

    if ( args.Verbose )
    {
        Console.ForegroundColor = ConsoleColor.DarkRed;
        Console.WriteLine("Failed");

        if ( e.Response != null)
        {
            using ( var stream = e.Response.GetResponseStream() )
            {
                using ( var reader = new StreamReader( stream ) )
                {
                    Console.WriteLine( reader.ReadToEnd() );
                }
            }
        }
        else
            Console.WriteLine("Null Response");
    }
}

But this will not solve the problem with the skybox itself, it will only save the program from crashing and make it possible to continue exporting without restarting. Judging by the behavior of the program during the export of the skybox, the problem is in some kind of infinite loop

Worth a look at this method https://github.com/Metapyziks/SourceUtils/blob/e64dd0bdffc4d60e348b24c748fc785f96f3563f/SourceUtils.WebExport/Material.cs#L294-L345

DaLLuZZ avatar Aug 13 '22 21:08 DaLLuZZ