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 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 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)“`