@dchow @CoskuTurhan “`Hello Jake, There are two phases to cooking a DOP frame: the network pass and the solve pass. Former takes care of setting parameters and building the sequence of operators that are to act on the objects; the solve pass then actually invokes these operators. The issue is that substepping triggered by the Gas Substep solver is done as part of the solve pass, while the Switch Solver gets its switch value set during the network pass. To perform its solve, Gas Substep DOP basically determines how many substeps to take and calls its sequence of input operators that number of times. So when the Switch Solver is reached, it uses the switch value that was evaluated at the network pass. In other words, the value of that parameter does not get refreshed for each of your substeps.
You can get the behaviour you want by disabling Override with Default and using the data specified in Switch Value Name. This data will have to be modified to account for your frame number logic, which can be done fairly easily with a Script Solver. Note that this works because the parameter value is static (name of the data to use), but the actual data stored gets evaluated every time the node goes to perform its solve. “`
Category: hou-programming
Archived post by Reinhold
looks like vtx0 is {0, 0, 0}, vtx1 is {1, 0, 0}, vtx2 is {0, 1, 0} and vtx3 is {0, 0, 1}. and any point in between is just a linear interpolation of these four values. shouldn’t take too long to get there now
got it working now. building a matrix from the tet vertex positions and running an inverse transform on the point position puts the sample point into the normalized barycentric space, i.e. the new point position is the barycentric coordinate
“` int prims[]; vector p = v@P; vector vtxp[];
prims = primfind(1, v@P, v@P);
foreach(int prim; prims) { for(int i=0; i<4; i++) { vtxp[i] = vector(point(1, "P", primpoint(1, prim, i))); } matrix3 mat = set(vtxp[1] - vtxp[0], vtxp[2] - vtxp[0], vtxp[3] - vtxp[0]);
p -= vtxp[0]; p *= invert(mat); }
v@uv = p;“`
Archived post by berniebernie
https://i.imgur.com/kuc1PnO.mp4
I don’t know where to put this but i made a little screenshot to network view python script – more details and crappy code on my wiki: berniebernie.fr/wiki/Houdini_Python#screenshot_to_background_image
Archived post by Remi Pierre
“`node.copyItems(items, channel_reference_originals = False, relative_references = True, connect_outputs_to_multi_inputs = True)“`
this can do what you’re looking for without doing sketchy with rawValues 😃
Archived post by rbowden
No worries. I never got an answer in here before and honestly glad Im not the only one running into the issue.
FWIW I also emailed SideFX about this also and got this response:
Hello Ryan,
If you want to use the white selection arrow button, you’ll need to replace the script in the script_action tag. These scripts tend to be highly context dependent, and I’m guessing that the current tag was just copied by dragging a group field with the white selection arrow button into the Edit Parameter Interface. The main function being called, soputils.selectGroupParm(), takes a dictionary of arguments to control how it operates. Since I don’t think it’s possible to edit multi-line scripts in the Tags list UI, the easiest way is to just set your script_action tag “kwargs[‘node’].hdaModule().scriptFunction()” and then define this scriptFunction() in your HDAs PythonModule.
You can take a look at the source for soputils.selectGroupParm() in $HFS/houdini/python2.7libs/soputils.py for things that function tries to do and the arguments it expects. You can set kwargs[‘nodepath’] to the path of the node from which you want to select, or set kwargs[‘node’] to point to a node from whose input you want to select and kwargs[‘inputindex’] to specify which index.
Archived post by CoskuTurhan
github.com/kiryha/Houdini/wiki/python-for-artists
this is a good place to start
Archived post by Andrew Paules
Today I learned: www.sidefx.com/docs/houdini/hom/hou/Attrib.html#setOption
attrib.setOption(‘attribute:exportname’, ‘some.text.huzzah’)
You can set an arbitrary exportname attribute option on any attribute and the alembic exporter plugin will rename the attribute that upon export. Including characters that aren’t allowed in attribute names inside of houdini. Hot damn.
Archived post by Matt Puchala
@NickTaylor @jake rice 😮 Here are my 10 easy steps to get HDK (h17) compiling on windows 10! Before we start let me just says its 1 step on linux and mac… Also if anyone knows a better way please tell me… Anyway…. Step 1. Download Cgwin64 (bash for windows) you will need this to compile with hcustom. Step 2. h17 is compiled using VC v141. (It actually tells right in the name of the Houdini download .exe) so you will need to download visual studios and visual studios installer 2017 and download the C++ components. Step 3. Check that you actually have the files at the directory path “C:Program Files (x86)Microsoft Visual Studio2017CommunityVC” Step 3: Launch a Cgwin64 shell. Step 4. cd into your Houdini installation directory. (your build might be a different version) cd “C:Program FilesSide Effects SoftwareHoudini 17.0.352” Step 5. Source the Houdini environment. source houdini_setup Step 6. Create a MSVCDir env variable so Houdini knows where to look for the C++ components. (Your exact version may be different so make sure you check in the ”MSVC” directory) export MSVCDir=”C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.16.27023” Step 7. cd into the directory your code is in. Step 8. After like 8 hour of fiddling, and if you haven’t lost the will to live, finally compile your code! hcustom.exe file.h file.cpp Step 9. Move your plugin from the Cgwin64 environment to your regular windows environment. cp “C:/cygwin64/home/USERNAME~1/houdini17.0/dsomyPlugin.dll” “C:UsersUSERNAMEDocumentshoudini17.0dso” Step 10. Launch Houdini normally and use your plug-in!
Archived post by Antidistinctlyminty
@mestela You can get hou in a regular Python shell
On windows you have to set the `HFS` environment variable
I have a script that I run via an `import`
“`python ”’Set up the environment so that “import hou” works.”’ import sys, os
# Importing hou will load in Houdini’s libraries and initialize Houdini. # In turn, Houdini will load any HDK extensions written in C++. These # extensions need to link against Houdini’s libraries, so we need to # make sure that the symbols from Houdini’s libraries are visible to # other libraries that Houdini loads. So, we adjust Python’s dlopen # flags before importing hou.
# This needs to be set previous to calling the script hfs = os.environ[‘hfs’]
if hasattr(sys, “setdlopenflags”): old_dlopen_flags = sys.getdlopenflags() import DLFCN sys.setdlopenflags(old_dlopen_flags | DLFCN.RTLD_GLOBAL)
try: import hou except ImportError: # Add $HFS/houdini/python2.7libs to sys.path so Python can find the # hou module. os.environ[‘path’] = ‘{};{}\bin’.format(os.environ[‘path’], hfs) sys.path.append(os.path.join(hfs, ‘houdini’, ‘python2.7libs’)) import hou finally: if hasattr(sys, “setdlopenflags”): sys.setdlopenflags(old_dlopen_flags)“`
Archived post by jake rice
Everything I post is a god damn gem