Skip to content

Instantly share code, notes, and snippets.

@gfxhacks
Created June 19, 2020 16:47
Show Gist options
  • Save gfxhacks/c5d9b29306d57ce79cc25c45e7cad792 to your computer and use it in GitHub Desktop.
Save gfxhacks/c5d9b29306d57ce79cc25c45e7cad792 to your computer and use it in GitHub Desktop.
Folder commands for Parameter creation in Houdini: https://gfxhacks.com/create-parameters-in-houdini-with-python#creating-folders
# define new folder
f = hou.FolderParmTemplate("myFolder", "My Folder")
# define new simple folder (no tab)
f = hou.FolderParmTemplate("myFolder", "My Folder", folder_type=hou.folderType.Simple)
# add parameter at bottom of folder
f.addParmTemplate(p)
# remove item from folder (same as for group)
g.remove("id")
# create folder with multiple parameters at once
f = hou.FolderParmTemplate(
"folder1",
"Folder 1",
folder_type=hou.folderType.Simple,
parm_templates=[
hou.FloatParmTemplate("parm1", "Parameter 1", 1),
hou.FloatParmTemplate("parm1", "Parameter 1", 1)
]
)
g.append(f)
# create multiple folders at once
f = [
hou.FolderParmTemplate(
"folder1",
"Folder 1",
folder_type=hou.folderType.Simple,
parm_templates=[
hou.FloatParmTemplate("parm4", "Parameter 4", 1),
hou.FloatParmTemplate("parm5", "Parameter 5", 1)
]
),
hou.FolderParmTemplate(
"folder2",
"Folder 2",
folder_type=hou.folderType.Collapsible,
parm_templates=[
hou.FloatParmTemplate("parm6", "Parameter 6", 1),
hou.FloatParmTemplate("parm7", "Parameter 7", 1)
]
)
]
for i in f:
g.append(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment