Can Houdini convert suffix numbers to letters?

   1542   2   1
User Avatar
Member
21 posts
Joined: Nov. 2019
Offline
While saving out a bunch of file variations using PDG, I am using `@wedgeindex` to add a numerical suffix onto my file names. I would prefer to use a letter (mesh_A, mesh_B etc) is there any way to do this in Houdini?

Cheers

Dave
User Avatar
Member
1853 posts
Joined: May 2006
Offline
I'm sure there's a tidier way, but you can use python to convert numbers to chars. chr(65) will return A, chr(66) B etc.

This is a python expression in an attribute create:

num = pdg.workItem().intAttribValue('wedgeindex')
name = pdg.workItem().stringAttribValue('name')
return name+'_'+chr(num+65)

Attachments:
tops_wedgeindex_to_str.hip (122.8 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
21 posts
Joined: Nov. 2019
Offline
This is great thank you! I will try it out.
Thanks for your time

Dave
  • Quick Links