Add Blender clips to Pitivi
@cfoch
Submitted by César Fabián Orccón Chipana Assigned to César Fabián Orccón Chipana @cfoch
Description
Integrating Blender in Pitivi would make it powerful.
This idea come to my mind:
1. Blender file (.blend)
- It may contain an embedded script called pitivi.py.
- The pitivi.py should define a settings attribute. The idea of this is to set render settings and the scripts' settings. For example, in Blender you can have the scene of the intro of '20th Century Fox', being this text settable you could change this text with '1.0 Pitivi GES'. Think more about it
2.Importing
Import a Blender file (.blend), it would be just like any other asset to the media library.Before the assets get added to the media library, a dialog window appears displaying the settings.
2. Importing
- Click on import to import clip just like any other media, with the exception that it wouldn't add an asset to the media library.
A dialog window is opened, showing the settings that the user can set. Those settings are read from the embedded pitivi.py script.- The clip is directly added to the Timeline with deault settings.
3. Settings
- Clicking on a blender clip, creates a new tab "Blender Settings" in the middle (just next to 'Clip/Transition/Title).
- The new tab displays the settings the user can edit. Those settings are read from pitvi.py file
PROBLEMS
- Import [[ https://docs.blender.org/api/blender_python_api_2_78a_release/ | bpy ]] as a module outside Blender requires to [[ https://wiki.blender.org/index.php/User%3aIdeasman42/BlenderAsPyModule | build Blender from source ]].
- Inherit from a GstBase.PushSrc in Python leads to a [[ https://dpaste.de/ek8p#L48 | bug ]] with overriding vfuncs. The [[ https://git.gnome.org/browse/pygobject/tree/gi/types.py#n107 | problem is in pygobject. ]]
- [[ https://docs.blender.org/api/blender_python_api_2_62_2/info_gotcha.html | Python threading with Blender only works properly when the threads finish up before the script does. ]]
- In Blender renderer, one possibility could be to just catch the buffer before it is saved to disk. That's not possible, [[ https://docs.blender.org/api/blender_python_api_2_78a_release/ | bpy ]], because it should be written to disk.
SOME SOLUTIONS (enumerated by number of problem)
-
- It is always possible to use a Python module, in this case bpy from the [[ https://docs.python.org/3.5/c-api/intro.html | Python C-API ]] I was trying to [[ https://dpaste.de/Px3z | write a plugin ]] with that, but things are getting too large that makes me to think that it would be costly in the long-term. This plugin is not finished yet. It will be really large, so I've preferred to discuss about the 'correct' solution.
- [HARD] Modify Blender so it can handle buffers before rendering to disk.
- Use a frame server and a client that requests the frame server which frame to render.
Please, guys, help to find a good solution for it