THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/06/2011 at 06:46, xxxxxxxx wrote:
Let me know what I could miss here.
Using SplineHelp() on a Primitive splineobject
(like Text) only segment 0 is possible.
Calling segment > 0 gets out of range.
Also, still calling segment 0, going to position 1.0 (100%) the position
jumps to next segments first position
Regular splines (Pointobjects with several segments) work as expected.
def main() :
segment = 0 # <- If spline is a Prim only segment 0 works
posUD = op[c4d.ID_USERDATA,1] # Userdata entry
spline = op[c4d.ID_USERDATA,2] # Userdata linkfield
if spline is None or spline.GetRealSpline() is None:
#print 'No Spline'
return False
shspline = SplineHelp()
rs = spline.GetRealSpline()
# try using rs in SplineHelp.InitSpline and "use_deformed_points" fail
# but segments >0 works
shspline.InitSpline(spline,c4d.Vector(0.0),None, False,True, False,True)
pos = shspline.GetPos(posUD , segment , True)
shspline.FreeSpline()
obj = op.GetObject()
objm = obj.GetMg()
objm.off = pos
obj.SetMg(objm)
Cheers
Lennart