{"record":{"id":"69fec49aead60926","repo":"stride3d/stride","slug":"invalid-half-format-half3converter","errorCode":null,"errorMessage":"Invalid half format.","messagePattern":"Invalid half format\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Design/TypeConverters/Half3Converter.cs","lineNumber":128,"sourceCode":"    /// </summary>\n    /// <param name = \"context\">A <see cref = \"T:System.ComponentModel.ITypeDescriptorContext\" /> that provides a format context.</param>\n    /// <param name = \"culture\">A <see cref = \"T:System.Globalization.CultureInfo\" />. If <c>null</c> is passed, the current culture is assumed.</param>\n    /// <param name = \"value\">The <see cref = \"T:System.Object\" /> to convert.</param>\n    /// <returns>An <see cref = \"T:System.Object\" /> that represents the converted value.</returns>\n    public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value)\n    {\n        culture ??= CultureInfo.CurrentCulture;\n        if (value is not string str)\n        {\n            return base.ConvertFrom(context, culture, value);\n        }\n        str = str.Trim();\n        TypeConverter converter = TypeDescriptor.GetConverter(typeof(Half));\n        char[] separator = [culture.TextInfo.ListSeparator[0]];\n        string[] stringArray = str.Split(separator);\n        if (stringArray.Length != 3)\n        {\n            throw new ArgumentException(\"Invalid half format.\");\n        }\n        Half x = (Half)converter.ConvertFromString(context, culture, stringArray[0])!;\n        Half y = (Half)converter.ConvertFromString(context, culture, stringArray[1])!;\n        Half z = (Half)converter.ConvertFromString(context, culture, stringArray[2])!;\n        return new Half3(x, y, z);\n    }\n\n    /// <summary>\n    ///   Converts the given value object to the specified type, using the specified context and culture information.\n    /// </summary>\n    /// <param name = \"context\">A <see cref = \"T:System.ComponentModel.ITypeDescriptorContext\" /> that provides a format context.</param>\n    /// <param name = \"culture\">A <see cref = \"T:System.Globalization.CultureInfo\" />. If <c>null</c> is passed, the current culture is assumed.</param>\n    /// <param name = \"value\">The <see cref = \"T:System.Object\" /> to convert.</param>\n    /// <param name = \"destinationType\">A <see cref = \"T:System.Type\" /> that represents the type you want to convert to.</param>\n    /// <returns>An <see cref = \"T:System.Object\" /> that represents the converted value.</returns>\n    public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)\n    {\n#if NET6_0_OR_GREATER","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Design/TypeConverters/Half3Converter.cs#L110-L146","documentation":"Parse failure in Half3Converter.ConvertFrom: the string being converted to a Half3 does not match the expected numeric format (three comma/space-separated half values), so parsing was abandoned. The faulting input is the string passed via the value parameter to the type converter.","triggerScenarios":"Calling ConvertFrom/ConvertFromString with a string splitting into != 3 parts: '1.5, 2.0' (2), '1.5, 2.0, 3.0, 4.0' (4), missing separators, or a locale with a different list separator than the one used in the string.","commonSituations":"Copy-pasting 2D or 4D vectors into a Half3 field; serialized scene data with wrong arity; regional settings (e.g. ';' separators or decimal commas) conflicting with the writer's culture.","solutions":["Provide exactly three values separated by the culture's list separator: '1.0, 2.0, 3.0'","Match the culture used at write time when parsing (invariant vs localized)","Pre-validate: trimmed string must contain exactly 2 separator characters and 3 non-empty parts","Catch ArgumentException and normalize/retry with corrected format"],"exampleFix":"// before\nconverter.ConvertFromString(null, culture, \"1.0, 2.0\")\n// after\nconverter.ConvertFromString(null, culture, \"1.0, 2.0, 3.0\")","handlingStrategy":"validation","validationCode":"var parts = s.Trim().Split(culture.TextInfo.ListSeparator[0]);\nif (parts.Length != 3) throw new FormatException(\"Half3 needs exactly 3 values\");","typeGuard":null,"tryCatchPattern":"try { v = (Half3)converter.ConvertFrom(s); }\ncatch (ArgumentException) { /* prompt for 'x, y, z' format */ }","preventionTips":["Match writer/reader cultures","Validate 3 parts before parsing","Never paste 2D/4D data into Half3 fields"],"tags":["typeconverter","parsing","half","vector"],"backgroundTag":"invalid-argument-format","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}