Hython method for listing supported file extensions
1835 7 4- NFX
- Member
- 183 posts
- Joined: Dec. 2011
- Offline
- GuillaumeJ
- Member
- 23 posts
- Joined: Sept. 2015
- Offline
If you're talking about images, they are stored in “FBfiles” file, you can fetch them using that snippet:
file_types = [] for fb in hou.findFiles("FBFiles"): with open(fb, 'r') as f: file_types += [ft.strip() for ft in f.readlines() if \ not ft.startswith("#")] print file_types
http://cgtoolbox.com/ [cgtoolbox.com] Houdini tools and scripts for free ! :)
- NFX
- Member
- 183 posts
- Joined: Dec. 2011
- Offline
GuillaumeJ
If you're talking about images, they are stored in “FBfiles” file, you can fetch them using that snippet:file_types = [] for fb in hou.findFiles("FBFiles"): with open(fb, 'r') as f: file_types += [ft.strip() for ft in f.readlines() if \ not ft.startswith("#")] print file_types
Thanks GuillaumeJ! This is definitely a step in the right direction. Now is there a similar file where I can find supported geometry file extensions?
- anon_user_92751170
- Member
- 17 posts
- Joined: May 2010
- Offline
- NFX
- Member
- 183 posts
- Joined: Dec. 2011
- Offline
- NFX
- Member
- 183 posts
- Joined: Dec. 2011
- Offline
So this works for 90% of the file types, however I noticed it doesn't include some supported formats like .obj or .ia. Would these be listed in a separate file?
I found GEOio.json which has a bunch of the other extensions as well as other related info, so for now I am extracting them from the json and adding them to the ones I got from the GEOfiles file. Not ideal, but it kinda works.
I found GEOio.json which has a bunch of the other extensions as well as other related info, so for now I am extracting them from the json and adding them to the ones I got from the GEOfiles file. Not ideal, but it kinda works.
Edited by NFX - Nov. 22, 2017 22:16:10
- GuillaumeJ
- Member
- 23 posts
- Joined: Sept. 2015
- Offline
GEOio.json would world for that yep
http://cgtoolbox.com/ [cgtoolbox.com] Houdini tools and scripts for free ! :)
- NFX
- Member
- 183 posts
- Joined: Dec. 2011
- Offline
-
- Quick Links