Eyeon:Script/Reference/Applications/Fusion/Classes/Input/GetKeyFrames

From VFXPedia

Jump to: navigation, search

Contents

Input : GetKeyFrames()

Arguments

table = GetKeyFrames()

Returns

Returns a table containing all keyframes on a tool control object. If a tool control is not animated with a spline this function will return nil.

Remarks

The GetKeyFrames() function is used to determine what frames of an input have been keyframed on a spline. It returns a table that shows at what frames the user has defined key frames for the input. This could be used to see at what times a tool's comments have had animation on them after which a script could use that information to display the comment value at various times to the user.

Requirements

  • eyeonScript 5.0
  • Fusion 5.0

Examples

-- Toolscript
 
-- Finds all comments for tool. Checks to see if it's animated.
 
message = ""
 
if tool.Comments then
   if tool.Comments[TIME_UNDEFINED] == "" then
      -- Make sure the comments aren't animated.
      -- If the tool's comments are "connected" to a spline, the 
      -- GetConnectedOutput() function should return a value.
 
      if tool.Comments:GetConnectedOutput() then
 
         -- If they are, search for the keyframes.
         message = message.. "   --ANIMATED COMMENTS \n"               
 
         --GetKeyFrames() returns a table with all key frames.
         x = tool.Comments:GetKeyFrames()
 
         for k, keyframe in x do
            message = message.. " FRAME "..keyframe..":"..tool.Comments[keyframe].."\n"
         end
      else
         message = tool.Comments[TIME_UNDEFINED] .. "\n"
      end
   end
end
 
dump(message)


Tips for GetKeyFrames (edit)

EyeonTips:Script/Reference/Applications/Fusion/Classes/Input/GetKeyFrames