-1

I want to get the information from the fields in the shotlist (in the camera sequencer). The shotname I've solved:

test = cmds.getAttr('shot1.sn')
print test

But the rest.. I'm stuck. When I try to call the other arguments like startTime I get all kinds of errors depending of how I try to do it.

Bsquare ℬℬ
  • 4,423
  • 11
  • 24
  • 44
Fantasi
  • 3
  • 1
  • 1
    could you provide some test and errors ? Per example what did you try with the startTime ? Im not familiar with the camera sequencer. Try the echo all command to find out what kind of command are triggered while manipulating the ui. You can then debug by using the MEL command whatIs to find where are the procs and what they really do. – DrWeeny Dec 10 '18 at 09:11

1 Answers1

1

Welcome to SO, Fantasi.

You're giving a very vague question, so in return you're going to get a very vague answer.

You can get a list of your shots by using cmds.listConnections on your sequencer object. After, use a for loop and get a shot's info by using cmds.getAttr like this:

shots = cmds.listConnections("sequencer1", type="shot") or []  # Get a list of all shots from the sequencer.

for shot in shots:
    shot_name = cmds.getAttr("{}.shotName".format(shot))  # Query shot's name.
    start_frame = cmds.getAttr("{}.startFrame".format(shot))  # Query shot's start frame.
    end_frame = cmds.getAttr("{}.endFrame".format(shot))  # Query shot's end frame.
    print shot_name, start_frame, end_frame  # Print out shot's info.

Example output of a sequencer with 2 shots:

Output:

shot 1.0 50.0

shotEnd 51.0 120.0

If you're unsure about the shot object's attribute names then you can find them here.

If you still have problems I suggest you paste the error message from the Script Editor so we can diagnose what's wrong.

Green Cell
  • 4,677
  • 2
  • 18
  • 49