import hou; def set_opencl(parent_node, parm_value): for node in parent_node.allSubChildren(): for p in node.parms(): if p.name()=='opencl': try: p.set(parm_value) except hou.PermissionError: #this handles the case that the parm is inside of a locked .otl pass hou.session.set_opencl(hou.node('/obj/dopnet1'), 1);
But get the following error message. have googled but no solution so far. Can any Python experts help?
The attempted operation failed.
Traceback (most recent call last):
File “hou.session”, line 10, in <module>
File “hou.session”, line 2, in set_opencl
AttributeError: ‘NoneType’ object has no attribute ‘allSubChildren’