Search the Community
Showing results for tags 'hou.face'.
Found 1 result
cloudfx posted a topic in ScriptingHi, I am trying to make a point deformer and I am stucked in a step. Here is my plans copy all the points that I want to deform to the polygon object so they are 1 object using hou.geo.createPoint in python. get uv attributes from the object copy the uv attributes of first frame so it will contain the static uv value while the object is deforming. get position value from the uv and fetch the output position value to the points that I want to deform but it seems like from the uv, it's not getting the right position. Can anybody take a look inside of this file and what step I am missing? point copy to object python script node = hou.pwd() geo = node.geometry() geo2 = node.inputs().geometry() ptGrp = geo.createPointGroup("ptGrp") for point in geo2.points(): pos = point.attribValue("P") pt = geo.createPoint() pt.setAttribValue("P" , pos) ptGrp.add(pt)[/CODE] [b]get position by uv and fetch to the original points script[/b] [CODE] node = hou.pwd() geoPdef = hou.pwd().geometry() geoAnim = node.inputs().geometry() fPtGrp = geoAnim.findPointGroup("ptGrp") ptsGrp = fPtGrp.points() i = 0 for point in geoPdef.points(): pt = ptsGrp[i] ppos = pt.attribValue("P") nprim = geoAnim.nearestPrim(ppos) u = pt.attribValue("uv") v = pt.attribValue("uv") pos = nprim.positionAt(u) point.setAttribValue("P" , pos) i += 1 [/CODE] test.hip