Jump to content


  • Content count

  • Donations

    0.00 CAD 
  • Joined

  • Last visited

  • Days Won


Everything posted by MrScienceOfficer

  1. MSS_SingleOpState render shaded 'guides'

    What I would do is create an array of the positions in the state and use that to render points class PointsHandles { void draw(RE_Render* r); UT_Int32Array mySelection; UT_Vector3FArray myPoints; RE_Geometry* myReGeo = nullptr; } void PointsHandles::draw(RE_Render* r) { if (myReGeo) myReGeo = new RE_Geometry(myPoints.size()); myReGeo->createAttribute(r, "P", RE_GPU_FLOAT32, 3, myPoints.data()); myReGeo->createAttribute(r, "Sel", RE_GPU_INT32, 1, mySelection.data()); myReGeo->connectAllPrims(r, 0, RE_PRIM_POINTS); myReGeo->draw(r, 0); } that should basically work, you'll need a shader that uses the "Sel" attribute and creates some visual feedback for the user.(let me know if you need help with the shader) I would do something like sort points by collinearity with the results of the vector from mapToWorld() for the selection, that's a personal preference though (it's easy to implement and I find it very intuitive as a user as well). Then use a GU_RayIntersect to intersect with the geometry your creating loops on, and just write the positions to the parameters.
  2. MSS_SingleOpState render shaded 'guides'

    What are you intending to accomplish? If you use a valid shader for the purpose, you should be able to render anything you like. Though you may need to push the Viewer and Perspective matrices first something like this pseudocode. r->assignUniformMatrix(RE_UNIFORM_PROJECT_MATRIX, getViewportProjectionTransform()); r->assignUniformMatrix(RE_UNIFORM_VIEW_MATRIX, getViewportTransform()); I haven't tested any of that though. What I would do is create a DM_SceneRenderHook instead if you just want to render some spheres, though without knowing your intention it's hard to comment on best practice.
  3. Caching Data between cooks

    Does the SOP_WindingNumber sample not show what your looking for? A GU_Detail is a collection of attributes(like a position attribute but also for topology) so when your asking if a geometry has changed, your really asking what attributes in the GU_Detail have changed. All attributes are tracked with GA_DataId, so caching the data id of the attribute you're interested in and checking that against the incoming geometry will allow you to check for any relevant changes. The SOP_WindingNumberCache::update3D function in particular seems to show a way to do what your describing.
  4. What is a curve mesh ?

    I believe a curve mesh is a geometry made only of polygon curves. It took me a while to figure that out, but it seems the intersection nodes only don't complain when using polygon curves.
  5. VEX SIMD vs. Remove coincident primitives

    Yes, yes, yes, in general, no. When you write code in VEX (or use VOPs) you are reading attributes from the input geometry, not the geometry you are currently processing. This is the mechanism that allows VEX to run multi threaded SIMD code. Though that's just high level theory; you can't read and write to the same data from different threads haphazardly.
  6. Dot Vector in Python ?

    Why would it match (and why would you need it to?), your rounding to the .001th decimal place and testing for a tolerance to .00001th place.
  7. Dot Vector in Python ?

    def theLooper(curNode): for thePrim in curNode.geometry().prims(): primColor = thePrim.floatListAttribValue("Cd") rounded = tuple((round(total,3)) for total in primColor) print(thePrim.number()) print(primColor) print("Theese are the rounded numbers\n"+str(rounded)) #print(round(primColor,3)) dot = hou.Vector3(primColor).dot(hou.Vector3((rounded))) # closing parentheses was missing tolerance = 0.000001 if dot >= 1.0-tolerance and dot <=1.0+tolerance: print("match") else: print("no match") if curNode.geometry().findPrimAttrib("Cd"): print("yes") else: print("no") Python tends to throw a syntax error on the following line when a line doesn't complete it's statement i.e. parentheses block not closed.
  8. int primCount = detailintrinsic(concat("op:", opfullpath("../myInputedGeo")), "primitivecount"); // or just int primCount = detailintrinsic("op:../myInputedGeo", "primitivecount"); opfullpath is a VEX function (as well as an hscript function), your attempting to call the hscript version(by putting it in backticks), int primCount = detailintrinsic("op:`opfullpath("../myInputedGeo")`", "primitivecount"); either version should work though I recommend the VEX version as it's much easier to debug. Looking at your post again point #2 is correct and should work, unless I'm not seeing how it's different from my version (which works for me).
  9. defining normal direction with wrangles

    PolyFrame works well in this situation, just change the tangent to 'N'. A vex solution would look like if (@ptnum != npoints(0)-1) @N = @P - point(0, "P", @ptnum+1); else @N = point(0, "P", @ptnum-1) - @P; @N = normalize(@N); . This handles the case of the last point by inverting the vector towards the previous point.
  10. How to reset HOUDINI_DSO_PATH

    I looked at what your saying about exporting paths, I've never heard of that before. I don't believe what you did actually changed the paths in Houdini. Your path needs to be '/Users/gfx03/HDK/custom;&' you need add ';&' to tell houdini to keep searching for more paths. It's probably best to just edit the houdini.env file though.
  11. über slow

    Pinging forums.odforce.net [] with 32 bytes of data: Reply from bytes=32 time=49ms TTL=58 Reply from bytes=32 time=43ms TTL=58 Reply from bytes=32 time=41ms TTL=58 Reply from bytes=32 time=45ms TTL=58 Ping statistics for Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 41ms, Maximum = 49ms, Average = 44ms It taking about ten seconds to load a page.
  12. Dot Vector in Python ?

    I recommend posting an example file showing the issue like Bonsak suggested.
  13. Dot Vector in Python ?

    https://www.programiz.com/python-programming The section entitled "Few Important Things to Remember" at the end, briefly goes that. I recommend going through other tutorials I found here, https://wiki.python.org/moin/BeginnersGuide/Programmers
  14. Dot Vector in Python ?

    Outside of the formatting issue, it looks fine. Your error isn't related to that code(unless its related to the formatting issue)
  15. VEX Based Replace File Extension

    s@file = "thing/another/geom.001.rs"; s@file = concat(join(split(s@file, '.')[:-1],'.'), ".bgeo.sc"); note the added dot joining the split.
  16. Switching Views using python/hscript

    I think you can do it with the hou.ui module using the pane classes, last time I tried though(month or so ago) most of the pane functions crashed Houdini so I never really did much with it.
  17. über slow

    Pinging forums.odforce.net [] with 32 bytes of data: Reply from bytes=32 time=41ms TTL=58 Reply from bytes=32 time=41ms TTL=58 Reply from bytes=32 time=40ms TTL=58 Reply from bytes=32 time=43ms TTL=58 Ping statistics for Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 40ms, Maximum = 43ms, Average = 41ms The last few days it's been intermittently slow, sometimes taking 3-5 whole seconds to load a page, normally it's instantaneous, quite a jarring experience . Seems to be better today, still a tad slow though.
  18. VEX Based Replace File Extension

    Why not s@file = "thing/another/geom.rs"; s@file = concat(join(split(s@file, '.')[:-1],''), ".bgeo.sc"); ?
  19. Wire capture, controlling width per point?

    I think you would need to go through all the curves in a for loop and drive the widths by pushing the attributes through CHOPs, it sounds a bit convoluted, and I imagine there must be a simpler way. Using point deforms is another choice, but you can't, as far as I know, control the capture radius per point. A third option would be to generate bones from the curves and use the biharmonic capture SOP to bind it. This would likely result in the highest quality(and most expensive) results since it will use proper transforms to drive the tree, while the other methods work a bit differently and can have less stable results (under more extreme deformation). I think your best bet though, would be to post this on the SideFX forum as well there's a good chance some one out there has already solved this problem.
  20. Dot Vector in Python ?

    That code works for me, you need to post the error message.
  21. Python vs C

    Yes, VEX is a 'C like language' implemented in C, Python is also implemented in C. C is great to learn because most languages used in practice can be described and understood in terms of C where it sounds silly to describe C concepts in Python terms. Every function you call in Python or VEX ends up being a call(or many calls) to a C function. The differences between VEX and Python and C is pure semantics and implementation details(written in C). If one wishes to truly learn to program, the fastest route to true enlightenment is undoubtedly C/C++. The majority of concepts that you need to understand to use C, will allow you to become an efficient and skilled VEX/Python programmer. Languages like Python and VEX obscure concepts like memory management where C forces you to understand. All that said it's very unlikely you'll ever need to use C/C++ in Houdini. Now that we have compiled SOPs(which are extremely efficient due to how memory is managed), there are very very few valid use cases for using the HDK. The take away here should be, learn C, use Python and VEX.
  22. Wire capture, controlling width per point?

    Wirecapture uses a keyframes on the radius and lookup parm to drive the values by essentially hacking the animation editor instead of using a ramp parm, I think it's an outdated workflow. I wouldn't recommend using it. wire_capture.hiplc
  23. Another option would be to mirror your HDAs interface on a python node so when any parameter changes the node will be cooked.
  24. geometry node in python

    createNode takes the name of the node type, so for a geometry node it takes 'geo'. The name of node (compared to it's label) can be found by middle mouse clicking on a node instance, it's the name after the label,, in parenthesis.
  25. You can add a callback on the node. node.addEventCallback(hou.nodeEventType.ParmTupleChanged, call_func) I think that covers all parms, not just parmTuples but I'm not sure.