On 28/02/2018 at 20:54, xxxxxxxx wrote:
Hi, C4D artist here.
I'm trying to write a simple Python code that can:
— Draw / create a spline
— Manipulate the spline's point positions and tangents via User Data
Right now I was able to create the spline using the code below:
import c4d
def main() :
curFrame = doc.GetTime().GetFrame(doc.GetFps())
if curFrame == 0:
spline = c4d.SplineObject(4, c4d.SPLINETYPE_BEZIER)
points = []
points.append(pos1)
points.append(pos2)
points.append(pos3)
points.append(pos4)
spline.SetAllPoints(points)
spline.SetTangent(1,tangent_1_VL,tangent_1_VR)
spline.SetTangent(2,tangent_2_VL,tangent_2_VR)
spline.InsertUnder(studioGeo)
c4d.EventAdd()
I can't seem to find a way to use User Data to control this spline's point attributes. Any help here would be appreciated.
Also is there a way to activate the Python Script in a way that is frame independent? Right now it's activated on frame 0 so if you play and rewind it'll create another spline.