VOP Deformer
General Setting
- Set transformable deforming Guide(it makes Anydeformer easy to control at any position and angle)
tranform2 -refer to transform1 and check invert
|
Deformer
|
tranform1 -controled
- Making Fit BoundingBox Button
(this may help when you don't want deformer to depend on object BoundingBox especially for Bend)
This example is for Bend but you can set for any deformer.
Make Parameters at otl
make bounding box corner
maxbb(vector) (y refers to bth)
maxbb(vector) (y refers to bbh)
bth(float)(Bounding Top Height)
bbh(float)(Bounding Bottom Height)
Set Python Moule
def centerFit():
geo = hou.pwd().geometry()
##getting a inputpath geometry
geoInput = hou.pwd().inputs()[0].geometry()
bbcenter = geoInput.boundingBox().center()
hou.Node.parmTuple(hou.pwd(),"t").set(bbcenter)
##getting a inside child geometry number might b changed
geoTransed = hou.pwd().children()[4].geometry()
bboxMax = geoTransed.boundingBox().maxvec()
bboxMin = geoTransed.boundingBox().minvec()
hou.Node.parmTuple(hou.pwd(),"maxbb")[0].set(bboxMax[0])
hou.Node.parm(hou.pwd(),"bth").set(bboxMax[1])
hou.Node.parmTuple(hou.pwd(),"maxbb")[2].set(bboxMax[2])
hou.Node.parmTuple(hou.pwd(),"minbb")[0].set(bboxMin[0])
hou.Node.parm(hou.pwd(),"bbh").set(bboxMin[1])
hou.Node.parmTuple(hou.pwd(),"minbb")[2].set(bboxMin[2])
To call back
kwargs["node"].hdaModule().centerFit()
Bend
Example)This example is in case the Bend rotates X axis and secondary axis is Y
1)you can think simply like pressed points at secondary axis will be rotated depending on original Y height amount.
Then Angle radian length should be same amount to Y height.
Therefore, you need to reposition rotation axis position which means z-position whenever you change angle amount.
X Angle Amount = Angle * Y hight / MaxYheight
Angle Axis Z position = (MaxYheight/ Pi) / (Angle / 180)
These Parameters are going to just makeTransform node and multiplied by matrix from makeTransform
2)You also have to be careful that when angle = 0, axis Z position is calculated to be infinity.
So you need to make "if" if angle = 0 then point positions no change.
ceiling(clamp(absolute(angle))) --- one of the examples that can divide to "0" and "not 0"