Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python "no return values, shouldn't happen"
#7
The whole code is in my first post.  This is the section that should be returning the Gimp.Image
Code:
   def PrsLoad(self, procedure, run_mode, file, metadata, flags, config, run_data):
       print("PrsLoad called")

       #Return dummy image for now
       image = Gimp.Image.new(100, 100, Gimp.ImageBaseType.RGB)

       return_vals = procedure.new_return_values(Gimp.PDBStatusType.SUCCESS, None)
       val = GObject.Value(Gimp.Image.__gtype__, image)
       return_vals.append(val)
       
       return return_vals

Never mind, got it working.  Had to change my return statement to
Code:
return Gimp.ValueArray.new_from_values([
           GObject.Value(Gimp.PDBStatusType, Gimp.PDBStatusType.SUCCESS),
           GObject.Value(Gimp.Image, image),
       ]), flags
Reply


Messages In This Thread
RE: Python "no return values, shouldn't happen" - by Nathan - 3 hours ago

Forum Jump: