Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # CRV from Transform
- from pymel.core import*
- import random as r
- sl = selected()
- for s in sl:
- p = str(s)
- ex = "vector $pos = <<"+p+".translateX,"+p+".translateY,"+p+".translateZ>>;"+"\n"
- ex += "string $curveName ="
- ex += "\""+p+"_MotionCrv\";"
- ex += "\n"
- ex += "if(frame == 2){"
- ex += "\n"
- ex += "int $objTest = `objExists $curveName`;"
- ex += "\n"
- ex += "if ($objTest == 1)"
- ex += "\n"
- ex += "{"+"\n"
- ex += "delete $curveName;"
- ex += "\n"
- ex += "}"+"\n"
- ex += "curve -p ($pos.x) ($pos.y) ($pos.z) -n $curveName;"
- ex += "\n"
- ex += "}"
- ex += "\n"
- ex += "if(frame >= 3)"
- ex += "\n"
- ex += "{"
- ex += "\n"
- ex += "curve -append -p ($pos.x) ($pos.y) ($pos.z) $curveName;"
- ex += "\n"
- ex += "}"+"\n"
- expression(s, s = ex, n = s+"_Crv_Expression")
Advertisement
Add Comment
Please, Sign In to add comment