Ok, it works. This was the solution:
http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/FCurveKey.LeftTanX.html
Here my working example:
from win32com.client import constants as c
xsi = Application
log = Application.LogMessage
# Convenience function to get the user-friendly string describing the
contraint type
def GetConstraintType( in_fcrvkey ) :
ConstraintTypes = {
c.siParameterConstraint:"LockParameter",
c.siLeftRightValuesConstraint:"LeftRightParameter",
c.siG1ContinuousConstraint:"G1Continuous",
c.siLeftRightTangentDirectionConstraint:"LeftRightTangentDirection",
c.siLeftRightTangentLengthConstraint:"LeftRightTangentLength",
c.siLockConstraint:"LockAll",
c.siHorizontalTangentConstraint:"HorizontalTangent",
c.siExtremumHorizontalTangentConstraint:"ExtremumHorizontalTangent",
c.siAdjustedTangentConstraint:"AdjustedTangent",
c.siZeroLengthTangentConstraint:"ZeroLengthTangent",
c.siSameLengthTangentConstraint:"SameLengthTangent",
c.siNeighborTangentConstraint:"NeighborTangent",
c.siMirrorTangentConstraint:"MirrorTangent",
c.siAutoPlateauTangentConstraint:"AutoPlateauTangent"
}
str = ""
for k in ConstraintTypes.keys() :
if ( in_fcrvkey.Constraint(k) ) :
str += ConstraintTypes[k] + " "
return str
# Convenience function to print the FCurveKeys
def PrintKeys( in_fcrv ) :
for fckey in in_fcrv.Keys :
log("------------------------------------------------------")
log("key\t\t:\t" + str(fckey.Index))
log("frame\t\t:\t" + str(fckey.Time))
log("value\t\t:\t" + str(fckey.Value))
log("tangents:\t\t" + str(fckey.LeftTanX) + " | " +
str(fckey.LeftTanY) + " | " + str(fckey.RightTanX) + " | " +
str(fckey.RightTanY))
log("constraints\t:\t" + str(GetConstraintType( fckey )))
return None
fc = Application.Selection[0].posx.Source
key0 = fc.Keys(0)
key1 = fc.Keys(1)
key2 = fc.Keys(2)
PrintKeys( fc )
Andreas
On 12/18/2013 10:44 AM, Andreas Böinghoff wrote:
Hi Everyone,
without good math knowledge I try to get FCurve information via
scripting in python.
What I try to achive is, to get the tangent Points (time and value) of
a Key. (See image)
With the help of this script I get all key information:
http://download.autodesk.com/global/docs/softimage2013/en_us/sdkguide/index.html?url=si_cmds/GetKeyInfo.html,topicNumber=si_cmds_GetKeyInfo_html
How can I caluclate the time and value of the tangent point out of this.
' INFO : Key: 0
' KeyParam : 0.04
' LeftValue: 0
' RightValue: 0
' LeftTanParam: -0.299087049316944
' LeftTanValue: -14.6261458405396
' RightTanParam: 0.661960978223807
' RightTanValue: 32.3716383920979
' RightSegKind: 3
' Constraints: 4
Thanks!
Andreas
--
ANDREAS BÖINGHOFF
3D Artist
schönheitsfarm production
GmbH & Co. KG
schönheitsfarm
hamburg
lippmannstrasse 79
22769 hamburg
t +4940 432 91 200
f +4940 432 91 222
schönheitsfarm
düsseldorf
steinstraße 11
40212 düsseldorf
t +49211 913 701 0
f +49211 913 701 99
schönheitsfarm
frankfurt
hanauer landstrasse 151-153
60314 frankfurt
t +4969 484 484 90
w www.s-farm.de <http://www.s-farm.de/>
Geschäftsführung Manfred Brunwey
DE 214892548 | Amtsgericht Hamburg HRA 95793
--
ANDREAS BÖINGHOFF
3D Artist
schönheitsfarm production
GmbH & Co. KG
schönheitsfarm
hamburg
lippmannstrasse 79
22769 hamburg
t +4940 432 91 200
f +4940 432 91 222
schönheitsfarm
düsseldorf
steinstraße 11
40212 düsseldorf
t +49211 913 701 0
f +49211 913 701 99
schönheitsfarm
frankfurt
hanauer landstrasse 151-153
60314 frankfurt
t +4969 484 484 90
w www.s-farm.de <http://www.s-farm.de/>
Geschäftsführung Manfred Brunwey
DE 214892548 | Amtsgericht Hamburg HRA 95793