Skip to content

Commit

Permalink
Merge branch 'develop' into info-paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc authored Nov 19, 2019
2 parents d2f35be + b0fe642 commit 836ba54
Show file tree
Hide file tree
Showing 143 changed files with 302,794 additions and 285,483 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true
[*]
insert_final_newline = true
end_of_line = 'lf'
[*.py]
charset = 'utf8'
trim_trailing_whitespace = true
indent_style = 'space'
indent_size = 4
[*.js]
charset = 'utf8'
trim_trailing_whitespace = true
indent_style = 'space'
indent_size = 2
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug Report
about: Create a bug report for a new issue
title: Give your bug report a descriptive title
labels: bug
labels: ':beetle: bug'
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature Request
about: Suggest a new idea to improve OpenShot
title: Give your feature request a descriptive title
labels: enhancement
labels: '💡 enhancement'
assignees: ''

---
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
2. Then enable 'Debug Mode (Verbose)' in the Preferences
3. Quit OpenShot and delete both log files:
* **Windows**: OpenShot stores its logs in your user profile directory (`%USERPROFILE%`, e.g. `C:\Users\username\`)
* **`%USERPROFILE%/.openshot_qt/openshot_qt.log`**
* **`%USERPROFILE%/.openshot_qt/openshot-qt.log`**
* **`%USERPROFILE%/.openshot_qt/libopenshot.log`**
* **Linux/MacOS**: OpenShot stores its logs in your home directory (`$HOME`, e.g. `/home/username/`)
* **`$HOME/.openshot_qt/openshot_qt.log`**
* **`$HOME/.openshot_qt/openshot-qt.log`**
* **`$HOME/.openshot_qt/libopenshot.log`**
4. Re-launch OpenShot and trigger the crash as quickly as possible (to keep the log files small)
5. Attach **both** log files
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ cd doc
make html
```

The documentation for the most recent release can be viewed online at [openshot.org/user-guide](https://www.openshot.org/user-guide/).

## Report a bug

Please report bugs using the official [Report a Bug](https://www.openshot.org/issues/new/)
Expand Down
4 changes: 2 additions & 2 deletions doc/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ Please download our latest daily installer:
- **Windows**: OpenShot stores its logs in your user profile
directory (``%USERPROFILE%``, e.g. ``C:\Users\username\``)

- ``%USERPROFILE%/.openshot_qt/openshot_qt.log``
- ``%USERPROFILE%/.openshot_qt/openshot-qt.log``
- ``%USERPROFILE%/.openshot_qt/libopenshot.log``

- **Linux/MacOS**: OpenShot stores its logs in your home directory
(``$HOME``, e.g. ``/home/username/``)

- ``$HOME/.openshot_qt/openshot_qt.log``
- ``$HOME/.openshot_qt/openshot-qt.log``
- ``$HOME/.openshot_qt/libopenshot.log``

4. Re-launch OpenShot and trigger the crash as quickly as possible (to
Expand Down
67 changes: 37 additions & 30 deletions freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,17 +191,20 @@ def find_files(directory, patterns):
src_files.append((os.path.join(PATH, "installer", "launch-linux.sh"), "launch-linux.sh"))

# Get a list of all openshot.so dependencies (scan these libraries for their dependencies)
pyqt5_mod_files = []
from importlib import import_module
for submod in ['QtWebKit', 'QtSvg', 'QtWebKitWidgets', 'QtWidgets', 'QtCore', 'QtGui', 'QtDBus']:
mod_name = "PyQt5.{}".format(submod)
import_module(mod_name)
pyqt5_mod_files.append(sys.modules.get(mod_name).__spec__.origin)

lib_list = [os.path.join(libopenshot_path, "libopenshot.so"),
"/usr/local/lib/libresvg.so",
"/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
] + pyqt5_mod_files

import subprocess
for library in [os.path.join(libopenshot_path, "libopenshot.so"),
"/usr/lib/python3/dist-packages/PyQt5/QtWebKit.cpython-34m-x86_64-linux-gnu.so",
"/usr/lib/python3/dist-packages/PyQt5/QtSvg.cpython-34m-x86_64-linux-gnu.so",
"/usr/lib/python3/dist-packages/PyQt5/QtWebKitWidgets.cpython-34m-x86_64-linux-gnu.so",
"/usr/lib/python3/dist-packages/PyQt5/QtWidgets.cpython-34m-x86_64-linux-gnu.so",
"/usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-34m-x86_64-linux-gnu.so",
"/usr/lib/python3/dist-packages/PyQt5/QtGui.cpython-34dm-x86_64-linux-gnu.so",
"/usr/lib/python3/dist-packages/PyQt5/QtDBus.cpython-34dm-x86_64-linux-gnu.so",
"/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so",
"/usr/local/lib/libresvg.so"]:
for library in lib_list:
p = subprocess.Popen(["ldd", library], stdout=subprocess.PIPE)
out, err = p.communicate()
depends = str(out).replace("\\t","").replace("\\n","\n").replace("\'","").split("\n")
Expand All @@ -211,26 +214,30 @@ def find_files(directory, patterns):
lineparts = line.split("=>")
libname = lineparts[0].strip()

if len(lineparts) > 1:
libdetails = lineparts[1].strip()
libdetailsparts = libdetails.split("(")

if len(libdetailsparts) > 1:
# Determine if dependency is usr installed (or system installed)
# Or if the dependency matches one of the following exceptions
# And ignore paths that start with /lib
libpath = libdetailsparts[0].strip()
libpath_folder, libpath_file = os.path.split(libpath)
if (libpath \
and not libpath.startswith("/lib") \
and not "libnvidia-glcore.so" in libpath \
and not libpath_file in ["libstdc++.so.6", "libGL.so.1", "libxcb.so.1", "libX11.so.6", "libasound.so.2", "libgcc_s.so.1 ", "libICE.so.6", "libp11-kit.so.0", "libSM.so.6", "libgobject-2.0.so.0", "libdrm.so.2"]) \
or libpath_file in ["libgcrypt.so.11", "libQt5DBus.so.5", "libpng12.so.0", "libbz2.so.1.0", "libqxcb.so"]:

# Ignore missing files
if os.path.exists(libpath):
filepath, filename = os.path.split(libpath)
external_so_files.append((libpath, filename))
if len(lineparts) <= 1:
continue

libdetails = lineparts[1].strip()
libdetailsparts = libdetails.split("(")

if len(libdetailsparts) <= 1:
continue

# Determine if dependency is usr installed (or system installed)
# Or if the dependency matches one of the following exceptions
# And ignore paths that start with /lib
libpath = libdetailsparts[0].strip()
libpath_folder, libpath_file = os.path.split(libpath)
if (libpath \
and not libpath.startswith("/lib") \
and not "libnvidia-glcore.so" in libpath \
and not libpath_file in ["libstdc++.so.6", "libGL.so.1", "libxcb.so.1", "libX11.so.6", "libasound.so.2", "libgcc_s.so.1 ", "libICE.so.6", "libp11-kit.so.0", "libSM.so.6", "libgobject-2.0.so.0", "libdrm.so.2"]) \
or libpath_file in ["libgcrypt.so.11", "libQt5DBus.so.5", "libpng12.so.0", "libbz2.so.1.0", "libqxcb.so"]:

# Ignore missing files
if os.path.exists(libpath):
filepath, filename = os.path.split(libpath)
external_so_files.append((libpath, filename))

# Manually add missing files (that were missed in the above step). These files are required
# for certain distros (like Fedora, openSUSE, Debian, etc...)
Expand Down
130 changes: 65 additions & 65 deletions src/blender/scripts/blinds.py
Original file line number Diff line number Diff line change
@@ -1,84 +1,85 @@
# OpenShot Video Editor is a program that creates, modifies, and edits video files.
# OpenShot Video Editor is a program that creates, modifies, and edits video files.
# Copyright (C) 2009 Jonathan Thomas
#
# This file is part of OpenShot Video Editor (http://launchpad.net/openshot/).
# This file is part of OpenShot Video Editor (http://launchpad.net/openshot/).
#
# OpenShot Video Editor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# OpenShot Video Editor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenShot Video Editor is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# OpenShot Video Editor is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenShot Video Editor. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU General Public License
# along with OpenShot Video Editor. If not, see <http://www.gnu.org/licenses/>.


# Import Blender's python API. This only works when the script is being
# run from the context of Blender. Blender contains it's own version of Python
# with this library pre-installed.
import bpy

# Load a font

def load_font(font_path):
""" Load a new TTF font into Blender, and return the font object """
# get the original list of fonts (before we add a new one)
original_fonts = bpy.data.fonts.keys()
# load new font
bpy.ops.font.open(filepath=font_path)
# get the new list of fonts (after we added a new one)
for font_name in bpy.data.fonts.keys():
if font_name not in original_fonts:
return bpy.data.fonts[font_name]
# no new font was added
return None
""" Load a new TTF font into Blender, and return the font object """
# get the original list of fonts (before we add a new one)
original_fonts = bpy.data.fonts.keys()

# load new font
bpy.ops.font.open(filepath=font_path)

# get the new list of fonts (after we added a new one)
for font_name in bpy.data.fonts.keys():
if font_name not in original_fonts:
return bpy.data.fonts[font_name]

# no new font was added
return None

# Debug Info:
# ./blender -b test.blend -P demo.py
# -b = background mode
# -P = run a Python script within the context of the project file


# Init all of the variables needed by this script. Because Blender executes
# this script, OpenShot will inject a dictionary of the required parameters
# before this script is executed.
params = {
'title' : 'Oh Yeah! OpenShot!',
'extrude' : 0.1,
'bevel_depth' : 0.02,
'spacemode' : 'CENTER',
'text_size' : 1.5,
'width' : 1.0,
'fontname' : 'Bfont',
'color' : [0.8,0.8,0.8],
'alpha' : 1.0,
'output_path' : '/tmp/',
'fps' : 24,
'quality' : 90,
'file_format' : 'PNG',
'color_mode' : 'RGBA',
'horizon_color' : [0.57, 0.57, 0.57],
'resolution_x' : 1920,
'resolution_y' : 1080,
'resolution_percentage' : 100,
'start_frame' : 20,
'end_frame' : 25,
'animation' : True,
}

#INJECT_PARAMS_HERE
params = {
'title': 'Oh Yeah! OpenShot!',
'extrude': 0.1,
'bevel_depth': 0.02,
'spacemode': 'CENTER',
'text_size': 1.5,
'width': 1.0,
'fontname': 'Bfont',

'color': [0.8, 0.8, 0.8],
'alpha': 1.0,

'output_path': '/tmp/',
'fps': 24,
'quality': 90,
'file_format': 'PNG',
'color_mode': 'RGBA',
'horizon_color': [0.57, 0.57, 0.57],
'resolution_x': 1920,
'resolution_y': 1080,
'resolution_percentage': 100,
'start_frame': 20,
'end_frame': 25,
'animation': True,
}

# INJECT_PARAMS_HERE

# The remainder of this script will modify the current Blender .blend project
# file, and adjust the settings. The .blend file is specified in the XML file
# that defines this template in OpenShot.
#----------------------------------------------------------------------------
# ----------------------------------------------------------------------------

# Modify Text / Curve settings
#print (bpy.data.curves.keys())
Expand All @@ -93,12 +94,12 @@ def load_font(font_path):
# Get font object
font = None
if params["fontname"] != "Bfont":
# Add font so it's available to Blender
font = load_font(params["fontname"])
# Add font so it's available to Blender
font = load_font(params["fontname"])
else:
# Get default font
font = bpy.data.fonts["Bfont"]
# Get default font
font = bpy.data.fonts["Bfont"]

text_object.font = font

text_object = bpy.data.curves["Subtitle"]
Expand Down Expand Up @@ -134,15 +135,14 @@ def load_font(font_path):
bpy.context.scene.frame_end = params["end_frame"]

# Animation Speed (use Blender's time remapping to slow or speed up animation)
animation_speed = int(params["animation_speed"]) # time remapping multiplier
new_length = int(params["end_frame"]) * animation_speed # new length (in frames)
animation_speed = int(params["animation_speed"]) # time remapping multiplier
new_length = int(params["end_frame"]) * animation_speed # new length (in frames)
bpy.context.scene.frame_end = new_length
bpy.context.scene.render.frame_map_old = 1
bpy.context.scene.render.frame_map_new = animation_speed
if params["start_frame"] == params["end_frame"]:
bpy.context.scene.frame_start = params["end_frame"]
bpy.context.scene.frame_end = params["end_frame"]
bpy.context.scene.frame_start = params["end_frame"]
bpy.context.scene.frame_end = params["end_frame"]

# Render the current animation to the params["output_path"] folder
bpy.ops.render.render(animation=params["animation"])

Loading

0 comments on commit 836ba54

Please sign in to comment.