Jump to content

Alain2131

Members
  • Content count

    81
  • Donations

    0.00 CAD 
  • Joined

  • Last visited

Community Reputation

12 Good

About Alain2131

  • Rank
    Peon

Personal Information

  • Name
    Alain
  • Location
    Quebec

Recent Profile Visitors

791 profile views
  1. nearpoint() loop/exclude group.

    Hello Martin ! As you noticed, there is a ptgroup argument to the nearpoint function. If we read the description, this part is very interesting.. "[...] Can be a SOP-style group pattern such as 0-10 or @Cd.x>0.5. [...]" What that means is that you can do some nice inclusion/exclusion based on not only point groups per se, but even attributes on your geometry ! This odForce thread talks about this. So in your case, what you want is to find the nearest point that does not have the same id value as the current one. This might be a bit confusing, but this is the logic I went through while investigating this. So, keeping in mind that the ptgroup should be a string (check the doc), something like "@id != @id" should do it ?.. But this doesn't work. For what I understand is that since this is SOP-style statement, it works a bit different than in VEX, and doesn't have direct access to the attribute value of the current point. So instead of trying to get the current id value in the statement, we should get it "outside". Since this is a string, we can use the sprintf function to "insert" the id value into it. And thus, "sprintf("@id != %d", i@id)". I don't know if I'm making any sense, so here's a gif of my solution I run for a single point for example sake, coloring the source green and the found point red. Hope that helps ! nearpointWithGroup.hipnc
  2. Python du vex string manipulation

    Bonjour David, A quick Google Search gives this as the first result → find This gives the first occurrence instead of the last one. To find the last one, I would invert the string temporarily. Although it looks like you are trying to split a path to get the name of the file (or the last folder) There is the splitpath function that does just that. Hope that helps !
  3. evaluating display flag in OBJ level

    Hi avak ! I suggest you to look at the documentation page for the ObjNode If you search for "display" in the page, you'll see that indeed, "getDisplayFlag" doesn't exist Instead, it is called isDisplayFlagSet Hope that helps !
  4. Animating Vellum stopped attribute trouble

    Hi Tom ! The issue you are having is because the vellum geometry passed to the solver is actually frozen at the creation frame, and does not update the animated attributes. What you need is to have access to that animated geo So in your popwrangle, you can specify the input 2 to be your animated geometry (it can be anything from your maskfromgeometry to the vellumstructs), and then refer to that geo instead of the dop geometry Hope that helps ! vellum_falloff.hiplc
  5. Hi Mikel, I believe this question should be posted in the Scripting Forum But here's how I would do it Inside a Python Processor, from os import listdir path = r"C:\someFolder" allFiles = listdir(path) for file in allFiles: newItem = item_holder.addWorkItem() newItem.setStringAttrib("file", file) newItem.setStringAttrib("path", path + "\\" + file) Basically, using this documentation page, you can see how to add a work item This tells you that the resulting object is → pdg.WorkItem If you follow it to its documentation page, there you can see how to add an attribute to said work item
  6. Issue ?Solved

    Hi Librarian ! I'm guessing your issue is that the attribwrangle4 node doesn't output anything ? If that is so, then your issue is with the "|+" conditional operator I don't know what it is, but I assume you want to isolate the points that has the same value as the current loop of your foreach_end1 So replacing the |+ with != should work If the attribute pairID of the current point is not equal to the current loop iteration value, then remove it Hopefully that fixes your issue ! Otherwise, please elaborate
  7. Rotation Trouble

    Hey loudsubs ! So, I really am not an expert on matrix or quaternions, but I managed to come up with something that works for you, even though I can not explain it very well -.- That means that I cannot debug your setup itself, but I made a version using some VEX and a Solver The idea is to compute the rotation that a point would have at a given frame (based on its velocity and the sphere radius) using this float radius = chf("radius"); // Get distance traveled from previous frame vector prevPos = point(1, "P", @ptnum); float zeDist = distance(@P, prevPos); float rotation = zeDist / ((2*radius) * $PI); Then, we rotate a matrix using this rotation value using this float angle = radians(rotation*360); vector axis = normalize(v@dir); // Rotate the matrix (this is only one frame's worth of rotation) rotate(3@m, angle, axis); And finally, we accumulate the matrix m using the previous' frame matrix matrix3 prevMatrix = point(1, "m", @ptnum); 3@m = prevMatrix * 3@m; Notice how I specified "3@m = prevMatrix * 3@m;" instead of simply doing "3@m *= prevMatrix;" (which is the same as doing "3@m = 3@m* prevMatrix;") I think something like this was the issue with your setup, since when I used "3@m *= prevMatrix;", my setup behaved sort of like yours I believe this has to do with right/left multiplication order, affecting the local/global rotation or something I encourage you to try it out, using the Visualize node to see the animated angles resulting from it Note that this was all in a single wrangle running over Points, inside a Solver (input 0 is Current frame, input 1 is Prev_Frame) And then I rotated the matrix by 90 degrees in Y (unsure why, but note that we are outside the Solver at this point), and we're done Converting the matrix to orient and passing it into the copytopoints gives the right result Hopefully there is something that makes sense in all of that ! pathsolver04.hiplc
  8. [SOLVED] Compute angle between unshared edges

    Hi @Aizatulin, that works like a charm ! To be honest, I tried to figure out the logic of it, but I guess my intuition and understanding will develop as I use it in various situation. Right now, I'm having trouble wrapping my head around it, even if it's just a simple dot product -_-' @eimk, thanks for the alternative method ! I'll have to take a look at it later, and figure out that determinant thing Thanks to you both again, I appreciate it !
  9. Hi there ! The title might not be clear much, so let me try to explain. I'm trying to compute the angle of each points inside of a hole in a geometry. By searching a bit, I found float angle = degrees(acos(dot(normal_pt, nn_pt)));, which works, but there is an issue with my specific case. The blue angles are fine (simply by luck, coming from the shape of the hole), but the red ones are incorrect. Instead, I want to get the orange angle. That's pretty easy, I can do 360-angle. But the issue is when. How do I detect those issues, to be able to apply the fix ? Alternatively, I tried using the Measure SOP to compute this all for me, but I didn't find how to use it in this manner. But knowing Houdini, there probably is some node or VEX function that can compute this for me already =P Thanks ! getHoleAngles.hipnc
  10. PDG - Remove work item

    Welp, that sure wasn't helping =P My bad - but looks like they fixed the weirdness in .532, vs .348 Lemme explain - I'm testing this out on my work PC (that has 18.0.348 installed), but can't upload a file from it, so I recreated the same setup on my personal computer (with 18.0.532). I messed up writing that part, but here's the behavior attached I was having on my work PC And when redoing the setup on my personal one, I mis-typed this part, and assumed that the problem just got worse in .532, but no ! Without the typo, that weird behavior seen in the attached video is no more ! .. Or is it ? There is some more weirdness coming from the other branch. The discard_files_with_no_match1 shows the same behavior when set to Automatic. Set it to Dynamic, and now it works. Sorry for the multiple edits. Here's the video of it happening in the .532 version.
  11. PDG - Remove work item

    Hi James ! So you're basically using Python in the expression box. I totally didn't think about that, and yeah, that works ! Thank you for that insight, much appreciated Oh and I figured out the second question ! Turns out I was trying to match strings, which has to be through the "strmatch" function. I was doing an "==" comparison, which doesn't work for strings. So strmatch("*proxy*", @filename) for string comparison and @intAttr=4 for int/float attributes works fine. There are some weirdness from attributes created within a Python Script node (has to set the subsequent nodes trying to access the attribute to Dynamic, else it's as if the attribute doesn't exist, and other disparities), so that's something to keep in mind (see attached hip file). pdg_test.zip
  12. PDG - Remove work item

    I wasn't able to answer any of my questions yet, but I found a workaround. This doesn't mean that I don't need an answer to the previous questions, so feel free to reply My workaround for getting rid of those pesky work_item that contains the dreaded "proxy" keyword is using the Python Processor node. I noticed that placing this bad boi in a chain blocks all traffic from coming through, and that I would need to police each of the work_items to decide which one I let through. And this is exactly what I want to do ! So the concept is really simple, for each of the upstream work item, check if "proxy" is NOT in the filename. In that case, yeah ! Let 'im through ! for item in upstream_items: if "proxy" not in item.attribValue("filename"): newItem = item_holder.addWorkItem(parent=item) # parent copies the original work_item's attributes So instead of deleting the ones I want to remove, I'm actually regenerating the whole graph, copying only the ones I want. I feel like this is really not optimal, so using an actual node made for that purpose (like split) would surely be a lot better. Attached is the updated hip file, along with a quick mockup of that "find string in files" idea I mentioned. pdg_test.zip
  13. Hello ! I'm trying to learn a bit of PDG since it might be useful for some of my projects. But I'm having a few issues For one, I wasn't able to find how to remove a work item. What I'm trying to do is search for a string in a bunch of files, and based on that I'll do some other things. Right now I'm simply trying to get to find the string in the files, but first I need the relevant files. So I use the filepattern node for that, but there is a few files for which I don't want. I use a pattern for the extension (*.txt), but there is some files with a specific string (in this case "proxy") in the filename that I would like to ignore. I tried something like "thePath\*.txt ^*proxy*" to get all the txt files without the ones with "proxy" in the name. Didn't work, maybe the syntax is wrong, but moving on. So I have a bunch of files (aka work item) that I want to get rid of. I tried using the split node, but I don't know how to work with PDG attributes. It always either error out, or gives me this I tried "@filename="file.txt" | @pdg_filename="file.txt" | I tried without the quotes, I tried with backticks around the filename part, without any success. What's the correct syntax for this ? I tried reading this, but without much results. I would need an example to understand it. So using expressions didn't work. I then moved on trying it out with Python. There is the "work_item.dirty(True, True)" command, which works as I want, I see the work item being removed in the node UI, but then Houdini freezes, then crashes. So I'm seemingly out of options. There is multiple questions, which are as follows : 1 - Is there a syntax for the file pattern that allows to get all .txt files, without the ones with a specific pattern in the name ? (mockup - "*.txt ^*proxy*") 2 - How to use PDG attributes in a node, as part of an expression ? Kinda like something simple like "@Frame=2", but in this fashion '@filename="file.txt" ' 3 - Why does the work_item.dirty() python command crashes Houdini ? Am I doing something wrong ? Test file attached. The zip contains some random .txt files with names to test out what I want, along with the hip file. pdg_test.zip
  14. Export crowd agents to USD

    Hi ! I don't know about USD (I only know the base of what it is), but agents are quite reluctant to being exported out of Houdini Just exporting to FBX is "not possible", unless you write a custom tool to convert the packed agent to "actual geometry", like in here But this is NOT made for multiple agents. Haven't tested, but maybe just 5 would be slow, and 100 be painful So maybe (hopefully) someone will come along and say that with USD, it's actually surprisingly simple But with my experience with Agents and trying to export them to FBX, that's a big oof Sorry for not being super helpful
  15. BBox Rotate by Max Length?

    Here's my take on it By the way, thanks Noobini, I've always wondered what dihedral did. With this, I now got a better understanding of it This is a VEX-heavy method of doing it. I compute the rotation matrix and bring back to the origin, then find the longest and shortest side, and finally align the piece according the orientation we want, using dihedral. align_bounds_longest_shortest.hipnc
×