Skip to content

Instantly share code, notes, and snippets.

@morphingdesign
Created May 14, 2021 01:37
Show Gist options
  • Save morphingdesign/845c3ce798428b1bc6bd7e4d10817d40 to your computer and use it in GitHub Desktop.
Save morphingdesign/845c3ce798428b1bc6bd7e4d10817d40 to your computer and use it in GitHub Desktop.
Rename fracture piece @name attribute with padded numbering in Houdini VEX.
// Fractured pieces are generated with @name such as 'piece0', 'piece1', etc.
// The following prim wrangle renames each piece with a padded number.
// String var to hold padded piece number.
string new_name = sprintf("piece_%04d", opdigits(@name));
// Update piece name.
s@name = new_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment