Maniphest T94051

Saving single image of image sequence: image.save_render(): Could not acquire buffer from image.
Confirmed, NormalTO DO

Assigned To
None
Authored By
Paul Golter (paulgolter)
Dec 14 2021, 10:16 AM
Tags
  • BF Blender
  • Python API
  • Images & Movies
  • Core
Subscribers
Brecht Van Lommel (brecht)
Campbell Barton (campbellbarton)
Paul Golter (paulgolter)
Philipp Oeser (lichtwerk)

Description

System Information
Operating system: Linux-5.15.5-76051505-generic-x86_64-with-glibc2.33 64 Bits
Graphics card: Radeon RX 590 Series (POLARIS10, DRM 3.42.0, 5.15.5-76051505-generic, LLVM 12.0.0) AMD 4.6 (Core Profile) Mesa 21.2.2

Blender Version
Broken: version: 3.1.0 Alpha, branch: master, commit date: 2021-12-14 05:17, hash: rBc097c7b855d4
Worked: (newest version of Blender that worked as expected)

Short description of error
When trying to call the .save_render() function via the PythonAPI on an image datablock that holds an image sequence Blender throws the "Could not acquire buffer from image. " error.

Exact steps for others to reproduce the error

  1. Load any image sequence in image editor.
  2. Call bpy,data.images[].save_render()

I appended a zip with an already prepared blend file and image sequence. You can use that for convenience.

Event Timeline

Paul Golter (paulgolter) created this task.Dec 14 2021, 10:16 AM

This hack fixes the error:

https://developer.blender.org/P2644

But it would propably require a nicer solution than that.

Brecht Van Lommel (brecht) added a subscriber: Brecht Van Lommel (brecht).Dec 14 2021, 5:21 PM

What do you need it to do?

Save the entire frame range? Or do you need a parameter so you can specify the frame to save?

Paul Golter (paulgolter) added a comment.EditedDec 15 2021, 10:15 AM

Hey @Brecht Van Lommel (brecht),

There are a couple of parameters that would be great to have to control the export:

-framenr
-layer index (for multilayer)
-pass index (for multilayer)

I already chatted with @Campbell Barton (campbellbarton) about this briefly and we were thinking that it would be great to be able to pass an ImageUser to functions like this and others that have similar problems. Currently there is no way to create an ImageUser with Python and a question would be how to handle the lifetime and storage of that ImageUser.

Campbell still wanted to get some opinions on how to approach this. Here a small extract out of that conversation:

  • Support image user as arguments to these functions.
  • Support either creating image users from Python or coercing data such as a dictionary into an image user.

Perhaps we could support image_user={"frame": 42, eye='LEFT'} - where RNA handles creating the image user for the lifetime of the function.

Would love to hear your opinion on this.

Paul Golter (paulgolter) added a subscriber: Campbell Barton (campbellbarton).Dec 15 2021, 10:21 AM
Brecht Van Lommel (brecht) added a comment.Dec 16 2021, 6:46 PM

Personally I would add individual arguments for frame/layer/pass rather than adding ImageUser as a concept to the API, but either way works.

Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.Jan 18 2022, 12:20 PM
Philipp Oeser (lichtwerk) added projects: Python API, Images & Movies.
Philipp Oeser (lichtwerk) changed the subtype of this task from "Report" to "To Do".
Philipp Oeser (lichtwerk) added a subscriber: Philipp Oeser (lichtwerk).
Bastien Montagne (mont29) added a project: Core.Jan 25 2022, 11:54 AM
Bastien Montagne (mont29) moved this task from Backlog to Long-term - Nice To Have on the Core board.Jan 25 2022, 12:37 PM