Shading
Author: Vincenzo Mossuto Creation Date: 30/09/2025
Reviewer: Sara Altomare/Rossana Mazza
What it is
This document describes all the scripts in the Shading section included in the Spaarkly Scripts add-on for Blender:
- Check Material Tool
- HEX Color Categorizer
These tools are designed to support the shading phase by validating material setups and standardizing color categories.
They ensure that materials are named correctly, consistent with the asset’s version (RC or CUT), and that colors are classified into predefined categories for predictable rendering and export.
See the Shading section for detailed guidelines and best practices.
Check Material for Export
What it does
This operator verifies all the materials assigned to the selected objects.
It checks that object tags (_RC for Retopo Component or _CUT for VTO) are consistent across the selection, and validates that materials follow the correct naming conventions.
For VTO objects, it also ensures that the Sheen Weight of Principled BSDF shaders is set to 0, preventing unwanted visual artifacts in virtual try-on rendering.
Prerequisites
- At least one object must be selected in the 3D Viewport.
- The active object must have a valid tag in its name:
_RC(retopo) or_CUT(VTO).
Steps
- Select one or more objects in the scene.
- Ensure the active object name ends with
_RCor_CUT. - Run Check Material for Export from the Shading panel.
- The operator will:
- Validate tag consistency across the selected objects.
- Check each material slot for proper naming.
- For
_CUTobjects, ensure Sheen Weight = 0 in Principled BSDF nodes.
Troubleshooting
- No active object → The operator cancels with an error message. Make sure one object is active.
- Invalid tag → If the active object name does not contain
_RCor_CUT, the operator stops and reports the issue. - Tag mismatch → If other selected objects don’t share the same tag as the active one, an error is reported.
- Sheen Weight not zero → For
_CUTobjects, materials with non-zero sheen values are flagged.
Get color category
What it does
This operator converts an input HEX color code into a normalized color category (e.g., red, green, blue, grey, white, etc.).
It is used to classify colors consistently across materials, ensuring a predictable categorization that can be reused during rendering and export workflows.
Prerequisites
- A valid HEX color value (e.g.,
#FF5733) must be entered in the dedicated input field in the Shading panel.
Steps
- Enter a HEX color code in the HEX Color Categorizer field.
- Run Get Color Category.
- The operator will:
- Convert the HEX code to RGB values.
- Convert RGB to HSV color space.
- Assign a category based on predefined hue, saturation, and value thresholds.
- The resulting category is displayed in the Blender Info Bar.
Troubleshooting
- Empty field → If no HEX code is provided, the operator fails.
- Invalid HEX code → If the input cannot be parsed, an error message is shown (
Error during the HEX conversion). - Uncategorized → If the HSV values do not fall into a predefined range, the operator assigns
uncategorized.