Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Blacklisted_Guy

  • Rank

Personal Information

  • Name Jonne

Recent Profile Visitors

435 profile views
  1. kernel void kernelName( int P_length, global float * P ) { int idx = get_global_id(0); if (idx >= P_length) return; } This is the code I'm running. As of now it's just the generated kernel.
  2. Hello there, I've been trying to learn openCL and use it in houdini. To start I imported the position attribute and generated a kernel, but it keeps spitting out this error (without editing or adding things to the code) OpenCL Exception: clSetKernelArg (-51)
  3. Ah, too bad. Python it is then.
  4. Hello there! For a current project I'm needing to read files from disk and apply operations per line. I know python offers a way to read files. But since vex can be multi-threaded I wanted to see if there is a way to do it. Looking through some forums I found functions from houdini 14 that allowed for reading files, but these don't seem to be working anymore. Thank you for a reply, Jonne
  5. thank you for the link, I'll be looking through it!
  6. yes, the distanceToPoint function returns a vector with the 2D distance between the points and a 3D distance. So, what you'd suggest is running the script with a for loop in detail mode instead of in point mode? I'll try that one! Thank you for the advice!
  7. Hello houdini wizards, I've been trying to make a script that makes a curve out of a bunch of points by finding the closest point. For some reason though, the points don't connect to their closest point File with the script in action as well as the script down below. //-----------------------------------------// // Find closest point V1 // // By Jonne Geven // //-----------------------------------------// //imported functions //returns: [0] = 2D distance. [1] = 3D distance vector2 distanceToPoint(int currentPoint; int targetPoint; int currentPointInput; int targetPointInput) { //importing user inputs int cp = currentPoint; int cpi = currentPointInput; int tp = targetPoint; int tpi = targetPointInput; //extracting point position vector cpp = point(cpi, "P", cp); vector tpp = point(tpi, "P", tp); //deltas float dx = tpp[0] - cpp[0]; float dy = tpp[1] - cpp[1]; float dz = tpp[2] - cpp[2]; //2d distance float DD2; DD2 = sqrt((dx * dx) + (dz * dz)); //3d distance float DD3; DD3 = sqrt((DD2 * DD2) + (dy * dy)); vector2 distances = set(DD2, DD3); return distances; } //closest point int closePoint(int currentPoint;int currentPointInput; int targetPointInput) { int tpc = npoints(targetPointInput); //this used to be user defined but that doesnt work since it needs to be the amount of points int cp = currentPoint; int cpi = currentPointInput; int tpi = targetPointInput; float C; float CP; int returnValue; for(int i = 0; i < tpc; i++) { //distance between points C = distanceToPoint(cp, i, cpi, tpi)[0]; //importing Z values vector zvalT = point(tpi, "P", i); vector zvalC = point(cpi, "P", cp); if(zvalT[2] < zvalC[2]) //comparing the target and current z position to make sure { //the curve has a direction //max search distance and making sure the processed point isn't selected. if(abs(C) < 19 && C != 0) { if(i != 0) { //comparing current distance to currently smallest distance if(C < CP) { CP = C; returnValue = i; } } //initializing CP value with first distance else if(i == 0) { CP = C; returnValue = 0; } } } } return returnValue; } //finding closestpoint i@target = closePoint(@ptnum, 0, 0); //This script is made with the general direction being -Z //vector pp0 = point(geoself(), "P", @ptnum); //vector pp1 = point(geoself(), "P", target); int line = addprim(0, "polyline"); addvertex(0, line, @ptnum); addvertex(0, line, @target); //-----------------------------------------// // For questions // // odforce: Blacklisted_Guy // //-----------------------------------------// closestPointNotFound.hiplc
  8. Hey there fellow scripters, I've run into an issue with the len function not returning the size but an error. For some reason it's expecting an identifier whilst I did input the right variables theProblem.hipnc
  9. Hello everyone, I'm fairly new to vex and am currently working on adding normals to certain points. For this I'm using this script in a point wrangle node. int count = neighbourcount(0, @ptnum); float xpos = @P.x; if (count == 1){ setpointgroup(geoself(), "borderGroup", @ptnum, 1, "set"); if (xpos > 0){ addattrib(geoself(), "point", "N", {-1,0,0}); } if (xpos < 0){ addattrib(geoself(), "point", "N", {1,0,0}); } } But, for some reason unless the X value is 10 or -10 it always chooses the xn = 1. Not sure why. (The "xpos < 0" used to be an "else" but I changed it to check it it would work). A big thank you in advance!
  10. that worked! Thank you so much
  11. I started working on some vex practice and decided to use it for a switch and a bunch of statements I've wrote this script but the second if statement (rot =1 && flip = 0) doesn't seem to be giving the right value. int rotatetion= ch("rot"); int flipvalue= ch("flip"); @switch = 0; if ( (rotatetion == 0) && (flipvalue == 0)) { @switch = 1; } if ( (rotatetion == 1) && (flipvalue == 0)) { @switch = 1; } if ( (rotatetion == 0) && (flipvalue == 1)) { @switch = 0; } if ( (rotatetion == 1) && (flipvalue = 1)) { @switch = 0; } rot and flip are integer sliders on the attribute wrangle node itself.
  12. That worked! Thank you so much!
  13. Here's the file I'm currently working on ptwrangleTest.hipnc
  14. It did create the attribute. For some reason the value remains 0 though
  15. So I recently started using vex and I needed to add an attribute. I tried using this: int count= neighbourcount("0", @ptnum); setpointattrib(0, "ncount", @ptnum, count); I added an attribute called "ncount" in a attribute create before hand. another thing I tried was this: int count= neighbourcount("0", @ptnum); addattrib(geoself(), point, "ncount", count); didn't work either. Anyone know what the problem could be?