Function does not work on Multiparm

   1017   1   0
User Avatar
Member
131 posts
Joined: 8月 2012
Offline
There is a function in hou.Parm [www.sidefx.com] called containingFolders() that is meant to return "a tuple of strings corresponding to the names of the folders containing this parameter."

However, if the parameter is inside a multiparm block, the result is an empty string.

Here's how I've set it up:
Type Properties > Create Multiparm Folder (give it a name like mpFolder) > Create a Button in that folder

Go to the Scripts tab, Create a Python Module and paste the following:

def Func(kwargs):
    parm = kwargs["parm"]
    print parm.containingFolders()
    print hou.Parm.containingFolders(parm)

Go back to the Button you created, callback script: kwargs.hm().Func(kwargs)

I'd expect clicking the button would return something like ('mpFolder'), since that's the folder that the button resides in, but it just gives () instead.

Is this a bug or am I doing it wrong?
Edited by Jikian - 2021年7月30日 01:30:32
User Avatar
Member
131 posts
Joined: 8月 2012
Offline
I did it wrong, the correct class to use is ParmTuple [www.sidefx.com]. Call parentMultiParm().name() to get the parent multiparm folder's name of a multiparm instance.
  • Quick Links