Page MenuHome

Python API (parent task)
Open, Confirmed, HighPublic

Description

Python API tasks for the 2.80 release.

Documentation

  • Gizmo and tool API
  • Object mode operator working on selected, visible, editable objects
  • Mesh edit mode operator working on multiple objects.

Examples

  • Verify API docs example still work
  • Broken text editor Python templates: Operator Mesh UV, UI Tool Simple

Missing APIs

Details

Type
To Do

Event Timeline

Brecht Van Lommel (brecht) triaged this task as Normal priority.

About the Draw API:

  • I'll add more documentation for GPUVertBuf, GPUVertFormat and GPUIndexBuf. They are not needed in many cases though.
  • I have no idea what gpu.select is useful for. So I can't really help documenting it right now. Maybe we should just leave this module private for now.
  • Personally I find it a bit confusing to use the gpu.matrix module. It's unclear to me what I depend on when I use it. Unfortunately the module has to be used when you want to use the builtin shaders. I'd expect that Blender can derive the view/projection matrix from the context I just have to provide the model matrix. Not sure what's the best way to handle it.
  • Maybe gpu.shader could be merged with gpu.types.GPUShader? Ideally it would have something like this: gpu.types.GPUShader.FromBuiltin(...), shader.vertexcode, shader.fragcode and shader.geocode. This also means that we'd have to store the source code for user defined shaders, but that would not be too bad imo.
  • I'm waiting for one thing to get merged (namely D3918) and then I'll make a new, probably a bit shorter example for GPUOffScreen and put it on the main gpu module page. Personally I think large examples a the one currently provided are not useful because they 1) make it look way too hard and 2) force developers to strip away a lot of code to understand what is actually required to get it working.
  • I agree that it would be cool to have batch_for_shader in the gpu module directly but it feels like I'm not in a position to make that decision.
Brecht Van Lommel (brecht) raised the priority of this task from Normal to Confirmed, High.Sun, May 19, 9:46 PM
Brecht Van Lommel (brecht) edited projects, added BF Blender; removed Code Quest.