Can not get HDA Section 'Contents.gz'

   408   2   1
User Avatar
Member
20 posts
Joined: Nov. 2018
Offline
Hello, guys!
I'm trying to read the content of my hda section and I'm getting this error
>>> n = hou.node('/obj/test')
>>> print(n.type().definition().sections()['Contents.gz'].contents(compressionType=hou.compressionType.Gzip))
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/opt/hfs20.0/houdini/python3.10libs/hou.py", line 55466, in contents
    return _hou.HDASection_contents(self, *args, **kwargs)
TypeError: 'compressionType' is an invalid keyword argument for HDASection_contents()
what is wrong with it?
I did it just like in the docs [www.sidefx.com]
houdini20.0.590 py3.10 gcc11
User Avatar
Member
7725 posts
Joined: July 2005
Offline
There are options when saving the HDA as to what compression is used. So if a different compression is used, the section won't be called "Contents.gz". I think it's best to first check out what sections are actually available in your HDA with print(n.type().definition().sections()).
User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
The issue here is that for whatever reason the hou.HDASection.contents() functions can't take its arg as a keyword argument, despite the docs saying so. Passing the enum directly will work

print(n.type().definition().sections()['Contents.gz'].contents(hou.compressionType.Gzip))
......

This does show up randomly on occasion and I would suggest submitting a bug to have it properly fixed.
Graham Thompson, Technical Artist @ Rockstar Games
  • Quick Links