0

How to get "image.start" and similar parameters

Howdy,

Writing an RV plugin,...when RV has loaded several movie files,..the plugin does following

           sources = commands.nodesOfType("RVFileSource")

                  for i in range(0, len(sources) ):
                        media = commands.getStringProperty(sources[i] + ".media.movie")[0]
                        files = commands.existingFilesInSequence(media)

and can find the full path from  files[0] etc...

But I need to query each movie to get its duration, and/or start,end...

From the Reference Manual, it appears that one can simply do a:

            start = commands.getIntProperty(sources[i] + ".image.start")
            end   = commands.getIntProperty(sources[i] + ".image.end"  )


that throws an exception:

       Exception: Exception thrown while calling commands.getIntProperty -- exception: "invalid property name sourceGroup000000_source.image.start", program exception

What am I doing wrong?

Thanks!

Jim

 

3 comments

  • 0
    Avatar
    Jim Polk

    Found an alternative way,...like so:

     

            sources = commands.nodesOfType("RVFileSource")

            for i in range(0, len(sources) ):
                media = commands.getStringProperty(sources[i] + ".media.movie")[0]
                files = commands.existingFilesInSequence(media)

                info  = commands.sourceMediaInfo(sources[i], files[0])

                start = info['startFrame']
                end   = info['endFrame']

    There are some other parameters in the "info" dictionary...

    Still, I'd be curious why the original syntax doesn't work...

    Thanks,

    Jim

     

  • 0
    Avatar
    Alan Trombla

    Hi Jim,

    Glad you got something working.  About this:

    start = commands.getIntProperty(sources[i] + ".image.start")

    since sources[i] is an RVFileSource nodes, you can only set the properties listed here:

    http://www.tweaksoftware.com/static/documentation/rv/current/html/rv_reference.html#RVFileSource

    (Unless you create new custom properties yourself.)   There is no ".image.start" property on the RVFileSource, so trying to set it throws an exception.

    Cheers,

    Alan

  • 0
    Avatar
    Jim Polk

    Thanks Alan!...


    Btw,..can I get your thoughts on this: https://support.shotgunsoftware.com/entries/96049468

    Cheers,

     

Please sign in to leave a comment.