Python API (parent task) #56351

Closed
opened 2018-08-13 13:57:30 +02:00 by Brecht Van Lommel · 13 comments

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.

Missing APIs

Note: this won't be done for 2.80!

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. ### Missing APIs *Note: this won't be done for 2.80!* * - [ ] Export objects at render resolution. Needs function to get/clear render resolution depsgraph for a scene and view layer? * - [ ] [Too difficult to set new collection as active ](https://devtalk.blender.org/t/set-active-collection/2409)
Author
Owner

Added subscriber: @brecht

Added subscriber: @brecht

blender/blender-addons#56621 was marked as duplicate of this issue

blender/blender-addons#56621 was marked as duplicate of this issue

#54626 was marked as duplicate of this issue

#54626 was marked as duplicate of this issue

Added subscriber: @AlfonsoAnnarumma

Added subscriber: @AlfonsoAnnarumma
Member

Added subscriber: @truman

Added subscriber: @truman
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

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.
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](https://archive.blender.org/developer/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.
Author
Owner

Added subscribers: @ideasman42, @mont29, @BrendonMurphy, @MikeErwin, @tetha.z, @dr.sybren, @BrianSavery, @dfelinto, @jasperge-2, @StephenSwaney, @JamesCrowther, @mano-wii, @VukGardasevic, @Sergey, @Ko, @RayMairlot, @KerimBorchaev, @satishgoda1, @Januz, @bliblubli, @jta, @lvxejay, @Jeroen-Bakker, @monique, @nathanvollmer, @vitorbalbio-3, @gfxcoder, @intrah, @NumesSanguis-3, @brita, @shiprex, @snuq

Added subscribers: @ideasman42, @mont29, @BrendonMurphy, @MikeErwin, @tetha.z, @dr.sybren, @BrianSavery, @dfelinto, @jasperge-2, @StephenSwaney, @JamesCrowther, @mano-wii, @VukGardasevic, @Sergey, @Ko, @RayMairlot, @KerimBorchaev, @satishgoda1, @Januz, @bliblubli, @jta, @lvxejay, @Jeroen-Bakker, @monique, @nathanvollmer, @vitorbalbio-3, @gfxcoder, @intrah, @NumesSanguis-3, @brita, @shiprex, @snuq

Added subscriber: @MACHIN3

Added subscriber: @MACHIN3
Author
Owner

It seems gpu.10.py is working fine, there was also a bugfix related to this recently.

It would be good if we could improve our Python API docs still, but I think everything that must be done for the release is ready now.

It seems `gpu.10.py` is working fine, there was also a bugfix related to this recently. It would be good if we could improve our Python API docs still, but I think everything that must be done for the release is ready now.

In #56351#708592, @brecht wrote:
It seems gpu.10.py is working fine, there was also a bugfix related to this recently.

This looks like an invalid module name to me. Module names are bound to the same rules as other Python names. gpu.v10.py or gpu_10.py would be valid.
Not sure in what "working fine" entails in detail, just pitching in without much context.

> In #56351#708592, @brecht wrote: > It seems `gpu.10.py` is working fine, there was also a bugfix related to this recently. This looks like an invalid module name to me. Module names are bound to the same rules as other Python names. `gpu.v10.py` or `gpu_10.py` would be valid. Not sure in what "working fine" entails in detail, just pitching in without much context.
Author
Owner

In #56351#749174, @dr.sybren wrote:
This looks like an invalid module name to me. Module names are bound to the same rules as other Python names. gpu.v10.py or gpu_10.py would be valid.
Not sure in what "working fine" entails in detail, just pitching in without much context.

These are never imported as a module so it's not a problem. It's just a naming convention for example code in the Python API docs.

> In #56351#749174, @dr.sybren wrote: > This looks like an invalid module name to me. Module names are bound to the same rules as other Python names. `gpu.v10.py` or `gpu_10.py` would be valid. > Not sure in what "working fine" entails in detail, just pitching in without much context. These are never imported as a module so it's not a problem. It's just a naming convention for example code in the Python API docs.
Author
Owner

Archiving old issue, these are either done or part of another issue.

Archiving old issue, these are either done or part of another issue.
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2023-03-21 19:26:47 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#56351
No description provided.