Skip to content

Lightgroup Settings

David Thomas edited this page Jul 23, 2026 · 13 revisions

Lightgroup Regex

The lightgroup regex setting controls what AOV names are assigned as lights and thus to the lightgroup rebuild.

Editing the lightgroup regex requires an understanding of regular expressions, it should be considered an advanced setting and this window is greyed out by default. The default lightgroup regex has a 'catch all' intention and due to the multitude of possible string combinations in AOV naming, although this regex is generally convenient to assign lightgroup AOVs automatically users must always check the 'AOVs Read' column in AOV Management to check lightgroup AOVs have been assigned under the 'LIGHTS READ' list and material AOVs have been listed in the 'MATERIALS READ' list.

At a high level, it enforces three main rules:

  1. It must contain a word related to "light" or "hdr".
  2. It must not contain the word "filter". This rule was introduced when I started testing with v-ray renders which use "filter" AOVs for advanced rebuilding such as albedo grading. The "lt" in "filter" otherwise assigns "filter" AOVs to the lightgroup rebuild so this rule excludes "filter" while allowing for the light abbreviation "lt".
  3. It must be formatted using only alphanumeric characters separated by single or double underscores (_ or __).

Breakdown:

1. Anchors and Flags

  • ^: Asserts the start of the string.
  • $: Asserts the end of the string.
  • re.IGNORECASE: (Although hidden in the panel) this is a Python flag passed to the regex engine making the entire pattern case-insensitive. Because of this, [a-z] will match uppercase letters too, and "LIGHT" will trigger the same match as "light".

2. The Negative Lookahead: "No Filters Allowed"

`` (?!.*filter) ` `

  • (?!): This is a negative lookahead. It looks ahead from the current position (the start of the string) to ensure a pattern does not exist.
  • .*filter: It checks if any character (.*) followed by the word "filter" exists anywhere in the string. If "filter" is found, the entire match fails immediately.

3. The Positive Lookahead: "Must Be a Light"

`` (?=.*(?:light|lghts?|lgh|lg|lts?|hdri?)) ` `

  • (?=): This is a positive lookahead. It ensures that a specific pattern does exist somewhere ahead in the string.
  • .*: Matches any characters leading up to the target word.
  • (?:...): A non-capturing group. It groups the terms together for the | (OR) operator without saving the matched text into memory.
  • light|lghts?|lgh|lg|lts?|hdri?: The string must contain at least one of these exact variations:
  • light: Exactly "light".
  • lghts?: "lght" or "lghts" (the s? makes the 's' optional).
  • lgh: Exactly "lgh".
  • lg: Exactly "lg".
  • lts?: "lt" or "lts".
  • hdri?: "hdr" or "hdri".

4. The Main Pattern: Structure & Formatting

`` [a-z0-9]+(?:__?[a-z0-9]+)* ` ` After the lookaheads verify the content, the regex engine actually consumes the text to ensure it follows this specific structure:

  • [a-z0-9]+: The string must start with one or more alphanumeric characters.
  • (?: ... )*: A non-capturing group that repeats zero or more times (*).
  • __?: Matches exactly one or two underscores (_ or __).
  • [a-z0-9]+: Matches one or more alphanumeric characters after the underscore(s).

Examples

✅ Matches:

  • main_light_01 (Contains "light", valid format)
  • Key__Lghts (Contains "lghts", double underscore is valid, case-insensitive)
  • env_hdri_v2 (Contains "hdri", valid format)
  • lg (Contains "lg", valid format)

❌ Fails:

  • main_light_filter (Fails: Contains the forbidden word "filter")
  • character_base_01 (Fails: Does not contain any of the required "light" or "hdr" abbreviations)
  • main_light_ (Fails: Cannot end with an underscore, [a-z0-9]+ is required at the end)
  • main___light (Fails: Three underscores are not allowed, only one or two __?)

For more information about regex or to test strings visit..

(https://regex101.com)

Edit Regex

Off by default. This can be checked on if you wish to edit Lightgroup Regex

Ignore case for regex

On by default. This setting controls the hidden python command re.IGNORECASE. If checked off only lower case letters are valid in Lightgroup Regex.

Clone this wiki locally