Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2022-09-02 15:33:29 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2022-09-02 15:39:09 +0300
commit8cfca8e1bd85a300732d92b30741d5c243797a31 (patch)
tree364b1932cf482cee01a510287d972fb042a5db3a /release/scripts/templates_py
parentc8ac1280bb7e69bffadff4cf8c8f71f9c0ec6616 (diff)
PyGPU: only use 3D shaders and rename string enums
Since rB6269d66da, creating formats no longer depends solely on the shader, but now depends on the dimensions used to fill the VBOs. This allows 3D shaders to work flawlessly when assigned dimensions are 2D. So there's no real benefit to us having shaders that are limited to 2D use anymore. This limitation makes it difficult to implement other builtin shaders as they indirectly require a 2D version. So this commit removes the 2D versions of the builtin sahders used in Python , renames the string enums but keeps the old enums working for backward compatibility. (This brings parts of the changes reviewed in D15836).
Diffstat (limited to 'release/scripts/templates_py')
-rw-r--r--release/scripts/templates_py/operator_modal_draw.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/release/scripts/templates_py/operator_modal_draw.py b/release/scripts/templates_py/operator_modal_draw.py
index 20e888ad5f3..78edf874791 100644
--- a/release/scripts/templates_py/operator_modal_draw.py
+++ b/release/scripts/templates_py/operator_modal_draw.py
@@ -15,7 +15,7 @@ def draw_callback_px(self, context):
blf.draw(font_id, "Hello Word " + str(len(self.mouse_path)))
# 50% alpha, 2 pixel width line
- shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR')
+ shader = gpu.shader.from_builtin('UNIFORM_COLOR')
gpu.state.blend_set('ALPHA')
gpu.state.line_width_set(2.0)
batch = batch_for_shader(shader, 'LINE_STRIP', {"pos": self.mouse_path})