Skip to content

Commit

Permalink
DYN-7758: Clearer ByMeshColor error message (#15633)
Browse files Browse the repository at this point in the history
Co-authored-by: Trygve Wastvedt <[email protected]>
  • Loading branch information
LongNguyenP and twastvedt authored Nov 14, 2024
1 parent d40d4da commit a11fd57
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Libraries/GeometryColor/GeometryColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public static GeometryColor ByPointsColors([KeepReferenceAttribute]Point[] point
/// Display mesh by single color, per-face colors, per-vertex colors, or per-face-vertex colors.
/// </summary>
/// <param name="mesh"></param>The Mesh on which to apply the colors
/// <param name="colors">The color count must equal 1 (single color), or equal the face count (per-face color), or equal the vertex count (per-vertex) color, or equal the triangle count multiplied by three (per-face-vertex color)</param>
/// <param name="colors">The color count must equal 1 (single color), or equal the face count (per-face color), or equal the vertex count (per-vertex color), or equal the triangle count multiplied by three (per-triangle-vertex color)</param>
/// <param name="smoothShading">If true, shading will look smooth instead of faceted, useful for visualizing smooth continuous surfaces</param>
/// <returns>A Display object.</returns>
public static GeometryColor ByMeshColors(
Expand Down Expand Up @@ -390,7 +390,7 @@ public static GeometryColor ByMeshColors(

else
{
throw new ArgumentException("Color count is invalid");
throw new ArgumentException(Resources.ByMeshColorsInvalidColorCountMessage);
}

return new GeometryColor(vertexPositionsByTriangle, vertexColorsByTriangle, vertexNormalsByTriangle);
Expand Down
10 changes: 9 additions & 1 deletion src/Libraries/GeometryColor/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/Libraries/GeometryColor/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,7 @@
<data name="VerticesDivisibleByThreeExceptionMessage" xml:space="preserve">
<value>The number of vertices supplied must be divisible by three.</value>
</data>
</root>
<data name="ByMeshColorsInvalidColorCountMessage" xml:space="preserve">
<value>The color count is invalid. It must equal 1 (single color), or equal the face count (per-face color), or equal the vertex count (per-vertex color), or equal the triangle count multiplied by three (per-triangle-vertex color). If you want to color multiple meshes, you may need to use List Levels.</value>
</data>
</root>
5 changes: 4 additions & 1 deletion src/Libraries/GeometryColor/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,7 @@
<data name="VerticesDivisibleByThreeExceptionMessage" xml:space="preserve">
<value>The number of vertices supplied must be divisible by three.</value>
</data>
</root>
<data name="ByMeshColorsInvalidColorCountMessage" xml:space="preserve">
<value>The color count is invalid. It must equal 1 (single color), or equal the face count (per-face color), or equal the vertex count (per-vertex color), or equal the triangle count multiplied by three (per-triangle-vertex color). If you want to color multiple meshes, you may need to use List Levels.</value>
</data>
</root>

0 comments on commit a11fd57

Please sign in to comment.