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.

bjs

Members
  • Content count

    14
  • Joined

  • Last visited

Community Reputation

0 Neutral

About bjs

  • Rank
    Peon

Personal Information

  • Name Bastian J. Schiffer
  • Location Germany
  1. Awesome, F1! Works beautifully – and thanks for the additional examples (how to link to a texfield and format those vector arrays)!
  2. Alright, getting closer. This first snippet in the "Pre-Render Script" field is working: myfile = '$HIP/myfile.txt' a = file(myfile, 'w') a.write("test abc") a.close Just like you would expect, every time you hit the "Run Command" button, it writes to the textfile in the current directory. Now I would like to get a detail attribute from outside the ROP Network and write it into the file. Since I only have very basic knowledge of Python inside Houdini, this is what I tried: myfile = '$HIP/myfile.txt' a = file(myfile, 'w') a.write(str(hou.node('../../OUT').findGlobalAttrib('myattrib'))) a.close But I get an error message now, stating "'SopNode' object has no attribute 'findGlobalAttrib'" ... If I leave out the "findGlobalAttrib" method, it writes "OUT" in the textfile, so Python seams to find the SOP, right? myfile = '$HIP/myfile.txt' a = file(myfile, 'w') a.write(str(hou.node('../../OUT'))) a.close What am I doing wrong?
  3. I am currently looking into the Shell ROP inside a ROP Network, which looks promising. I now need to find a possibility to get that detail attribute from outside that ROP Network, but I think I saw something like this yesterday, I just have to find it again. I'll keep you posted, thanks for your help!
  4. Hey there – I hope, this is the right forum. I am creating an HDA on SOP level that creates a detail attribute on a geo. What I would like to do now is create a textfile (on the desktop, the current directory or a directory chosen by the user – not too important right now) containing this detail attribute (a string) when the user clicks a button. What I came about on https://tosinakinwoye.com/2014/05/04/houdini-python-snippets/ is this snippet: # write bundle names, filter and pattern to file import hou namedumpfile = '/u/toa/Desktop/b_name.txt' patterndumpfile = '/u/toa/Desktop/b_pattern.txt' filterdumpfile = '/u/toa/Desktop/b_filter.txt' a = file(namedumpfile, 'w') b = file(patterndumpfile, 'w') c = file(filterdumpfile, 'w') # write bundle names, filter and pattern for bdl in hou.nodeBundles(): a.write(str(bdl.name())) a.write("\n") a.close b.write(str(bdl.pattern())) b.write("\n") b.close c.write(str(bdl.filter())) c.write("\n") c.close Copied into a python node at the end of my setup, this lets me write a string to textfile – but several problems arise: I suspect that the code is run everytime the Python SOP is cooked (but I rather want to let the user decide when to write the file, not have Houdini do it automatically). And the resulting file is also locked (meaning that it can't be edited or deleted). What I would like better would be the behaviour of a ROP Output Driver – meaning a node that generates the file only when the button is clicked. So my suspicion is that the Python SOP is probably not the best choice?! I would greatly appreciate your help. Thanks, Bastian.
  5. Thanks Vitor for taking the time to answer and sorry for not being clearer on the problem. I've attached the file this time, which will hopefully clarify what I am trying to do (the red CUTTER node is responsible for what gets cut from the geometry). I've found a way to close the holes step by step though adding a PolyCap after each Clip. It's not pretty but it seems to work. I guess I was just hoping to get better topology (the "limit insetting" option on the PolyExtrude is enabled, but there is still some invisible geometry which I guess is causing the problems with the PolyCap) – but the problem may lie deeper as you suggest ... I'll consider what you said and see if I find a smarter way to get the result. Thanks for your input! Solid-Extrude-1.hiplc
  6. So the PolyCap SOP seems to work quite well in this case. Only when there should be a hole in the cap, there instead is an overlap. Any ideas how to solve this? Thanks in advance!
  7. I have been researching for a couple of days on a seemingly simple problem: I would like to add some thickness to a mesh (which will end up being more complicated than the example below) and then clip it from various sides. After clipping, I would like to cap the mesh, so it appears to be a solid body (in the example with the box, it would be hollow inside). Two problems arise: – How can I get a clean extruded face without any of the intersections (see example "Extrude-1")? – For the capping, I tried the Dissolve and PolyCap SOP. But both cap the whole side (not considering the interior "negative space") (see example "Extrude-3"). I tried creating a manual cap using the unshared edges and a PolyLoft SOP, but was wondering if there were any better ways to do this? The technique will eventually be used for open, plane-like geometry – not hollow bodies (see example "Extrude-2"). Which might make it a bit more complicated. I'd be grateful for any kind of help – thanks, Bastian.
  8. Since it was originally my goal to limit the nearpoints() function to an exisiting point group, it might be worth to mention that Moritz pointed out to me how that is done successfully (see screenshot for this). Note that activeGroup is the name of the existing point group ...
  9. Exactly this was driving me crazy. The help fails to mention that the "@" character must be masked, as suggested by F1 ...
  10. Sorry for not reporting back sooner ... I masked the "@" character, as F1 suggested, and it worked perfectly! Thanks to everyone for their help! Added the screenshot for future reference ...
  11. I am also wondering if it's the smartest way of filtering the result? Of course, another option would be to get all the nearest points and filter afterwards. But I thought since the manual explicitly states the option to do so, it would be a really smart and efficient way to do it: int [] nearpoints(string geometry, string ptgroup, vector pt, float maxdist) ptgroup: A point group pattern to limit the search to. Can be a SOP-style group pattern such as 0-10 or@Cd.x>0.5. An empty string will match all points.
  12. Same result with your proposed solution, Pavel – no error, but not the intended result: string ptgroup = detail(0,"at")+"Cd.x<1.0"; int nearest[] = nearpoints(0, ptgroup, v@P, 1); i@found = len(nearest); i@first = nearest[1]; Added the screenshot as well. Shouldn't there now also be a detail attribute on the geometry (lower pane), or am I missing something?
  13. Thanks to both of you! Due to the time difference I could only now check your answers. Yunus, as suggested, I simply omitted the "@" and put the expression in quotation marks: int nearest[] = nearpoints(0, "Cd.x<1.0", v@P, 1); i@found = len(nearest); i@first = nearest[1]; While I don't get an error, this doesn't yield any result either. I attached a screenshot to illustrate the setup.
  14. Hello – after quite a bit of searching and a pretty long struggle I've decided to post my simple question concerning the "nearpoints" function (http://www.sidefx.com/docs/houdini15.5/vex/functions/nearpoints) that I am using on a Point Wrangle SOP. The manual states that, under "ptgroup", one can specify a "point group pattern to limit the search to": int [] nearpoints(string geometry, string ptgroup, vector pt, float maxdist) While inputting a simple pattern like "0 11 18" works (limiting the "nearpoints" function to these points like it's supposed to), I can't get it to work when I put in the sample expression "@Cd.x>0.5". Has anyone ever used the "ptgroup" argument with an expression, because all the examples I found always only used GEOHANDLE + POSITION + MAXDIST with an optional MAXPTS at the end? Here's the code on the Point Wrangle SOP that works: int nearest[] = nearpoints(0, "0 11 18", @P, 1); i@found = len(nearest); i@first = nearest[1]; This one doesn't, giving me a wrong result and a green "implicit cast from vector to float" error: int nearest[] = nearpoints(0, @Cd<1.0, @P, 1); i@found = len(nearest); i@first = nearest[1]; I am afraid it is a very beginner's mistake, so I am grateful for any answers! Thanks, Bastian.