I have this code in python:
"{0}.currentTime += 1;".format(hairSyst)
where hairSyst
is a string defined earlier. I don't understand why I am getting a syntax error. My aim is to set an expression inside maya, and the expression is a bit long, I paste the whole thing below, maybe you can suggest a better way to do it.
expr = ("if ({0}.autoOverlap == 1){".format(firstControl.getName())
"{0}.currentTime += 1;".format(hairSyst)
"{0}.currentTime += 1;".format(nucleus)
"float $refresh_tx = {0}.translateX;".format(cube)
"float $refresh_ty = {0}.translateY;".format(cube)
"float $refresh_tz = {0}.translateZ;".format(cube)
"float $refresh_rx = {0}.rotateX;".format(cube)
"float $refresh_ry = {0}.rotateY;".format(cube)
"float $refresh_rz = {0}.rotateZ;".format(cube)
"}else if({0}.autoOverlap == 0){".format(firstControl.getName())
"{0}.currentTime = 1;".format(hairSyst)
"{0}.currentTime = 1;".format(nucleus)
"}"
)