{"record":{"id":"116df135d9f82213","repo":"stride3d/stride","slug":"heighttype-height-type-is-not-supported","errorCode":null,"errorMessage":"{ heightType } height type is not supported.","messagePattern":"(.+?) height type is not supported\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Assets/Physics/HeightmapAssetCompiler.cs","lineNumber":251,"sourceCode":"                                                HeightmapUtils.ConvertToByteHeights(shorts);\n                                            break;\n\n                                        case PixelFormat.R8_UNorm:\n                                            bytes = HeightmapUtils.Resize(pixelBuffer.GetPixels<byte>(), pixelBufferSize, size);\n                                            break;\n                                    }\n\n                                    if (useScaleToRange)\n                                    {\n                                        ScaleToHeightRange(bytes, byte.MinValue, byte.MaxValue, heightRange, heightScale, commandContext);\n                                    }\n\n                                    heightmap = Heightmap.Create(size, heightType, heightRange, heightScale, bytes);\n                                }\n                                break;\n\n                            default:\n                                throw new Exception($\"{ heightType } height type is not supported.\");\n                        }\n\n                        commandContext.Logger.Info($\"[{Url}] Convert Image(Format={ texImage.Format }, Width={ texImage.Width }, Height={ texImage.Height }) \" +\n                            $\"to Heightmap(HeightType={ heightType }, MinHeight={ heightRange.X }, MaxHeight={ heightRange.Y }, HeightScale={ heightScale }, Size={ size }).\");\n                    }\n                }\n\n                if (heightmap == null)\n                {\n                    throw new Exception($\"Failed to compile { Url }.\");\n                }\n\n                assetManager.Save(Url, heightmap);\n\n                return Task.FromResult(ResultStatus.Successful);\n            }\n\n            private void CalculateByteOrShortRange(Vector2 heightRage, float heightScale, out float min, out float max)","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Assets/Physics/HeightmapAssetCompiler.cs#L233-L269","documentation":"After converting pixel data, the compiler builds a Heightmap for the configured HeightType (Byte or Short). Any HeightType value other than the supported enum cases reaches the switch's default and throws. This indicates a corrupted or hand-edited asset configuration.","triggerScenarios":"Heightmap asset's HeightType property set to an undefined/invalid value (e.g. cast from a bad import or manual .sdfloat edit), hitting the default case in DoCommandOverride.","commonSituations":"Hand-editing the asset file and mistyping the HeightType enum, or an asset created by a different Stride version with an incompatible enum value.","solutions":["Set HeightType to a valid value (Byte or Short) in the editor","Delete and re-import the heightmap asset to regenerate a clean configuration","Inspect the .sdfloat file for the HeightType field and correct it","Upgrade/downgrade assets through the editor's asset migration instead of manual edits"],"exampleFix":"// before\n<HeightType>42</HeightType> <!-- invalid enum -->\n// after\n<HeightType>Byte</HeightType>","handlingStrategy":"validation","validationCode":"if (!Enum.IsDefined(typeof(HeightType), heightmapAsset.HeightType))\n    throw new InvalidOperationException($\"Invalid HeightType: {heightmapAsset.HeightType}\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hand-edit enum values in .sdfloat files","Use the editor's property grid to change HeightType","Run asset migration through the editor when upgrading Stride versions","Recreate assets that fail to load after a version change"],"tags":["physics","heightmap","invalid-enum-value"],"backgroundTag":"invalid-enum-value","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}