pyaaf icon indicating copy to clipboard operation
pyaaf copied to clipboard

trying to test out the retime test but cant find module parameter

Open RFShaun opened this issue 7 years ago • 2 comments

Hello!

Trying to try and read the retime information and speed information on an AAF with some 6 clips on the timeline [AAF is called test.aaf] this is my code, taken from the retime example:

`import aaf
import aaf.util
import aaf.mob
import aaf.define
import aaf.iterator
import aaf.dictionary
import aaf.storage
import aaf.base
import aaf.component

import unittest
import traceback

import os

import uuid

f = aaf.open('test.aaf', 'r')
comp = f.storage.toplevel_mobs()[0]

seqs = [item.segment for item in comp.slots()]
print seqs
op_group = seqs[0].components()[0]

speed_map = None
offset_map = None

speed_map = op_group.parameter['PARAM_SPEED_MAP_U']
offset_map = op_group.parameter['PARAM_SPEED_OFFSET_MAP_U']`

but all i get is

[<aaf.component.Timecode at 0x10e77a408>, <aaf.component.Pulldown at 0x10e77a380>, <aaf.component.Timecode at 0x10e77a490>, <aaf.component.Timecode at 0x10e77a518>, <aaf.component.Pulldown at 0x10e77a5a0>, <aaf.component.Pulldown at 0x10e77a628>, <aaf.component.Pulldown at 0x10e77a6b0>, <aaf.component.EdgeCode at 0x10e77a738>, <aaf.component.Sequence at 0x10e77a7c0>, <aaf.component.Sequence at 0x10e77a848>, <aaf.component.Sequence at 0x10e77a958>, <aaf.component.Pulldown at 0x10e77a8d0>]
Traceback (most recent call last):
  File "/Users/shaunansari/Desktop/pyaaf_test 2", line 23, in <module>
    op_group = seqs[0].components()[0]
AttributeError: 'aaf.component.Timecode' object has no attribute 'components'
[Finished in 0.4s with exit code 1]

not sure what im doing wrong, super new to this and very excited to start pulling and reading AAF's ! would love some help here trying to decant the speed and retime information from an AAF along with eventually scaling and transform information too.

RFShaun avatar Oct 14 '18 06:10 RFShaun

Sorry for the late reply, the sequence containing the operationGroup with the retime in your case looks like it's not at seqs[0]. Looks like its might be index 8,9,10 or 11. One of those <aaf.component.Sequence> objects should hopefully contain the operationGroup your looking for.

markreidvfx avatar Oct 23 '18 04:10 markreidvfx

Thanks mark I’ll just give it a spin and get back to you Glad to know this is possible

Sent from my iPhone

On Oct 23, 2018, at 12:45 PM, Mark Reid [email protected] wrote:

Sorry for the late reply, the sequence containing the operationGroup with the retime in your case looks like it's not at seqs[0]. Looks like its might be index 8,9,10 or 11. One of those <aaf.component.Sequence> objects should hopefully contain the operationGroup your looking for.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

RFShaun avatar Oct 23 '18 04:10 RFShaun