THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 13/12/2011 at 00:57, xxxxxxxx wrote:
Hi,
Originally posted by xxxxxxxx
In the documentation, the GetOffSetFromUnit and GetOffsetFromReal have their discription swapped.
Thank you for the error report in the docs. I fixed it.
Originally posted by xxxxxxxx
And I just can't get any usable value from the GetTangent function. If the spline is a flat spline, it always returns Vector(0,1,0).
About SplineHelp.GetTangent(), you should try to use SplineObject.GetTangent() :
import c4d
from c4d import utils
def MakeEditable(op) :
if (not op) | op.CheckType(c4d.Ospline) : return op
op = [op.GetClone()]
doc = c4d.documents.BaseDocument()
doc.InsertObject(op[0], None, None)
op = c4d.utils.SendModelingCommand(command = c4d.MCOMMAND_MAKEEDITABLE,
list = op,
mode = c4d.MODELINGCOMMANDMODE_EDGESELECTION,
doc = doc)
return op[0]
def main() :
spline = MakeEditable(op)
if (not spline) | (not spline.CheckType(c4d.Ospline)) : return
for i in range(0, spline.GetTangentCount()) :
tangent = spline.GetTangent(i)
print tangent
if __name__=='__main__':
main()