Stylized tools: hand-painted + PBR remake of all seven hand tools

Nail scissors, garden shears, sickle, scythe, long scythe, two-handed
scythe and hammer remade from scratch in Blender in a grounded
hand-painted style, with a metallic/smoothness mask so metal still
shines. Materials come from ArtSource/materials_style.json; the builder
now supports a mask texture and a faint paint glow. Blender sources,
textures and previews live in ArtSource/Blender/stylized.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bonchellon
2026-12-01 16:30:02 +03:00
parent f3f96ae6b4
commit a3e4f00282
134 changed files with 5065 additions and 31 deletions

View File

@ -153,7 +153,12 @@ namespace GrassCutter.EditorTools
// ───────────────────────── materials ─────────────────────────
[Serializable] class MatDef { public string name, color, texture, emission; public float metallic, smoothness, alpha; public bool transparent, cutout; public float[] tiling; }
/// <summary>
/// One material from ArtSource/materials*.json. The painted, PBR tools (materials_style.json) add <c>mask</c>: metallic in
/// RGB, smoothness in alpha (URP's metallic map), and <c>paintGlow</c>: that much of the painted texture as emission,
/// so the painted forms still read in shade.
/// </summary>
[Serializable] class MatDef { public string name, color, texture, emission, mask; public float metallic, smoothness, alpha, paintGlow; public bool transparent, cutout; public float[] tiling; }
[Serializable] class MatList { public MatDef[] items; }
static Shader Lit => Shader.Find("Universal Render Pipeline/Lit");
@ -182,6 +187,30 @@ namespace GrassCutter.EditorTools
}
m.SetFloat("_Metallic", d.metallic);
m.SetFloat("_Smoothness", d.smoothness);
if (!string.IsNullOrEmpty(d.mask))
{
var maskPath = "Assets/Art/Textures/" + d.mask;
// the mask holds numbers, not colours
if (AssetImporter.GetAtPath(maskPath) is TextureImporter ti && ti.sRGBTexture)
{
ti.sRGBTexture = false;
ti.SaveAndReimport();
}
var mask = AssetDatabase.LoadAssetAtPath<Texture2D>(maskPath);
if (mask)
{
m.SetTexture("_MetallicGlossMap", mask);
m.SetFloat("_Smoothness", 1f); // with the map, this scales its alpha
m.EnableKeyword("_METALLICSPECGLOSSMAP");
}
}
if (d.paintGlow > 0f && m.GetTexture("_BaseMap") is Texture paint)
{
m.SetTexture("_EmissionMap", paint);
m.SetColor("_EmissionColor", Color.white * d.paintGlow);
m.EnableKeyword("_EMISSION");
m.globalIlluminationFlags = MaterialGlobalIlluminationFlags.None;
}
if (!string.IsNullOrEmpty(d.emission) && ColorUtility.TryParseHtmlString(d.emission, out var e))
{
m.SetColor("_EmissionColor", e * 2.2f);