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:
authorJacques Lucke <mail@jlucke.com>2018-11-14 18:43:09 +0300
committerJacques Lucke <mail@jlucke.com>2018-11-14 18:43:48 +0300
commit46ac317a292d94f73e1583929423d8a3c5f14530 (patch)
tree1604c22fc7e51da0c16072ff0ea7a6c131325d8a /release/scripts/modules/gpu_extras
parenteefae747dadd0b9febfa6641307d6a898a13a1d4 (diff)
Py API Docs: documentation for gpu_extras.presets
Diffstat (limited to 'release/scripts/modules/gpu_extras')
-rw-r--r--release/scripts/modules/gpu_extras/presets.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/release/scripts/modules/gpu_extras/presets.py b/release/scripts/modules/gpu_extras/presets.py
index 2bd8d25e46b..015608b3586 100644
--- a/release/scripts/modules/gpu_extras/presets.py
+++ b/release/scripts/modules/gpu_extras/presets.py
@@ -17,6 +17,19 @@
# ***** END GPL LICENSE BLOCK *****
def draw_circle_2d(position, color, radius, segments=32):
+ """
+ Draw a circle.
+
+ :arg position: Position where the circle will be drawn.
+ :type position: 2D Vector
+ :arg color: Color of the circle. To use transparency GL_BLEND has to be enabled.
+ :type color: tuple containing RGBA values
+ :arg radius: Radius of the circle.
+ :type radius: float
+ :arg segments: How many segments will be used to draw the circle.
+ Higher values give besser results but the drawing will take longer.
+ :type segments: int
+ """
from math import sin, cos, pi
import gpu
from gpu.types import (
@@ -45,6 +58,19 @@ def draw_circle_2d(position, color, radius, segments=32):
def draw_texture_2d(texture_id, position, width, height):
+ """
+ Draw a 2d texture.
+
+ :arg texture_id: OpenGL id of the texture (e.g. :class:`bpy.types.Image.bindcode`).
+ :type texture_id: int
+ :arg position: Position of the lower left corner.
+ :type position: 2D Vector
+ :arg width: Width of the image when drawn (not necessarily
+ the original width of the texture).
+ :type width: float
+ :arg height: Height of the image when drawn.
+ :type height: float
+ """
import gpu
import bgl
from . batch import batch_for_shader