letterboxing from Video Sequence Editor > Strip menu #41815

Closed
opened 2014-09-13 21:43:10 +02:00 by Robert Forsman · 17 comments

I have created an addon which makes it easy to letterbox VSE content that does not match the current scene's aspect ratio.

Since I don't have drag&drop I hope I can upload it via a comment.

I have created an addon which makes it easy to letterbox VSE content that does not match the current scene's aspect ratio. Since I don't have drag&drop I hope I can upload it via a comment.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @mutantbob

Added subscriber: @mutantbob
Author

Well, until you fix this tool to support regular file upload:

http://www.pasteall.org/53974/python

Well, until you fix this tool to support regular file upload: http://www.pasteall.org/53974/python

Added subscriber: @Genome36

Added subscriber: @Genome36
Member

Added subscriber: @BrendonMurphy

Added subscriber: @BrendonMurphy
Member

hi, Is there a wiki page for this addon with description & more information?
I think it would be good to add to contrib once documented.

hi, Is there a wiki page for this addon with description & more information? I think it would be good to add to contrib once documented.
Author
work in progress: http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Sequencer/Letterbox
Author

I've put my git repo on github.

https://github.com/mutantbob/blender-letterbox/blob/master/letterbox.py

The latest version has updated bl_info according to the guidelines IRC pointed me at.

I've put my git repo on github. https://github.com/mutantbob/blender-letterbox/blob/master/letterbox.py The latest version has updated bl_info according to the guidelines IRC pointed me at.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

This could go into contrib, but theres still some odd code that would be nice to change beforehand.

  • try/except used for reporting. Would prefer not to do this, instead report any problems and return False if the function fails.
  • also remove try/except for register.
  • if hasattr(src_strip, "scene"): - better check the src_strip.type == 'SCENE'. Same for other uses of hasattr to check strip types.
  • Line: # XXX what if the active strip is sound? or something else wrong?? - Just check if its a sound type and report an error in that case.
  • Line: 179, better keep our code G rated :)
This could go into contrib, but theres still some odd code that would be nice to change beforehand. - try/except used for reporting. Would prefer not to do this, instead report any problems and return `False` if the function fails. - also remove try/except for register. - `if hasattr(src_strip, "scene"):` - better check the `src_strip.type == 'SCENE'`. Same for other uses of `hasattr` to check strip types. - Line: `# XXX what if the active strip is sound? or something else wrong??` - Just check if its a sound type and report an error in that case. - Line: `179`, better keep our code G rated :)
Author

You're going to have to give me some more specific advice about removing try/except. If I don't catch the exception, then the user won't get any explanation for the failure at all. Also, I don't think the operator expects me to return False on failure. returning {'CANCELLED'} seems to be the preferred return value.

My current instinct is to stick with hasattr. python, being a dynamically typed language, leads me to assume that there might be some other strip (now or in the future) with a scene property, and of all the changes likely to happen, this way seems most future-proof. It is not 100% future proof, but all the scenarios where it isn't will need code changes anyway.

Sound strips: done.

179, fixed. I really should not need that if clause, but something somewhere is insane. Look at that code and tell me why it ever gets called.

You're going to have to give me some more specific advice about removing try/except. If I don't catch the exception, then the user won't get any explanation for the failure at all. Also, I don't think the operator expects me to return False on failure. returning {'CANCELLED'} seems to be the preferred return value. My current instinct is to stick with hasattr. python, being a dynamically typed language, leads me to assume that there might be some other strip (now or in the future) with a scene property, and of all the changes likely to happen, this way seems most future-proof. It is not 100% future proof, but all the scenarios where it isn't will need code changes anyway. Sound strips: done. 179, fixed. I really should not need that if clause, but something somewhere is insane. Look at that code and tell me why it ever gets called.

@mutantbob.

re: try/except, You don't need this to report issues to the user, you can check scripts that come with Blender, where reporting is managed without exception handling. (You can pass the report method as an argument to the function for eg).

re: "hasattr", This is fine if you inspect data and want to check what it supports. But in this case you should be specific about what strips you operate on.

@mutantbob. re: try/except, You don't need this to report issues to the user, you can check scripts that come with Blender, where reporting is managed without exception handling. (You can pass the report method as an argument to the function for eg). re: "hasattr", This is fine if you inspect data and want to check what it supports. But in this case you should be specific about what strips you operate on.
Author

I stopped throwing exceptions and now return success/fail values.

I removed the "hasattr" futureproofing for most cases, but left it in as guidance for the features currently missing from blender.

I stopped throwing exceptions and now return success/fail values. I removed the "hasattr" futureproofing for most cases, but left it in as guidance for the features currently missing from blender.

Added subscriber: @mont29

Added subscriber: @mont29

Added subscriber: @JohannesThomasMeyer

Added subscriber: @JohannesThomasMeyer
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Brendon Murphy self-assigned this 2017-02-24 10:52:43 +01:00
Member

over 18 months old.
Archived

over 18 months old. Archived
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#41815
No description provided.