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.
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.
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.
This could go into contrib, but theres still some odd code that would be nice to change beforehand.
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.
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.
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.