← Back to team overview

openshot.bugs team mailing list archive

[Bug 1789417] [NEW] When python script title 3d crash display no file found

 

Public bug reported:

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.

** Affects: openshot
     Importance: Undecided
         Status: New

** Attachment added: "library for print errors into 3D Title script python"
   https://bugs.launchpad.net/bugs/1789417/+attachment/5181738/+files/debug.py

-- 
You received this bug notification because you are a member of OpenShot
Bugs, which is subscribed to OpenShot Video Editor.
https://bugs.launchpad.net/bugs/1789417

Title:
  When python script title 3d crash display no file found

Status in OpenShot Video Editor:
  New

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 manage notifications about this bug go to:
https://bugs.launchpad.net/openshot/+bug/1789417/+subscriptions