Hiro11 0 Posted December 14, 2019 (edited) I want to print all the bgeo.sc used in the scene.Using Python. hou.fileReferences() doesn`t give me any bgeo.sc used in the scene. I am looking for a way. Can someone guide me?? Thanks Hiro Edited December 14, 2019 by Hiro11 Share this post Link to post Share on other sites
Atom 1,193 Posted December 14, 2019 I think you would have to recursively scan all nodes in the system for node types that are known to reference files. Look for the File node, and the FileCache node. Once you have those nodes, you can review their .parm value to extract the filename they reference. 1 Share this post Link to post Share on other sites
Stalkerx777 148 Posted December 16, 2019 files = filter(lambda p: p.endswith('.sc'), [n.evalParm('file') for n in hou.nodeType('Sop/file').instances()]) 3 1 Share this post Link to post Share on other sites
Hiro11 0 Posted December 19, 2019 AtomicPerception Alex Rusev Thanks for the reply.Sorry I was late to see this. This Worked perfectly!! files = filter(lambda p: p.endswith('.sc'), [n.evalParm('file') for n in hou.nodeType('Sop/file').instances()]) Thanks Hiro Share this post Link to post Share on other sites
Hiro11 0 Posted December 19, 2019 import os import hou files = filter(lambda p: p.endswith('.sc'), [n.evalParm('file') for n in hou.nodeType('Sop/file').instances()] ) text = '\n'.join(files) hipdir = os.environ["HIP"] hipname = hou.hipFile.basename() name,ext = os.path.splitext(hipname) file_path = os.path.join(hipdir,(name+'.txt')) with open(file_path, 'w') as f: f.write(text) It turn out like this.I am a beginner at python stuff,it might be not good.But,it works for now. Thanks!! Share this post Link to post Share on other sites