Jump to content


  • Content count

  • Donations

    0.00 CAD 
  • Joined

  • Last visited

Everything posted by sibarrick

  1. Do simulation in Sop

    I've never actually tried this so I don't know if fundamentally what you are doing is the right way to do it. But purely from what you have already posted, wouldn't you just say myLastCookTime starts at 1 or some user defined sim start point, and then once your cook loop has run just set it equal to "now" ready for the next jump in time. You'll probably need to reset it to 1 again if myLastCookTime > now.
  2. Ok so the nights are drawing in and the summer has gone, in England any way.. so I'm poking around with a bit more code. I've been looking at texture unwrapping using LSCM. As used by the Blender and Roadkill apps among others. There's still much to do but here is an initial cut, usual warnings apply. When its a bit further along I'll post it up on Houdinitools I couldn't get it to work with the HDK built in matrix solvers so I've used OpenNL which is very easy to include, I think its pretty cross platform but I'm only working on windows, maybe someone on Linux can test for me??? Currently the list of things to do is as follows in rough order of importance 1. Automatically create seams from a user input edge list. Currently I use my point slide sop to do it just because it was there and did the job. 2. Add support for groups 3. Add colour coding of the stretching after the unwrap - this might be handy as a seperate sop actually (Sesi?) 4. Add ABF to the LSCM method to improve the unwrap for certain cases 5. Optimise the code by using SuperLU Its pretty much usual as is but adding ABF will be important I think. Adding SuperLU support will mean it can handle super sized meshes, the test one I used is fairly light but pretty typical I think, it solves pretty fast so its very usuable. TextureUnwrap.zip
  3. Micro Bevels

    Hi all, I've been experimenting in vops again and thought I would share the results so far. This might be interesting for those of you keen on lego The idea here is to be able to add tiny micro bevels to edges to get away from that razor sharp cg edge look. Here's some piccies of the results so far Bevelled Not bevelled and here's the vop network, Mario if you take a look at this you may need a stiff coffee, its a terrible vop network that needs optimising heavily, its just a test at present Hip file Uploads don't seem to be enabled yet on here, or I can't find how you do it, so the above are links to my ftp site...
  4. Ok so after sitting on this for a while I've finally gotten around to posting the Houdini GPD library for reading and writing bgeo files up on SourceForge. GPD SourceForge If you make changes to the code mail them to me and I'll update the package.
  5. Hi, For those that might be interested I've uploaded a new hdk operator to my tools site. Its a first cut of a sop to measure the distortion in an animated mesh. Basically you give it a deforming geometry and a rest one and it compares things like edge lengths and angles to determine which parts are most distorted and creates a 0-1 attribute with this information in it. You can then use this attribute to drive a procedural smooth. Measure Distortion SOP
  6. Works ok on my windows 8 laptop either with or without gnomons
  7. Using python's numpy/scipy in SOPs

    When I try and import scipy I just get an error, has this been removed from Houdini since H12.5?
  8. RBF morpher

    Hi all, Been away for so long, this is my first post in some years I believe. Anyway I was at a Houdini event the other day and they were talking through all the great new features in Houdini 13 and beyond and I noticed on one of the slides that numpy is now included in Houdini since 12.5 or even earlier. It's been so long since I delved into Houdini that this massively useful fact had totally passed me by. The first thing that lept into my head when I saw this was my old HDK sop RBF morpher which is a totally awesome deformer that has gotten me out of so many tricky deformation scenarios over the years. Finally I realised I could re-write this in a Python sop and not have the issue of people needing to compile it to use it. A few days later and after a couple of hours work here is the result. No error checking yet just the bare bones of the functionality. Of course it's no where near the speed of the HDK one, but hey at least compilers aren't an issue with this one. This is the source code and I've attached a example hip file and otl, non-commercial versions. # This code is called when instances of this SOP cook. import numpy as np import math node = hou.pwd() geo = node.geometry() inputs = node.inputs() kernel = node.parm('kernel').eval() power = node.parm('power').eval() scale = node.parm('scale').eval() def linear(r): return r def smooth(r): return r*r*math.log1p(r*r) def cube(r): return r*r*r def thinPlate(r): return r*r*math.log1p(r) def sqrt(r): return math.sqrt(r) def pow(r): return math.pow(r,power) kernels = {0: linear, 1: smooth, 2: cube, 3: thinPlate, 4: sqrt, 5: pow} def rbfU(r): return kernels[kernel](r) if len(inputs) > 2: featureGeo = inputs[1].geometry() targetGeo = inputs[2].geometry() numFeaturePoints = len(featureGeo.iterPoints()) matrixQ = np.zeros((numFeaturePoints,4)) #setup all the matrices with the feature point positions i = 0; for p in featureGeo.points(): matrixQ[i,0] = p.position()[0] matrixQ[i,1] = p.position()[1] matrixQ[i,2] = p.position()[2] matrixQ[i,3] = 1 i += 1 #print matrixQ matrixQtranspose = matrixQ.transpose() #print matrixQtranspose matrixK = np.zeros((numFeaturePoints, numFeaturePoints)) #scale = 1 for row in range(numFeaturePoints): for col in range(numFeaturePoints): ppt = featureGeo.iterPoints()[row] p1 = ppt.position() ppt = featureGeo.iterPoints()[col] p2 = ppt.position() p = p1-p2 matrixK[row,col] = rbfU(p.length()/scale) #print matrixK #setup the final set of linear equations in one massive matrix matrixA = np.zeros((numFeaturePoints+4, numFeaturePoints+4)) for row in range(numFeaturePoints): for col in range(numFeaturePoints): matrixA[row,col] = matrixK[row,col] for row in range(numFeaturePoints): for col in range(numFeaturePoints, numFeaturePoints+4): matrixA[row,col] = matrixQ[row,col-numFeaturePoints] for row in range(numFeaturePoints, numFeaturePoints+4): for col in range(numFeaturePoints): matrixA[row,col] = matrixQtranspose[row-numFeaturePoints,col] #print matrixA #setup the solutions to all the linear equations, i.e. the target feature positions targetX = np.zeros((numFeaturePoints+4)) targetY = np.zeros((numFeaturePoints+4)) targetZ = np.zeros((numFeaturePoints+4)) i = 0; for p in targetGeo.points(): targetX[i] = p.position()[0]; targetY[i] = p.position()[1]; targetZ[i] = p.position()[2]; i += 1 #solve the linear equations to find the weights that map the features to the targets weightsX = np.linalg.solve(matrixA, targetX) weightsY = np.linalg.solve(matrixA, targetY) weightsZ = np.linalg.solve(matrixA, targetZ) #print weightsX #apply the weights to the actual points on the input geometry to get the final resulting positions relative to the target feature points NfPts = numFeaturePoints for opt in geo.points(): outX = weightsX[NfPts]*opt.position()[0] + weightsX[NfPts+1]*opt.position()[1] + weightsX[NfPts+2]*opt.position()[2] + weightsX[NfPts+3]; outY = weightsY[NfPts]*opt.position()[0] + weightsY[NfPts+1]*opt.position()[1] + weightsY[NfPts+2]*opt.position()[2] + weightsY[NfPts+3]; outZ = weightsZ[NfPts]*opt.position()[0] + weightsZ[NfPts+1]*opt.position()[1] + weightsZ[NfPts+2]*opt.position()[2] + weightsZ[NfPts+3]; p1 = opt.position() i = 0 for p2 in featureGeo.points(): p = p1-p2.position(); rF = rbfU(p.length()/scale); outX += weightsX[i]*rF outY += weightsY[i]*rF outZ += weightsZ[i]*rF i+=1 opt.setPosition((outX,outY,outZ)) [/CODE] ExampleRBF.hipnc RBFmorpher.otl
  9. RBF morpher

    As a comparison too, here is the same thing with a switch to compare to the CHOP method. Clearly way faster and if you don't need to get into the code to do anything different then probably the better solution in most cases for basic deformation.... RBFmorpher.otl ExampleRBF.hipnc
  10. H11 hdk compile errors

    That one plus a few others have now been updated to compile for H11, hopefully more to follow....
  11. Ok so this has bugged me for years and finally I got round to writing one. It basically works like this, geometry in one input and curve sop in the second. The curve sop just needs to have been snapped to the edges or points of the geometry you want to split. Now this is all well and good but I wanted to extended it to multiple curves. This nearly works but for some reason I can't see at the moment in some situations some edges don't cut..... if anyone has any pointers I'd appreciate it. Feed each curve in one at a time and they work, combine them together and they don't. To see what I mean I have included a test hip file. Now I can only assume this is something to do with something in the gdp not getting updated properly when I loop round to do the second curve, but when I try and test this by doing a cout on the poly number that is getting cut it causes the whole sop to crash, I'm well confused I've missed something obvious and if anyone could spare a fresh pair of eyes to spot it that would be great. PolyCrease.zip Doh! of course the closest point isn't necessarily a point on the edge I need. How obvious, hmmm have to add some more checks.... No that's not it, it is an issue but not in the current examples... hmmm still stuck.
  12. Tri's To Quad

    Hi all, I thought I'd post up the code I wrote for converting tri meshes to quads. It a fairly crude algorithm and still a work in progress. Don't know if I'll ever bother to finish it. It was written as a learning exercise and as such it is presented for anyone else who might be learning HDK too. It might have some useful methods in it that you can rip off. I can't claim that it is all done the "right" way but then in HDK who can. Point is it works reasonably well and maybe will help someone trying to learn. Quad_meshing.zip Enjoy!
  13. Animating using Blendshapes

    Just key frame the slider, set a key on frame 1 and set the slider to 0, and set a key on frame 25 and set the slider value to 1. You can keyframe and animate any parameter in Houdini just as you would at object level in any other package.
  14. deforming geometry

    Not sure how you'd get round that, you could re-project the texture coordinates after the deformation but then the displacement won't look like it's attached to the object. I think it's a big catch 22.
  15. Micro Bevels

    Fixed in H11.0.581
  16. deforming geometry

    I think the problem here is what you are describing is exactly what you'd expect to happen. If the texture is stuck to the geometry via a rest position and then the geometry stretches then naturally so will the texture. The only way around that is to use a world space texture but if the model is animating it will then appear to travel through the texture space and it won't be stuck to the model.
  17. Micro Bevels

    This seems to be broken again in H11, haven't got to the bottom of why yet but I'll start by looking at the ray hot vop again.
  18. Nvidia keynote

    Watch this from about 1 hour in, very interesting stuff.... Nvidia keynote
  19. Nvidia keynote

    Good link, cheers!
  20. Nvidia keynote

    Actually the 2 things I found most interesting were the multi-lense stuff allowing refocusing of an image, I wonder if it's possible to actually render images that way in an efficient manner. And also the idea of having a server doing online rendering directly into a browser pluign.
  21. change otl definition

    RMB on it and unlock it. Make your changes. RMB on it and save it. RMB on it and match definition.
  22. Vertex Normal Cusping

    Makes me think there should be a cusp sop that can deal with vertex or point cusping rather than having it in two very different places.
  23. Extend group to connected points

    Can't you just use the connectivity sop followed up with a partition sop?
  24. Scatter points position

    You can always calculate your own area attribute before the deformation using the measure sop and then base the scattering on that too.
  25. Uniform Surface Scattering

    Good work, thanks for sharing, very useful!