mohamaedkamal Posted July 18, 2018 Share Posted July 18, 2018 hi everyone , I want to open seqence of cache bgeo files using mplay , anyone can find the way of doing this using houdini and python Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted July 18, 2018 Share Posted July 18, 2018 import subprocess subprocess.Popen(['gplay', '/path/to/your/geometry.$F4.bgeo']) gplay must be in PATH, otherwise, specify a full path to it ($HFS/bin/gplay) 1 Quote Link to comment Share on other sites More sharing options...
mohamaedkamal Posted July 18, 2018 Author Share Posted July 18, 2018 3 hours ago, Stalkerx777 said: import subprocess subprocess.Popen(['gplay', '/path/to/your/geometry.$F4.bgeo']) gplay must be in PATH, otherwise, specify a full path to it ($HFS/bin/gplay) thank u Quote Link to comment Share on other sites More sharing options...
danielsweeney Posted November 26, 2020 Share Posted November 26, 2020 hi guys, is there any reason why this would not be working. i could have scripted it wrong. I'm in hou 18. I cant seem to get it to work with $F4 in the file path. throws an error. can get it to work with single files. anyone got any ideas? Quote Link to comment Share on other sites More sharing options...
bunker Posted November 26, 2020 Share Posted November 26, 2020 $F4 is probably getting evaluated and will return a single frame number try replacing $F4 with * Quote Link to comment Share on other sites More sharing options...
danielsweeney Posted November 26, 2020 Share Posted November 26, 2020 Hi Bunker, thanks for the help. Nope, I am afraid that didn't seem to work. my evaluated end of the string looked like this when I replace $F4. /geometry/moreframes/box.*.bgeo Googling this I can't seem to find any info on this problem. when picking files manually I noticed it had the frame range in () at the end of the string. like (1-240) but i tried this also adding to the end of the string. but it didnt work. unless it needs to be in a tuple or something. cheers Daniel Quote Link to comment Share on other sites More sharing options...
bunker Posted November 27, 2020 Share Posted November 27, 2020 import subprocess command='gplay /tmp/tmp.*.bgeo.sc' subprocess.Popen(command,shell=True) This works for me. You'll need the full path on disk, not relative. Quote Link to comment Share on other sites More sharing options...
danielsweeney Posted November 27, 2020 Share Posted November 27, 2020 Hi Again Bunker, thanks so much for your help. im still clutching at straws here. the function I'm building is basically being run off a right-click menu in a QT widget window. Don't know if that makes a difference. this is the last part of my function for testing purposes. filePath = filePath.replace("$F4", "*") command = 'gplay ' + filePath subprocess.Popen(command,shell=True) this is the whats my command variable prints like gplay C:\Users\Daniel\Documents\NodeShare\Geometry\moreframes\box.*.bgeo and it's still throwing an error. and yeah I am importing subprocess its at the top of my function. just get this error. hou 18 - python 2.7 cheers Daniel Quote Link to comment Share on other sites More sharing options...
malexander Posted November 27, 2020 Share Posted November 27, 2020 gplay doesn't accept wildcards in a filename. At a command line, "gplay *.bgeo" works because the shell is expanding *.bgeo to a list of valid filenames. You'll need to to the same. Quote Link to comment Share on other sites More sharing options...
danielsweeney Posted November 28, 2020 Share Posted November 28, 2020 thanks for the heads up malexander. after a bit of tinkering, I did finally get it to work.... few things to look out for. in your list of file paths firstly you have to make sure each string for the file path has a space before. then I ran into the problem where it would not open file paths that had a white space in the whole path. so after a bit of reading, I think because it's a shell operation? I have to have the string encapsulated in " " . (please correct me if I am wrong on this) so a simplified version below import subprocess fileSequenceList = [' "tmp/tmp/box.001.bgeo"', ' "tmp/tmp/box.002.bgeo"', ' "tmp/tmp/box.003.bgeo"'] subprocess.Popen(['gplay', fileSequenceList]) if I run into any other hurdles. il post them up. cheers Daniel Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.