Skip to content

Instantly share code, notes, and snippets.

@morphingdesign
Created February 10, 2021 05:19

Revisions

  1. morphingdesign created this gist Feb 10, 2021.
    7 changes: 7 additions & 0 deletions hou_trailingNumFromNodeName.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # Extract consecutive trailing numerical digits from a node's name.
    import hou
    return pwd().digitsInName()

    # For example, a node named 'NEW_GEO_101' will return the int 101
    # into the field. Returns 0 if name does not include any trailing
    # numerical digits.