8,452
edits
Paradox-01 (talk | contribs) mNo edit summary |
Paradox-01 (talk | contribs) m (scripting: get keyframes) |
||
Line 496: | Line 496: | ||
' '''[7] get keyframes''' | ' '''[7] get keyframes''' | ||
' keyframe counting code like "selection(0).rotx.Source.Keys.count" will produce an error if no keys exist | |||
' that's why we need catch possible errors for each counting | |||
on error resume next | |||
logmessage "--------------------------------------------------" | |||
logmessage "X rotation keys: " & selection(0).rotx.Source.Keys.count | |||
for each k in selection(0).rotx.Source.Keys | |||
logmessage "index: " & k.index & " // time: " & k.time & " // value: " & k.value | |||
next | |||
if err <> 0 then | |||
logmessage "no X rotation keys" | |||
end if | |||
on error goto 0 | |||
on error resume next | |||
logmessage "--------------------------------------------------" | |||
logmessage "Y rotation keys: " & selection(0).roty.Source.Keys.count | |||
for each k in selection(0).roty.Source.Keys | |||
logmessage "index: " & k.index & " // time: " & k.time & " // value: " & k.value | |||
next | |||
if err <> 0 then | |||
logmessage "no Y rotation keys" | |||
end if | |||
on error goto 0 | |||
on error resume next | |||
logmessage "--------------------------------------------------" | |||
logmessage "Z rotation keys: " & selection(0).rotz.Source.Keys.count | |||
for each k in selection(0).rotz.Source.Keys | |||
logmessage "index: " & k.index & " // time: " & k.time & " // value: " & k.value | |||
next | |||
if err <> 0 then | |||
logmessage "no Z rotation keys" | |||
end if | |||
on error goto 0 | |||
on error resume next | |||
logmessage "--------------------------------------------------" | |||
logmessage "X position keys: " & selection(0).posx.Source.Keys.count | |||
for each k in selection(0).posx.Source.Keys | |||
logmessage "index: " & k.index & " // time: " & k.time & " // value: " & k.value | |||
next | |||
if err <> 0 then | |||
logmessage "no X position keys" | |||
end if | |||
on error goto 0 | |||
on error resume next | |||
logmessage "--------------------------------------------------" | |||
logmessage "Y position keys: " & selection(0).posy.Source.Keys.count | |||
for each k in selection(0).posy.Source.Keys | |||
logmessage "index: " & k.index & " // time: " & k.time & " // value: " & k.value | |||
next | |||
if err <> 0 then | |||
logmessage "no Y position keys" | |||
end if | |||
on error goto 0 | |||
on error resume next | |||
logmessage "--------------------------------------------------" | |||
logmessage "Z position keys: " & selection(0).posz.Source.Keys.count | |||
for each k in selection(0).posz.Source.Keys | |||
logmessage "index: " & k.index & " // time: " & k.time & " // value: " & k.value | |||
next | |||
if err <> 0 then | |||
logmessage "no Z position keys" | |||
end if | |||
on error goto 0 | |||
' output example (0 rot keys, 2 pos keys): | |||
' INFO : -------------------------------------------------- | |||
' INFO : no X rotation keys | |||
' INFO : -------------------------------------------------- | |||
' INFO : no Y rotation keys | |||
' INFO : -------------------------------------------------- | |||
' INFO : no Z rotation keys | |||
' INFO : -------------------------------------------------- | |||
' INFO : X position keys: 2 | |||
' INFO : index: 0 // time: 2 // value: 5,14534318031942 | |||
' INFO : index: 1 // time: 6 // value: 8,2411504340802 | |||
' INFO : -------------------------------------------------- | |||
' INFO : Y position keys: 2 | |||
' INFO : index: 0 // time: 2 // value: 0,365325291829147 | |||
' INFO : index: 1 // time: 6 // value: 1,11923927115289 | |||
' INFO : -------------------------------------------------- | |||
' INFO : Z position keys: 2 | |||
' INFO : index: 0 // time: 2 // value: 1,96103417177471 | |||
' INFO : index: 1 // time: 6 // value: 1,88564277384233 | |||
edits