Fenolis Posted April 10, 2015 Share Posted April 10, 2015 (edited) I have a file node with the Geometry File parameter set to /home/Houdini/bgeo/geo1_lod_$F.bgeo so that it's capable of reading .bgeo files with different levels of detail at different frames. What I would like to do is instead of having the LoD change with the frame number, I would like to have an integer parameter called "Level of Detail" or "lod" control the file selected. I understand that it is possible to add an expression in the file param that goes /home/Houdini/bgeo/geo1_lod_'ch("control/lod)'.bgeo, but in the event that I have to change the geometry (geo2_lod_0.bgeo, geo3_lod_0.bgeo) I would have to add the expression each time. I'm wondering if there's a way to replace the $F portion of the file string with the expression 'ch("control/lod)' maybe via an intermediate process (button?) so that I could change the geometry, run that process, then change the value on the "lod" parameter to select different sub-geometries. I'm open to Python/Hscript if it makes my life easier in the long run... (Lots of geometry choices to go through here) Edit: I've come across what seems like a similar question at link. Hope this leads to my solution! Edited April 10, 2015 by Fenolis Quote Link to comment Share on other sites More sharing options...
edward Posted April 11, 2015 Share Posted April 11, 2015 I don't quite I understand the problem. Are you changing the names of the files or are you changing the content of the files? If you're changing the names, then it's just a matter of augmenting your path with the appropriate expression to another parameter. Changing the value of the filenames will automatically cause it to reload. If you're changing the content without the changing the names, then you can just hit the Reload button on the File SOP (or link it to another button on your HDA). Quote Link to comment Share on other sites More sharing options...
Fenolis Posted April 13, 2015 Author Share Posted April 13, 2015 I'm trying to change the name of the files. The files are named based on a geo#, then further split into levels of detail like: geo1_lod0 geo1_lod1 geo2_lod0 geo2_lod1 What I would like is for some way to find the "lod#" portion in the file name and replace it with the expression linking it to my parameter, so that a file named geo1_lod$F would become geo1_lod'ch("control/lod)' Quote Link to comment Share on other sites More sharing options...
edward Posted April 13, 2015 Share Posted April 13, 2015 So can't you just have separate parameter like this? `ch("control/geoname")``ch("control/biglod)`_lod`ch("control/lod)` Quote Link to comment Share on other sites More sharing options...
Fenolis Posted April 14, 2015 Author Share Posted April 14, 2015 Yes, that works for most of my cases. But I suppose I did not clarify well in the last post, sorry. What I meant was, the naming convention goes: file1/geo1_v1_lod0.bgeo file1/geo1_v1_lod1.bgeo file1/geo1_v2_lod0.bgeo file1/geo1_v2_lod1.bgeo file1/geo2_v1_lod0.bgeo file1/geo2_v1_lod1.bgeo file2/geo1_lod0.bgeo file2/geo1_lod1.bgeo file2/geo2_lod0.bgeo file2/geo2_lod1.bgeo file3/geo1_v1_lod0.bgeo file3/geo1_v1_lod1.bgeo As you can see the file names are roughly similar but they are stored in different folders by design type, some don't have version numbers. The user would be able to navigate to the desired folder and choose a geometry + version type, then using a parameter control to change the "lod#" Since the file name is specified manually I cannot use expressions directly in the parameter, so I would like for a button sort of control to replace the lod# part of the file name with lod'ch("control/lod)' Is this possible? (Thanks for your time, by the way!) Quote Link to comment Share on other sites More sharing options...
edward Posted April 15, 2015 Share Posted April 15, 2015 Sure, so you have a button which has a callback script that does a python regex replacement for "lod[0-9]" with `ch("/control/lod)` ... You might also be able to do the callback script on the file parameter itself (YMMV). Quote Link to comment Share on other sites More sharing options...
Fenolis Posted April 17, 2015 Author Share Posted April 17, 2015 Yes that sounds like what I need! Do you happen to have a sample python script for that purpose? I'm new to using python for Houdini, and I don't really know how to do button callback scripts... Thanks! 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.