kursad Posted May 18, 2010 Share Posted May 18, 2010 Hi I want to be able to load all the objects in a folder one by one and process them, like sequenced object but this time without relaying on the frame number Any suggestions? thanks Quote Link to comment Share on other sites More sharing options...
pclaes Posted May 20, 2010 Share Posted May 20, 2010 As in batch processing? without even opening houdini ? What is your output supposed to be? A modified model or a rendered image or...? For the above you probably will want to use python, or I believe they call the houdini version hython. Anyway, it will be a script kicking things off. If you want to do it inside of houdini you can do quite a bit with a bit of python to scan your directory, a foreach sop for processing and a file sop inside the foreach to write it out. You could make your houdini network and use wedges to load and write different copies per frame. Depending on your needs I would be tempted to do it all in the batch in the shell. Because you can most likely run several batches at once if your machine can handle it - so you make it more thread friendly. Not sure if you can run all (or a certain number of) your wedges in parallel. Probably that must be possible, haven't tried it though. Quote Link to comment Share on other sites More sharing options...
kursad Posted May 20, 2010 Author Share Posted May 20, 2010 (edited) pclaes, I was thinking that I would do more like batch processing. The output will be processed geometry. Instead of loading all the objects in a folder in a scene and copy the processing nodes many times, I thought that it would be smarter to create one processing scene that can be applied to many. The only thing is that the file names might be irrelevant or non sequential. I know Python, so I am sure I can do that. I was just looking for an embedded solution if there was such thing, before delving into scripting solution. thanks for the tips. Edited May 20, 2010 by kursad Quote Link to comment Share on other sites More sharing options...
mightcouldb1 Posted May 20, 2010 Share Posted May 20, 2010 Hmm... Is this what you are looking for? loadGeoFeedback.hip Quote Link to comment Share on other sites More sharing options...
kursad Posted May 21, 2010 Author Share Posted May 21, 2010 Hmm... Is this what you are looking for? Hi Thanks for the file. Your setup assumes that the file names are incremental or sequential. What I am trying to do is to process any file that has a legitimate extension with arbitrary names in a given folder. So I do not want to describe any file name, rather just point out to a directory. Files can have any names , mixed extensions etc, which might be coming from various sources. So in that respect trying to come up with a file naming rule wont work. I will try scripting it out as pclaes suggested. Python offers decent OS file access. Quote Link to comment Share on other sites More sharing options...
pclaes Posted May 21, 2010 Share Posted May 21, 2010 (edited) You can probably write your own python sop that will: *) ask for a directory *) allows a few filters to be applied (extension, contains word,...) *) scans that directory *) Gives you back the total amount of files to be processed (in a locked integer field) *) Gives you a slider (integer number), that allows you to show the current file that needs to be loaded. *) That way you give a user in houdini access with an easy python sop to load the geometry, and you make it a lot easier on yourself if you ever wanted to batch process it. I believe there is even a $WEDGE or $WEDGENUM variable that is being used when you do wedges. Very similar to what the arg() would do: argc(bob,ted,john,tim,$WEDGE) -> returns john (if $WEDGE=2) Now you can use a wedge and modify that "current number". But yes, the filtering will have to be done in python. I'm not so sure how much filtering you get out of the box with python, but I know there are modules to allow for regular expressions... and that gives you access to any rule you want. I would allow users to choose between using some filters, or to put in their own custom regular expressions rule - then you have all bases covered. If you have not seen it already, this is really interesting of how to use houdini as a "tool" for python, rather than use python as a tool for houdini: http://www.sidefx.com/index.php?option=com_content&task=view&id=1412&Itemid=132 Edited May 21, 2010 by pclaes Quote Link to comment Share on other sites More sharing options...
kursad Posted May 22, 2010 Author Share Posted May 22, 2010 pclaes Thanks for the points. I did not know about the wedge tools. I am reading about it. I have watched the Python master class, so I am aware of possibilities. As I mentioned I do not suck at Python, I am hopeful that I can crack this nut. Maybe I can release as digital asset when I have a real solution. 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.