Created
November 3, 2023 11:08
-
-
Save BigRoy/df2c56c32b83b85d7d056e7c7d056346 to your computer and use it in GitHub Desktop.
Houdini Python LOPs node add simple 360 Y-axis rotation on a prim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pxr import UsdGeom, Usd | |
node = hou.pwd() | |
stage = node.editableStage() | |
path = "/cube" | |
prim = stage.GetPrimAtPath(path) | |
start = node.evalParm("start") | |
end = node.evalParm("end") | |
xform = UsdGeom.Xformable(prim) | |
# Clear all transforms | |
xform.ClearXformOpOrder() | |
# Do not inherit parent transformations | |
xform.SetResetXformStack(True) | |
# Add the rotate Y spin operation | |
rotate = xform.AddRotateYOp() | |
rotate.Set(0, time=start) | |
rotate.Set(360, time=end+1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or have it run over the last modified prims of the input node.