rjTimelineMarker package

Module contents

Create coloured markers on top of Maya’s native timeline. Comments can be added to each marker that appear as tool tips.

https://github.com/robertjoosten/rjTimelineMarker/raw/master/README.gif

Link to Video

Installation

Copy the rjTimelineMarker folder to your Maya scripts directory

C:/Users/<USER>/Documents/maya/scripts

Usage

Add the interface and functionality to Maya

import maya.cmds as cmds
cmds.evalDeferred(
    "import rjTimelineMarker; rjTimelineMarker.install()"
)

This line of code can also be added in the userSetup.py if you would like the functionality to persist.

Note

The UI elements are added to the timeline menu and can be accessed by right clicking on the timeline. You have the option to change the color of your marker points and also add comments where necessary. ToolTips will appear to show the comment while hovering over the timeline. The markers are stored in the maya file.

Hotkey

The hotkey function can be used to setup hotkeys to manage the timeline markers. There are three options, this is to either add, remove or clear the markers. Make sure the language is set to python.

import rjTimelineMarker
rjTimelineMarker.hotkey('add')
rjTimelineMarker.hotkey('remove')
rjTimelineMarker.hotkey('clear')

Command Line

The following functions can be used outside of the ui. Make sure the language is set to python.

import rjTimelineMarker 
rjTimelineMarker.add(frame, color, comment)
rjTimelineMarker.remove(frames)
rjTimelineMarker.clear()
rjTimelineMarker.set(frames, colors, comments)

Code

rjTimelineMarker.add(*args, **kwargs)

Use this function to add markers with the provided arguments. If a marker already exists on the provided frame number, the old data will be overwritten.

Parameters:
  • timelineMarker (TimelineMarker) – decorator handles this argument
  • frame (str) – Frame number
  • color (str) – Color list [R, G, B], values between 0-255
  • comment (str) – Comment
rjTimelineMarker.clear(*args, **kwargs)

Use this function to remove all markers.

Parameters:timelineMarker (TimelineMarker) – decorator handles this argument
rjTimelineMarker.getTimelineMarker(func)

This decorator will only run the function if the timeline marker can be found, if this is not the case an error will be raised. The timeline marker will be parsed as the first argument into the function provided.

Raises:ValueError – if timeline marker cannot be found in globals
rjTimelineMarker.hotkey(*args, **kwargs)

Use this function to setup hotkeys that interact with the timeline marker. There are 3 actions available ( “add”, “remove”, “clear” ).

  • Add - Add markers at the selected time.
  • Remove - Remove markers at the selected time.
  • Clear - Remove all markers.
Parameters:
  • timelineMarker (TimelineMarker) – decorator handles this argument
  • action (str) – Hotkey action
rjTimelineMarker.install()

Add the marker functionality to Maya’s native timeline menu. If rjTimelineMarker is already installed it will remove the previous instance.

rjTimelineMarker.remove(*args, **kwargs)

Use this function to remove markers with the provided arguments.

Parameters:
  • timelineMarker (TimelineMarker) – decorator handles this argument
  • frames (list) – Frame numbers
rjTimelineMarker.set(*args, **kwargs)

Use this function to overwrite the entire marker data set with the provided arguments. All existing markers will be removed.

Parameters:
  • timelineMarker (TimelineMarker) – decorator handles this argument
  • frames (list) – Frame numbers
  • colors (list) – Color list [R, G, B], values between 0-255
  • comments (list) – Comments