{
  "version": 1,
  "description": "A wall-mounted utility cabinet with chipped paint, rain marks below the louvres and rust from the steel fittings.",
  "params": {
    "wear": {"type": "float", "default": 0.5, "min": 0, "max": 1, "step": 0.05, "label": "wear", "desc": "chipped and worn paint"},
    "dirt": {"type": "float", "default": 0.5, "min": 0, "max": 1, "step": 0.05, "label": "dirt", "desc": "grime and dust"},
    "rust": {"type": "float", "default": 0.5, "min": 0, "max": 1, "step": 0.05, "label": "rust", "desc": "rust on the steel"},
    "age": {"type": "float", "default": 0.5, "min": 0, "max": 1, "step": 0.05, "label": "age", "desc": "how long the surface has been exposed"},
    "exposure": {"type": "enum", "options": ["outdoor", "sheltered", "indoor"], "default": "outdoor", "label": "exposure", "desc": "where the prop stands"},
    "resolution": {"type": "enum", "options": [256, 512, 1024], "default": 512, "label": "resolution", "desc": "pixels along each side of the maps"},
    "seed": {"type": "int", "default": 1, "min": 0, "max": 9999, "label": "seed", "desc": "changes where the marks appear"}
  },
  "vars": {"wear": 0.5, "dirt": 0.5, "rust": 0.5, "age": 0.5, "exposure": "outdoor", "resolution": 512, "seed": 1},
  "meta": {"render": {"views": ["persp"], "azimuth": 26, "elevation": 33, "size": "880x900", "shading": "pbr", "textures": true, "grid": false, "view_labels": false, "footer": false}},
  "nodes": {
    "case_shape": {"type": "box", "params": {"size": [0.62, 0.82, 0.235], "center": [0, 0.41, -0.0175]}},
    "case_chamfer": {"type": "poly_bevel", "in": ["case_shape"], "params": {"offset": 0.012}},
    "case": {"type": "attrib_create", "in": ["case_chamfer"], "params": {"name": "name", "class": "prim", "value": "case"}},
    "hood_shape": {"type": "box", "params": {"size": [0.649, 0.036, 0.274], "center": [0, 0.826, -0.019]}},
    "hood_chamfer": {"type": "poly_bevel", "in": ["hood_shape"], "params": {"offset": 0.009}},
    "hood": {"type": "attrib_create", "in": ["hood_chamfer"], "params": {"name": "name", "class": "prim", "value": "hood"}},
    "door_seam_shape": {"type": "box", "params": {"size": [0.574, 0.748, 0.026], "center": [0, 0.412, 0.103]}},
    "door_seam": {"type": "attrib_create", "in": ["door_seam_shape"], "params": {"name": "name", "class": "prim", "value": "door_seam"}},
    "door_shape": {"type": "box", "params": {"size": [0.562, 0.736, 0.032], "center": [0, 0.412, 0.126]}},
    "door_chamfer": {"type": "poly_bevel", "in": ["door_shape"], "params": {"offset": 0.009}},
    "door": {"type": "attrib_create", "in": ["door_chamfer"], "params": {"name": "name", "class": "prim", "value": "door"}},
    "vent_1_shape": {"type": "box", "params": {"size": [0.338, 0.022, 0.004], "center": [-0.032, 0.627, 0.1425]}},
    "vent_1": {"type": "attrib_create", "in": ["vent_1_shape"], "params": {"name": "name", "class": "prim", "value": "vent_1"}},
    "louvre_1_shape": {"type": "box", "params": {"size": [0.36, 0.025, 0.019], "center": [0, 0, 0]}},
    "louvre_1_chamfer": {"type": "poly_bevel", "in": ["louvre_1_shape"], "params": {"offset": 0.003}},
    "louvre_1_placed": {"type": "transform", "in": ["louvre_1_chamfer"], "params": {"rotate": [22, 0, 0], "translate": [-0.032, 0.635, 0.152]}},
    "louvre_1": {"type": "attrib_create", "in": ["louvre_1_placed"], "params": {"name": "name", "class": "prim", "value": "louvre_1"}},
    "vent_2_shape": {"type": "box", "params": {"size": [0.338, 0.022, 0.004], "center": [-0.032, 0.591, 0.1425]}},
    "vent_2": {"type": "attrib_create", "in": ["vent_2_shape"], "params": {"name": "name", "class": "prim", "value": "vent_2"}},
    "louvre_2_shape": {"type": "box", "params": {"size": [0.36, 0.025, 0.019], "center": [0, 0, 0]}},
    "louvre_2_chamfer": {"type": "poly_bevel", "in": ["louvre_2_shape"], "params": {"offset": 0.003}},
    "louvre_2_placed": {"type": "transform", "in": ["louvre_2_chamfer"], "params": {"rotate": [22, 0, 0], "translate": [-0.032, 0.599, 0.152]}},
    "louvre_2": {"type": "attrib_create", "in": ["louvre_2_placed"], "params": {"name": "name", "class": "prim", "value": "louvre_2"}},
    "vent_3_shape": {"type": "box", "params": {"size": [0.338, 0.022, 0.004], "center": [-0.032, 0.555, 0.1425]}},
    "vent_3": {"type": "attrib_create", "in": ["vent_3_shape"], "params": {"name": "name", "class": "prim", "value": "vent_3"}},
    "louvre_3_shape": {"type": "box", "params": {"size": [0.36, 0.025, 0.019], "center": [0, 0, 0]}},
    "louvre_3_chamfer": {"type": "poly_bevel", "in": ["louvre_3_shape"], "params": {"offset": 0.003}},
    "louvre_3_placed": {"type": "transform", "in": ["louvre_3_chamfer"], "params": {"rotate": [22, 0, 0], "translate": [-0.032, 0.5630000000000001, 0.152]}},
    "louvre_3": {"type": "attrib_create", "in": ["louvre_3_placed"], "params": {"name": "name", "class": "prim", "value": "louvre_3"}},
    "vent_4_shape": {"type": "box", "params": {"size": [0.338, 0.022, 0.004], "center": [-0.032, 0.519, 0.1425]}},
    "vent_4": {"type": "attrib_create", "in": ["vent_4_shape"], "params": {"name": "name", "class": "prim", "value": "vent_4"}},
    "louvre_4_shape": {"type": "box", "params": {"size": [0.36, 0.025, 0.019], "center": [0, 0, 0]}},
    "louvre_4_chamfer": {"type": "poly_bevel", "in": ["louvre_4_shape"], "params": {"offset": 0.003}},
    "louvre_4_placed": {"type": "transform", "in": ["louvre_4_chamfer"], "params": {"rotate": [22, 0, 0], "translate": [-0.032, 0.527, 0.152]}},
    "louvre_4": {"type": "attrib_create", "in": ["louvre_4_placed"], "params": {"name": "name", "class": "prim", "value": "louvre_4"}},
    "vent_5_shape": {"type": "box", "params": {"size": [0.338, 0.022, 0.004], "center": [-0.032, 0.483, 0.1425]}},
    "vent_5": {"type": "attrib_create", "in": ["vent_5_shape"], "params": {"name": "name", "class": "prim", "value": "vent_5"}},
    "louvre_5_shape": {"type": "box", "params": {"size": [0.36, 0.025, 0.019], "center": [0, 0, 0]}},
    "louvre_5_chamfer": {"type": "poly_bevel", "in": ["louvre_5_shape"], "params": {"offset": 0.003}},
    "louvre_5_placed": {"type": "transform", "in": ["louvre_5_chamfer"], "params": {"rotate": [22, 0, 0], "translate": [-0.032, 0.491, 0.152]}},
    "louvre_5": {"type": "attrib_create", "in": ["louvre_5_placed"], "params": {"name": "name", "class": "prim", "value": "louvre_5"}},
    "hinge_upper_leaf_shape": {"type": "box", "params": {"size": [0.061, 0.081, 0.013], "center": [0.262, 0.664, 0.145]}},
    "hinge_upper_leaf_chamfer": {"type": "poly_bevel", "in": ["hinge_upper_leaf_shape"], "params": {"offset": 0.004}},
    "hinge_upper_leaf": {"type": "attrib_create", "in": ["hinge_upper_leaf_chamfer"], "params": {"name": "name", "class": "prim", "value": "hinge_upper_leaf"}},
    "hinge_upper_pin_shape": {"type": "tube", "params": {"axis": "y", "radius": 0.013, "height": 0.099, "center": [0.297, 0.664, 0.152], "cols": 12}},
    "hinge_upper_pin": {"type": "attrib_create", "in": ["hinge_upper_pin_shape"], "params": {"name": "name", "class": "prim", "value": "hinge_upper_pin"}},
    "bolt_upper_outside_shape": {"type": "tube", "params": {"axis": "z", "radius": 0.008, "height": 0.009, "center": [0.265, 0.687, 0.156], "cols": 6}},
    "bolt_upper_outside": {"type": "attrib_create", "in": ["bolt_upper_outside_shape"], "params": {"name": "name", "class": "prim", "value": "bolt_upper_outside"}},
    "bolt_upper_inside_shape": {"type": "tube", "params": {"axis": "z", "radius": 0.008, "height": 0.009, "center": [0.265, 0.641, 0.156], "cols": 6}},
    "bolt_upper_inside": {"type": "attrib_create", "in": ["bolt_upper_inside_shape"], "params": {"name": "name", "class": "prim", "value": "bolt_upper_inside"}},
    "hinge_lower_leaf_shape": {"type": "box", "params": {"size": [0.061, 0.081, 0.013], "center": [0.262, 0.197, 0.145]}},
    "hinge_lower_leaf_chamfer": {"type": "poly_bevel", "in": ["hinge_lower_leaf_shape"], "params": {"offset": 0.004}},
    "hinge_lower_leaf": {"type": "attrib_create", "in": ["hinge_lower_leaf_chamfer"], "params": {"name": "name", "class": "prim", "value": "hinge_lower_leaf"}},
    "hinge_lower_pin_shape": {"type": "tube", "params": {"axis": "y", "radius": 0.013, "height": 0.099, "center": [0.297, 0.197, 0.152], "cols": 12}},
    "hinge_lower_pin": {"type": "attrib_create", "in": ["hinge_lower_pin_shape"], "params": {"name": "name", "class": "prim", "value": "hinge_lower_pin"}},
    "bolt_lower_outside_shape": {"type": "tube", "params": {"axis": "z", "radius": 0.008, "height": 0.009, "center": [0.265, 0.22, 0.156], "cols": 6}},
    "bolt_lower_outside": {"type": "attrib_create", "in": ["bolt_lower_outside_shape"], "params": {"name": "name", "class": "prim", "value": "bolt_lower_outside"}},
    "bolt_lower_inside_shape": {"type": "tube", "params": {"axis": "z", "radius": 0.008, "height": 0.009, "center": [0.265, 0.17400000000000002, 0.156], "cols": 6}},
    "bolt_lower_inside": {"type": "attrib_create", "in": ["bolt_lower_inside_shape"], "params": {"name": "name", "class": "prim", "value": "bolt_lower_inside"}},
    "latch_socket_shape": {"type": "tube", "params": {"axis": "z", "radius": 0.027, "height": 0.014, "center": [-0.193, 0.358, 0.147], "cols": 20}},
    "latch_socket": {"type": "attrib_create", "in": ["latch_socket_shape"], "params": {"name": "name", "class": "prim", "value": "latch_socket"}},
    "latch_shape": {"type": "box", "params": {"size": [0.086, 0.029, 0.029], "center": [0, 0, 0]}},
    "latch_chamfer": {"type": "poly_bevel", "in": ["latch_shape"], "params": {"offset": 0.006, "divisions": 1}},
    "latch_placed": {"type": "transform", "in": ["latch_chamfer"], "params": {"rotate": [0, 0, -12], "translate": [-0.166, 0.358, 0.165]}},
    "latch": {"type": "attrib_create", "in": ["latch_placed"], "params": {"name": "name", "class": "prim", "value": "latch"}},
    "bolt_catch_shape": {"type": "tube", "params": {"axis": "z", "radius": 0.008, "height": 0.01, "center": [-0.233, 0.218, 0.144], "cols": 6}},
    "bolt_catch": {"type": "attrib_create", "in": ["bolt_catch_shape"], "params": {"name": "name", "class": "prim", "value": "bolt_catch"}},
    "bolt_hood_shape": {"type": "tube", "params": {"axis": "z", "radius": 0.009, "height": 0.009, "center": [-0.243, 0.826, 0.117], "cols": 6}},
    "bolt_hood": {"type": "attrib_create", "in": ["bolt_hood_shape"], "params": {"name": "name", "class": "prim", "value": "bolt_hood"}},
    "prop_parts": {"type": "merge", "in": ["case", "hood", "door_seam", "door", "vent_1", "louvre_1", "vent_2", "louvre_2", "vent_3", "louvre_3", "vent_4", "louvre_4", "vent_5", "louvre_5", "hinge_upper_leaf", "hinge_upper_pin", "bolt_upper_outside", "bolt_upper_inside", "hinge_lower_leaf", "hinge_lower_pin", "bolt_lower_outside", "bolt_lower_inside", "latch_socket", "latch", "bolt_catch", "bolt_hood"]},
    "enamel": {"type": "material", "in": ["prop_parts"], "params": {"name": "enamel", "base_color": "#c7c9c5", "roughness": 0.46, "metallic": 0, "kind": "painted_metal"}},
    "hood_paint": {"type": "material", "in": ["enamel"], "params": {"name": "hood_paint", "group": "@name=hood", "base_color": "#979fa3", "roughness": 0.46, "kind": "painted_metal"}},
    "recesses": {"type": "material", "in": ["hood_paint"], "params": {"name": "recesses", "group": "@name=door_seam @name=vent_*", "base_color": "#4d514f", "roughness": 0.8, "metallic": 0, "kind": "painted_metal"}},
    "steel": {"type": "material", "in": ["recesses"], "params": {"name": "steel", "group": "@name=hinge_*_pin @name=bolt_*", "base_color": "#8e8f87", "roughness": 0.5, "metallic": 0.8, "kind": "bare_steel"}},
    "fitting_paint": {"type": "material", "in": ["steel"], "params": {"name": "fitting_paint", "group": "@name=latch* @name=hinge_*_leaf", "base_color": "#7d8688", "roughness": 0.43, "metallic": 0, "kind": "painted_metal"}},
    "handled": {"type": "group", "in": ["fitting_paint"], "params": {"name": "handled", "class": "prim", "pattern": "@name=latch @name=hinge_*_leaf"}},
    "normals": {"type": "normal", "in": ["handled"], "params": {"class": "vertex", "cusp_angle": 45}},
    "wall": {"type": "grid", "params": {"size": [5, 5], "divisions": [1, 1], "plane": "xy", "center": [0, 0.42, -0.158]}},
    "unwrap": {"type": "uv_unwrap", "in": ["normals", "wall"], "params": {"resolution": 512, "padding": 7, "iterations": 1, "visibility_weight": 1}},
    "bake_uv": {"type": "uv_transform", "in": ["unwrap"], "params": {"scale": [0.85, 0.85]}},
    "weathered": {"type": "weather", "in": ["bake_uv"], "params": {
      "wear": "=wear * (0.55 + 0.45 * wear)",
      "dirt": "=dirt",
      "rust": "=rust",
      "age": "=age",
      "exposure": "=exposure",
      "resolution": "=resolution",
      "seed": "=seed",
      "mount": "wall",
      "layout": "keep",
      "handled": "handled",
      "samples": 4,
      "padding": 3,
      "leak_density": 65,
      "sun": [-0.4, 1, 0.45],
      "overrides": {
        "painted_metal_primer": {"color": "#b5babe"},
        "painted_metal_bare": {"color": "#c7d0d5", "roughness": 0.48, "metallic": 0.72},
        "painted_metal_rust": {"opacity": 0.26},
        "dust": {"color": "#f4f3ef", "opacity": 1},
        "grime": {"color": "#494944"},
        "dirt_stain": {"color": "#555b57", "opacity": 0.7},
        "runs_dirt": {"color": "#606761", "opacity": 0.46},
        "rust_stain": {"color": "#b45e2a", "opacity": 0.85},
        "runs_rust": {"color": "#a95121", "opacity": 1}
      }
    }},
    "checked_maps": {"type": "assert", "in": ["weathered"], "params": {"label": "maps", "images": "weathered_base_color weathered_normal weathered_orm", "image_size": "=resolution", "image_layers": "C", "attrib": "material", "attrib_class": "prim", "on_fail": "error"}},
    "checked_cabinet": {"type": "assert", "in": ["checked_maps"], "params": {"label": "uv", "uv_overlaps": 0, "on_fail": "error"}},
    "mask_image": {"type": "tex_output", "in": ["weathered"], "params": {"image": "weathered_masks", "name": "weathered_masks", "keep_only": true}},
    "checked_masks": {"type": "assert", "in": ["mask_image"], "params": {"label": "masks", "images": "weathered_masks", "image_layers": "edge_wear cavity dust runs_rust runs_dirt fade", "image_size": "=resolution", "on_fail": "error"}}
  },
  "output": "checked_cabinet",
  "outputs": {
    "cabinet": {"node": "checked_cabinet", "label": "Weathered cabinet", "kind": "mesh", "tags": ["cabinet", "metal", "weathering"]},
    "masks": {"node": "checked_masks", "label": "Weathering masks", "kind": "textures", "tags": ["weathering", "masks", "baked"]}
  }
}
