Presets in OTLs

   9865   9   3
User Avatar
Member
132 posts
Joined: July 2005
Offline
The quest for the perfect OTL continues…

I have an OTL I'm building now for weather effects. I'd like it to be able to support light rain, snow, hail, heavy rain, etc. I have all the controls in my OTL to make my setup achieve all these different effects. I want to be able to pass this along to a user who can select from a list of preset parameters and have all the parameters in my OTL update accordingly. I could setup a huge network under the hood and then “switch” between different effects, but I'd much rather be able to do it through preset parameters in my OTL controls to make things simpler. Any ideas?
User Avatar
Member
7868 posts
Joined: July 2005
Offline
Other than using the regular preset facility which requires them to be put in the appropriate place outside of your OTL, you could make a bunch of buttons on the OTL itself. For each buttons callback script, put in an opparm line that was generated via opscript.
User Avatar
Staff
4517 posts
Joined: July 2005
Offline
Just to expand on the regular presets facility… If you create a bunch of presets for your digital asset, you'll end up with a file called $HH/presets/Object/myasset.idx, or something similar. This is the file that contains all the preset definitions you have saved. Find this file and remember where it is. Now open the Operator Type Manager and find the definition of your asset. Right-click on it and choose “Edit Contents…”. On the left is a list of “sections” that make up your digital asset definition. Below that list is a spot to enter the name of a file. Use the Plus button to open up a file browser and find the .idx file containing your presets. The “Section Name” will be set to the name of the .idx file. Change the Section Name to “Presets”. Hit the Add File button. Hit Accept. Now those presets are stored with the digital asset.

This ability to store presets directly in a digital asset definition isn't well advertised because it is far from being an automatic process. Updating that Presets section requires saving it out to the .idx file, adding or editing the presets in that external file, then re-adding the .idx file using the Edit Contents dialog. It's not pretty, but it can be a very useful feature.

Mark
User Avatar
Member
29 posts
Joined: Oct. 2015
Offline
Apologies for digging out this really old thread, but I've been trying to do exactly this:
mtucker
or editing the presets in that external file

What is the best way to do that? I've only managed to do it with a hex editor, but that allows me to only swap bites - if I want to change a value that is one bite say 0 to something with more bites, for example 0.5, then it stops working.

Is there a more sane way to deal with presets?
Edited by Lyubomir Popov - July 15, 2018 10:04:28
User Avatar
Member
4672 posts
Joined: Feb. 2012
Offline
If you wanna bundle your presets with your OTL, just rename the idx file to Presets and then add this file in the Extra Files tab of the Edit Type Properties dialog of the OTL. It should be called “Presets” without the extension.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
29 posts
Joined: Oct. 2015
Offline
Thanks animatrix3d, embedding presets in an asset works fine, no issues there. But let's say I accidentally recorded a transform along the Z axis into a preset (Regardless of whether that preset is in the $HIP/presets folder, or added as an extra file to the hda).

What is the recommended way to edit individual values inside the Presets.idx file? In other words, If I want to change the translate vector in Presets.idx, which looks like so:
t	[ 0	locks=0 ]	(	0	0	-0.07	)

In simple .idx files, changing -0.07 to say -0.075 works fine. But in a larger preset file, changing the number of bytes per value corrupts the file and houdini doesn't recognise it. I'll try to narrow it down and upload an example that shows how an idx file that is failing as described.

Either way, I'm curious how do other people edit existing presets? Text editor / hex editor, or is there a better way to do it through the houdini interface.
Edited by Lyubomir Popov - July 15, 2018 14:36:44
User Avatar
Member
16 posts
Joined: April 2015
Offline
Lyubomir Popov
In simple .idx files, changing -0.07 to say -0.075 works fine. But in a larger preset file, changing the number of bytes per value corrupts the file and houdini doesn't recognise it. I'll try to narrow it down and upload an example that shows how an idx file that is failing as described.

Did you ever find a solution? Run into this now while trying to batch change parameter expressions over multiple idx files, presets are proving to not be as manageable as they could be.
User Avatar
Member
8026 posts
Joined: Sept. 2011
Offline
Nah, you don't edit them directly. Load the preset onto the applicable Node in Houdini, make the change, and save it again. I'm sure this process could be automated, if you really have dozens of presets that need ‘find and replace’ sort of changes.
User Avatar
Member
7046 posts
Joined: July 2005
Offline
You can use the “hidx” command-line tool to expand them, which makes them a little more editable. However, if they have binary in them because you edited the UI or something, then you're still SOL unfortunately.
Cheers,

Peter Bowmar
____________
Houdini 20.5.262 Win 10 Py 3.11
User Avatar
Member
7046 posts
Joined: July 2005
Offline
btw I find it amusing that this 16 year old thread was useful to me today, since I couldn't remember how to embed presets in HDAs. Shame that doesn't have a UI yet as it continues to be very needed.
Cheers,

Peter Bowmar
____________
Houdini 20.5.262 Win 10 Py 3.11
  • Quick Links