Blender Git Loki

Git Commits -> Revision fd84183

Revision fd84183 by Paul Golter (master)
December 1, 2021, 13:58 (GMT)
Add layer and pass index parameters to rna_Image_gl_load

This patch adds a layer_idx and pass_idx parameter to the rna_Image_gl_load function. It exposes both to the Python API as optional parameters.
This allows python scripters to specifiy which layer and pass they want to load in to an OpenGL texture. Right now image.gl_load() always takes the first layer and first pass.
This is limiting when working with multilayer openEXRs.

With this patch scripters can do something like this:

```
pass_idx = area.spaces.active.image_user.multilayer_pass
layer_idx = area.spaces.active.image_user.multilayer_layer
image.gl_load(frame=0, layer_idx=layer_idx, pass_idx=pass_idx)
```

As the parameters are optional and default to 0, it should not break existing code.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D13435

Commit Details:

Full Hash: fd8418385c2e3b0cc9ff8a254c3f3e408d0565f9
Parent Commit: 1ef8ef4
Committed By: Jeroen Bakker
Lines Changed: +46, -3

1 Modified Path:

/source/blender/makesrna/intern/rna_image_api.c (+46, -3) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021