From this HDA documentation it mentioned that the version number of the asset should be formatted as : node_name
https://www.sidefx.com/docs/houdini17.0/hom/hou/HDADefinition.html [www.sidefx.com]
So I am assuming if I use the version()function it should returns from the name.
However this is not the case, it only return the version field in the type definition. Did I missed any internal function I can use?
Here is my helper function to fetch the version number.
def get_version(node): """ Returns the version number of HDA if found Args: node: Houdini Node Object Returns: version Number None when no version number was found """ name_split = node.type().definition().nodeTypeName().split("::") split_length = len(name_split) if split_length == 1: return None elif split_length == 2: if name_split[1].isdigit(): return float(name_split[1]) else: return None elif split_length == 3: if name_split[2].isdigit(): return float(name_split[2]) return None