Blender 2.5 title editor

Publish your Openshot tutorials here.

Moderators: Andy, Cenwen, beats

Blender 2.5 title editor

Postby geoadel » Mon Jul 12, 2010 3:36 pm

Update: **** added some of my current understandings a few posts below and shared a few adaptations I did so far ****

Hi there,

hope this is the right forum. Just built openshot for the first time using the wonderful auto build wizard from the download page (nearly all the way down) (though it is not aware of ubuntu > 9.10 it worked non the less for me, not sure if there are bad side effects though, it installed quite a lot ;D ).

Experimented a bit with this great new feature and noticed that it does not work with newer Blender build after 2.5 alpha 2. Reason being the ever changing Blender Python API. So for another first time today I dived into the very easy python files of OpenShot and tried to remap them so they work with newer revisions of blender (like those found on http://www.graphicall.org).

The error message was misleading a bit:
Blender, the free open source 3D content creation suite is required for this action (http://www.blender.org).
Please check the preferences in OpenShot and be sure the Blender executable is correct. This setting should be the path of the 'blender' executable on your computer. Also, please be sure that it is pointing to Blender version 2.5 or greater.
Blender Path:
/home/xxxxx/Programs/Graphics/blender25/trunk/30011/blender

but the console gave the python errors and thus made debugging quite easy (as soon as I knew where to find the blender API calls ;) ).

So attached you can find an adapted version of fly_by_1.txt (which goes into the openshot/blender/scripts/ directory and be renamed and replacing fly_by_1.py [the forum does not allow py attachments sadly]).
This should work flawlessly, the other py scripts would need to be changed accordingly for them to work as well of course :) If someone feels like having half an hour to go through them be my guest :D

Hope this helps getting started with this wonderful new feature - will try to see what I can come up with (already have some things like changing light color in my head - will have to find the python command for it...).
Warm regards and thanks to all the developers for this wonderful piece of software!

P.S.: Could not find the render settings / or if it is file quality did not know how to set it, so i commented it out
http://www.blender.org/documentation/25 ... le_quality
Found the light color settings and am glad I adapted the script because in alpha 2 the lights do not update but in newer revisions this seems to work well :)
Attachments
fly_by_1.txt
adapted python script for fly_by blender animation - worked with revision 30011 in ubuntu lucid)
(3.97 KiB) Downloaded 126 times
Last edited by geoadel on Tue Jul 13, 2010 10:45 pm, edited 1 time in total.
geoadel
New member
 
Posts: 6
Joined: Mon Jul 12, 2010 12:29 pm

Re: Blender 2.5 title editor

Postby Cenwen » Mon Jul 12, 2010 9:10 pm

Thanks a lot.
For the error, you have seen that you have done an error writing the path for Blender.
I explain (in French, sorry) how install this version in the comments .You will see that you must install the Blender2.5(aplha) directly in your home and not in a special folder. That can , perhaps , explain why you have some difficulties to work with the blender files. :?
Le jour où j'ai découvert le libre, j'ai su que je ne reviendrai jamais en arrière
Mon blog sur le multimédia, la photo et Openshot : http://linuxevolution.wordpress.com/
Google+ : https://plus.google.com/u/0/111472725110173916234/posts
User avatar
Cenwen
Moderator
 
Posts: 1609
Joined: Wed Nov 18, 2009 4:07 pm
Location: Clermont-Ferrand-Auvergne-France

Re: Blender 2.5 title editor

Postby geoadel » Tue Jul 13, 2010 9:53 am

Hey Cenwen,

no the path is correct and blender now works - the problem really was the changed API calls.
In Blender 2.5 Alpha 2, setting the font works like this:
Code: Select all
font = bpy.data.vfonts[params["fontname"]]

In new builds (tested with 30011) it does not work but instead you have to use this:
Code: Select all
font = bpy.data.fonts[params["fontname"]]


The error though really just indicates, that the path may be wrong or the version too old. And actually the version is 'too new' and secondly the path is not a problem at all! The same inaccurate error message comes up actually with any error in the python script - so it may confuse users into thinking the path is wrong when in reality the blender version is too new.

Btw. made my first title-thingy in blender - the interface really is very nice and adapting the files is very easy! That is wonderful for someone not too deep in programming like me :D I attached the files, have fun!

There are two issues I still have though:
1. The previews are always rendered in the projects full size, which is bad / slow for just checking different colors or other settings (should probably adjust to the size of the preview window) [comment: just built newest revision and this works perfectly now :mrgreen: ]
2. If a preview rendering is aborted by clicking the 'cancel' button in the 'animated title editor' window, the blender process runs forever until killed manually (which amounted to five renders at the same time and I was asking myself why the computer had gotten so slow until I checked the command line with the running processes ;) ). [probably not so much an issue if issue 1 can be fixed]

I realize this probably is still in development but just two user-suggestions I thought I'd throw in - already very happy with the ease of use and adaptation possibilities - THANK YOU! :D

Attached my new style - a fly in from below to the bottom border of the screen with title and background bar thingy...

Made a quick demonstration video of the effect:
Attachments
fly_in_bar.zip
fly in animation - unpack into openshot/blender/ directory and keep directory structure - works with newer Blender revisions (tested with 30011) - Blender Python API still not stable, so no guarantees.
(210.8 KiB) Downloaded 90 times
geoadel
New member
 
Posts: 6
Joined: Mon Jul 12, 2010 12:29 pm

Re: Blender 2.5 title editor

Postby geoadel » Tue Jul 13, 2010 10:31 pm

and another fly in effect :)


Just so this makes more sense to post this in the tutorial section I'll make some comments on the file structure (as far as I understand them)

.xml files contain the informations (fields, their type and default values) for the graphical user interface dealing with 3d title animations in openshot
.py files use scripts to transform the informations from the graphical user interface in open shot (defined by the xml file) into blender settings for the .blend files
.blend files contain the 'scene' with all materials, objects, animations, fonts, etc to be used as title animation

For fly_in_2 I basically copied the files from fly_in_1 and changed them accordingly.

Very important is changing the file references in the xml files (otherwise the icon and script and blend file of the original fly_in_1 will be used). They look like this:
Code: Select all
   <icon>fly_in_2.png</icon>
   <service>fly_in_2.blend</service>


Whenever you want to make a property of the blend-file accessible to the user in openshot (like colors or lighting), you need to make a corresponding entry in the xml-file. For example setting the lamp-color looks like this:
Code: Select all
<param name="secondary_light_color" type="color" title="Light highlights" description="">
      <default>#ff8833</default>
   </param>

The parameter needs a name (which is used in the py file as well), a type, title, description and default value.

Now the user can select and change this parameter in the openshot 'New animated title' interface. But before this really works, we have to change the .py file accordingly. For setting the lamp light, we have to add a parameter for it at the beginning of the file:
Code: Select all
         'secondary_light_color' : [0.55,0.65,0.6],

This contains the parameter name (needs to be the same as in the xml file) and a default value, which usually will be overwritten. Not sure yet, why we need two default values in two files....

Now to actually set the light color, we have to write a small python script for it, which will look like that:
Code: Select all
# Change secondary light color
lamp_object = bpy.data.lamps['Spot.001']
lamp_object.color = params["secondary_light_color"]

The first line loads the lamp into an object called lamp_object. All blender python accesses seem to use bpy as main class.
The second assigns the parameter we defined at the start of the py file to the lamp_object color value.

The blend file really requires to get to know blender to understand it - and that is not a task for a five-minute get-to-know session :D
I'll continue sharing whenever I find something new!

Next I'll try to convert the text object to a mesh object because there are many things you can do with a mesh you cannot do with a text object (like adding an explode modifier :D). Or I'll find some useful ideas for good titles ;)

Thanks again for this nice and easy to use piece of software!
Attachments
fly_in_2.zip
another fly in effect with a box and title
(156.79 KiB) Downloaded 90 times
geoadel
New member
 
Posts: 6
Joined: Mon Jul 12, 2010 12:29 pm

Re: Blender 2.5 title editor

Postby Cenwen » Wed Jul 14, 2010 8:00 pm

Thanks for the explanations and the first new titles.
Personally i like the first :D
Could you do the same for all the others side ?
Thanks.
Le jour où j'ai découvert le libre, j'ai su que je ne reviendrai jamais en arrière
Mon blog sur le multimédia, la photo et Openshot : http://linuxevolution.wordpress.com/
Google+ : https://plus.google.com/u/0/111472725110173916234/posts
User avatar
Cenwen
Moderator
 
Posts: 1609
Joined: Wed Nov 18, 2009 4:07 pm
Location: Clermont-Ferrand-Auvergne-France

Re: Blender 2.5 title editor

Postby geoadel » Thu Jul 15, 2010 6:24 pm

Hey Cenwen,

thanks for the feedback :D I'll see what I can accomplish during the next weekend - I am still experimenting with changing visibility of objects due to user input (so I do not need four different blends but one in which the user can choose the direction ;) ).

In the meantime had fun with a toy train (will have to work a bit more on it - very limited options for now, but in a way cute). Still learning blender and someone more experienced could whip this into gorgeous shape :D



Will upload the corresponding files tomorrow when I have a bit more time ;)
geoadel
New member
 
Posts: 6
Joined: Mon Jul 12, 2010 12:29 pm

Re: Blender 2.5 title editor

Postby Cenwen » Fri Jul 16, 2010 1:42 pm

thanks for the feedback :D I'll see what I can accomplish during the next weekend - I am still experimenting with changing visibility of objects due to user input (so I do not need four different blends but one in which the user can choose the direction ;) ).

Marvellous. :mrgreen:

And it is a very beautiful little train. Can we modified the speed ? it is a little bit fast for me. :lol:

In all cases, good exploration and continuation.
Le jour où j'ai découvert le libre, j'ai su que je ne reviendrai jamais en arrière
Mon blog sur le multimédia, la photo et Openshot : http://linuxevolution.wordpress.com/
Google+ : https://plus.google.com/u/0/111472725110173916234/posts
User avatar
Cenwen
Moderator
 
Posts: 1609
Joined: Wed Nov 18, 2009 4:07 pm
Location: Clermont-Ferrand-Auvergne-France

Re: Blender 2.5 title editor

Postby Cenwen » Sat Jul 17, 2010 8:11 pm

Le jour où j'ai découvert le libre, j'ai su que je ne reviendrai jamais en arrière
Mon blog sur le multimédia, la photo et Openshot : http://linuxevolution.wordpress.com/
Google+ : https://plus.google.com/u/0/111472725110173916234/posts
User avatar
Cenwen
Moderator
 
Posts: 1609
Joined: Wed Nov 18, 2009 4:07 pm
Location: Clermont-Ferrand-Auvergne-France

Re: Blender 2.5 title editor

Postby Jonathan » Thu Aug 26, 2010 5:09 am

@geoadel,
These animations look nice. Thanks for the the help fixing the unstable Blender Python 2.5 API. I have just committed these same changes to all the blender .py files in OpenShot. They now work with the newest 2.5 beta.

However... Blender 2.53 beta seems super unstable. It crashes 1 out of every 2 clicks, when trying to render the previews. I saw this was already mentioned as an issue on the Blender development site: http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Scripting.

I really hope the Blender developers can fix this, or this feature will be so unstable that nobody will want to use it.

Also, I would love to include some of you titles in the official version of OpenShot. My only suggestion would be make the animations longer... and thus slower. They are pretty, but move a bit too fast to read. So, please feel free to be as creative as you want and make some awesome Blender titles for the next release. =)

Thanks!
-Jonathan
User avatar
Jonathan
Openshot Creator
 
Posts: 41
Joined: Sun Nov 22, 2009 4:11 am
Location: TX, USA

Re: Blender 2.5 title editor

Postby Jonathan » Thu Aug 26, 2010 6:01 am

Also, I just committed a few updates to the animated titles / blender screen in OpenShot. Now, closing the window or clicking the cancel button now kills the blender process and adds the partial animation to your project. Also, the error message no longer closes the window... due to the number of errors that are randomly happening in the current Blender 2.53 API. So, you can just click the button again and hope Blender does not crash.
User avatar
Jonathan
Openshot Creator
 
Posts: 41
Joined: Sun Nov 22, 2009 4:11 am
Location: TX, USA

Re: Blender 2.5 title editor

Postby geoadel » Thu Sep 16, 2010 7:03 pm

Sorry for replying sooo late... lots of real life stuff in between :)

Cool article Cenwen! Thanks for that, did not have time to respond at that time so I could not share the joy and pride of feeling my humble work displayed at your blog, but it was a nice feeling and at last I can share that with you :D Thank you for that!

And Jonathan, thanks for your wonderful work as well... especially of course mixing my two favourite multimedia tools on my laptop, blender and openshot!

Here are all my title blend files to play with... made the directions of the two fly in bars in separate blend files. Slowed the fly_in_bar and toytrain down a bit, to be more easily readable. The speed can easily be adjusted though by just marking all animation curves and scaling them along the x axis in blender!
By scaling the animation along the y-axis in the f-curve editor, I changed the up-down movement direction. That is how I made the different versions (in adition to scaling the mesh x*-1 and moving it a bit along the z-axis (you have to do that in the f-curve-editor with the curve responsible for the z-axis to adjust it permanently)).

openshot-blender.zip
Openshot blender title animations:
Trees (with some tree images flying with the text towards the camera - could be improved by some dof).
Defocus - some text changing from strong DOF-blur to clear to strong DOF-blur. Fades in and out using alpha animated alpha value.
ToyTrain - a toy train coming from left to right
Blinds - some 'wooden' blinds coming down with two text lines in the middle
fly-in-bar1 - funky fly in bar (see above)
fly-in-bar2 - more metally fly in bar with black border (see above)
(1.91 MiB) Downloaded 129 times


It contains only the blend files because I did not have time to create the additional files as well. I have some ideas for later as well :)

Warm regards
geoadel
New member
 
Posts: 6
Joined: Mon Jul 12, 2010 12:29 pm

Re: Blender 2.5 title editor

Postby Cenwen » Thu Sep 16, 2010 7:48 pm

Hi,
It was just normal for all your great work and it is at time for the next version. I inform Jonathan for that. :o
And yet thanks a lot. :lol:
Le jour où j'ai découvert le libre, j'ai su que je ne reviendrai jamais en arrière
Mon blog sur le multimédia, la photo et Openshot : http://linuxevolution.wordpress.com/
Google+ : https://plus.google.com/u/0/111472725110173916234/posts
User avatar
Cenwen
Moderator
 
Posts: 1609
Joined: Wed Nov 18, 2009 4:07 pm
Location: Clermont-Ferrand-Auvergne-France

Re: Blender 2.5 title editor

Postby Jonathan » Thu Sep 16, 2010 8:25 pm

These animations are great! I just glanced through them, but I'm very impressed. I will start integrating them into the bzr trunk tonight. Thanks again for your help!
User avatar
Jonathan
Openshot Creator
 
Posts: 41
Joined: Sun Nov 22, 2009 4:11 am
Location: TX, USA

Re: Blender 2.5 title editor

Postby geoadel » Fri Sep 17, 2010 5:00 pm

Hey there,

thanks for implementing them, already playing with revision 237 :)
I noticed, that the defocus blur is really slow (at least on my old laptop), so I created a version that uses the normal 'Filter'-'Blur' node instead of defocus and is a lot faster but in general provides nearly the same effect.

Attached the blend, py (just a renamed copy of defocus.py), and adapted xml (to point to the correct py, blend and icon).
Here a test video of the blur-effect:


And here directly from blender the defocus effect:


And an effect called trees (text between vector abstract trees):


Another thing I am thinking about is the issue of different screen ratios resulting in the trees floating in 4:3 displays - should we offer blender script sets for different aspect ratios (basically just 4:3 and 16:9 probably for a start)? They could be chosen as the aspect ratio of the movie is set...
Attachments
blender-blur-title.zip
the icon is not entirely correct (just copied it from defocus...)
(71.86 KiB) Downloaded 104 times
geoadel
New member
 
Posts: 6
Joined: Mon Jul 12, 2010 12:29 pm

Re: Blender 2.5 title editor

Postby Cenwen » Sat Sep 18, 2010 11:06 am

Hi,
Very interesting :lol:
I like really the first and for the second could have a cloud more thick ? I know i ask a lot but i find it not enough thick. :?
Le jour où j'ai découvert le libre, j'ai su que je ne reviendrai jamais en arrière
Mon blog sur le multimédia, la photo et Openshot : http://linuxevolution.wordpress.com/
Google+ : https://plus.google.com/u/0/111472725110173916234/posts
User avatar
Cenwen
Moderator
 
Posts: 1609
Joined: Wed Nov 18, 2009 4:07 pm
Location: Clermont-Ferrand-Auvergne-France


Return to Tutorials

Who is online

Users browsing this forum: No registered users