When python script title 3d crash display no file found

Bug #1789417 reported by Sefran on 2018-08-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenShot Video Editor
Undecided
Unassigned

Bug Description

When a python command returns an error, the interface displays a generated file picture not found.

I propose a debug patch that generates an image with the error, the line of code concerned and the system information useful for debugging.

We should create folder openshot into scripts openshot application.
Example path with manjaro :
/usr/lib/python3.7/site-packages/openshot_qt/blender/scripts/openshot/

put file debug.py into directory /usr/lib/python3.7/site-packages/openshot_qt/blender/scripts/openshot/

create file __init__.py :
sudo touch /usr/lib/python3.7/site-packages/openshot_qt/blender/scripts/openshot/__init__.py

Import can be do like this into 3DTitleScript.py:

import bpy, os, sys
directory = os.path.dirname(bpy.data.filepath)[:-5] + 'scripts/openshot'
if not directory in sys.path:
    sys.path.append(directory)
from debug import print_error

And for use :

#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
try:
    …
    my blender code
    pirnt("bug") #error code
    …
except Exception as E:
    print_error(sys.exc_info(), str(E))

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

Now when we preview the image the blender errors of python commands are viewable by the user.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers