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:
-rw-r--r--build_files/buildbot/config/user-config-cuda-glibc211-i686.py3
-rw-r--r--build_files/buildbot/slave_compile.py5
-rw-r--r--doc/python_api/examples/aud.py1
-rw-r--r--doc/python_api/examples/bge.texture.1.py1
-rw-r--r--doc/python_api/examples/bpy.app.handlers.py1
-rw-r--r--doc/python_api/examples/bpy.ops.1.py5
-rw-r--r--doc/python_api/examples/bpy.ops.py22
-rw-r--r--doc/python_api/examples/bpy.types.AddonPreferences.1.py3
-rw-r--r--doc/python_api/examples/bpy.types.Menu.1.py1
-rw-r--r--doc/python_api/examples/bpy.types.Menu.2.py1
-rw-r--r--doc/python_api/examples/bpy.types.Menu.py1
-rw-r--r--doc/python_api/examples/bpy.types.Mesh.py8
-rw-r--r--doc/python_api/examples/bpy.types.NodeTree.py1
-rw-r--r--doc/python_api/examples/bpy.types.Object.py1
-rw-r--r--doc/python_api/examples/bpy.types.Operator.1.py1
-rw-r--r--doc/python_api/examples/bpy.types.Operator.2.py2
-rw-r--r--doc/python_api/examples/bpy.types.Operator.3.py1
-rw-r--r--doc/python_api/examples/bpy.types.Operator.4.py1
-rw-r--r--doc/python_api/examples/bpy.types.Operator.5.py7
-rw-r--r--doc/python_api/examples/bpy.types.Operator.py1
-rw-r--r--doc/python_api/examples/bpy.types.Panel.1.py1
-rw-r--r--doc/python_api/examples/bpy.types.Panel.py1
-rw-r--r--doc/python_api/examples/bpy.types.UIList.2.py3
-rw-r--r--doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst13
-rw-r--r--doc/python_api/rst/bgl.rst292
-rw-r--r--doc/python_api/rst/gpu.rst480
-rw-r--r--doc/python_api/sphinx_doc_gen.py2
-rw-r--r--extern/libredcode/format.c2
-rw-r--r--intern/cycles/cmake/external_libs.cmake16
-rw-r--r--intern/cycles/kernel/geom/geom_triangle_intersect.h33
-rw-r--r--intern/cycles/kernel/kernel_light.h7
-rw-r--r--intern/cycles/render/camera.cpp34
-rw-r--r--intern/cycles/render/integrator.cpp1
-rw-r--r--intern/cycles/render/shader.cpp12
-rw-r--r--intern/ghost/intern/GHOST_ContextGLX.cpp1
-rw-r--r--intern/ghost/intern/GHOST_DisplayManagerX11.cpp5
-rw-r--r--intern/opensubdiv/opensubdiv_capi.h2
-rw-r--r--intern/opensubdiv/opensubdiv_gpu_capi.cc27
-rw-r--r--release/scripts/modules/bpy_extras/anim_utils.py18
-rw-r--r--release/scripts/modules/rna_prop_ui.py5
-rw-r--r--release/scripts/startup/bl_operators/wm.py21
-rw-r--r--release/scripts/startup/bl_ui/properties_render.py4
-rw-r--r--release/scripts/startup/bl_ui/space_sequencer.py2
-rw-r--r--source/blender/blenkernel/BKE_customdata.h4
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c4
-rw-r--r--source/blender/blenkernel/intern/camera.c25
-rw-r--r--source/blender/blenkernel/intern/colortools.c59
-rw-r--r--source/blender/blenkernel/intern/customdata.c39
-rw-r--r--source/blender/blenkernel/intern/font.c2
-rw-r--r--source/blender/blenkernel/intern/image.c105
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c15
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c9
-rw-r--r--source/blender/blenlib/intern/path_util.c9
-rw-r--r--source/blender/blenloader/intern/readfile.c10
-rw-r--r--source/blender/blenloader/intern/versioning_270.c1
-rw-r--r--source/blender/bmesh/tools/bmesh_bevel.c2
-rw-r--r--source/blender/compositor/nodes/COM_ImageNode.cpp15
-rw-r--r--source/blender/compositor/operations/COM_MultilayerImageOperation.cpp6
-rw-r--r--source/blender/compositor/operations/COM_MultilayerImageOperation.h10
-rw-r--r--source/blender/editors/include/ED_transform.h2
-rw-r--r--source/blender/editors/interface/interface_handlers.c4
-rw-r--r--source/blender/editors/interface/interface_regions.c5
-rw-r--r--source/blender/editors/render/render_internal.c4
-rw-r--r--source/blender/editors/screen/screen_edit.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c62
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c20
-rw-r--r--source/blender/editors/space_file/filelist.c42
-rw-r--r--source/blender/editors/space_image/image_buttons.c63
-rw-r--r--source/blender/editors/space_image/space_image.c1
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_intern.h41
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_walk.c13
-rw-r--r--source/blender/editors/transform/transform.c12
-rw-r--r--source/blender/editors/transform/transform.h5
-rw-r--r--source/blender/editors/transform/transform_generics.c23
-rw-r--r--source/blender/editors/transform/transform_manipulator.c6
-rw-r--r--source/blender/editors/transform/transform_orientations.c44
-rw-r--r--source/blender/makesdna/DNA_image_types.h3
-rw-r--r--source/blender/makesdna/DNA_outliner_types.h50
-rw-r--r--source/blender/makesrna/intern/rna_access.c11
-rw-r--r--source/blender/makesrna/intern/rna_image.c5
-rw-r--r--source/blender/python/generic/bgl.c379
-rw-r--r--source/blender/python/intern/bpy_rna.c21
-rw-r--r--source/blender/python/intern/gpu.c35
-rw-r--r--source/blender/render/intern/source/pipeline.c7
-rw-r--r--source/blender/windowmanager/WM_api.h1
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c8
-rw-r--r--source/blender/windowmanager/intern/wm_window.c12
-rw-r--r--source/gameengine/Ketsji/KX_WorldInfo.h8
-rw-r--r--source/gameengine/Rasterizer/RAS_2DFilterManager.cpp37
-rw-r--r--source/gameengine/VideoTexture/FilterBase.h4
92 files changed, 1631 insertions, 667 deletions
diff --git a/build_files/buildbot/config/user-config-cuda-glibc211-i686.py b/build_files/buildbot/config/user-config-cuda-glibc211-i686.py
index 580e67ee7e3..ae5cbac8cc7 100644
--- a/build_files/buildbot/config/user-config-cuda-glibc211-i686.py
+++ b/build_files/buildbot/config/user-config-cuda-glibc211-i686.py
@@ -2,5 +2,4 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-i686'
BF_INSTALLDIR = '../blender-install/linux-glibc211-i686'
BF_NUMJOBS = 1
-#BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
-BF_CYCLES_CUDA_BINARIES_ARCH = []
+BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
diff --git a/build_files/buildbot/slave_compile.py b/build_files/buildbot/slave_compile.py
index ee89bc90225..d30241a9e5c 100644
--- a/build_files/buildbot/slave_compile.py
+++ b/build_files/buildbot/slave_compile.py
@@ -52,10 +52,7 @@ if 'cmake' in builder:
cmake_options.append(['-G', '"Visual Studio 12 2013"'])
cmake_options.append("-C../blender.git/build_files/cmake/config/blender_full.cmake")
- if 'win32' not in builder:
- cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=1")
- else:
- cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=0")
+ cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=1")
# configure and make
retcode = subprocess.call(['cmake', blender_dir] + cmake_options)
if retcode != 0:
diff --git a/doc/python_api/examples/aud.py b/doc/python_api/examples/aud.py
index 2c74d6a0eb1..bbe97168efe 100644
--- a/doc/python_api/examples/aud.py
+++ b/doc/python_api/examples/aud.py
@@ -1,6 +1,7 @@
"""
Basic Sound Playback
++++++++++++++++++++
+
This script shows how to use the classes: :class:`Device`, :class:`Factory` and
:class:`Handle`.
"""
diff --git a/doc/python_api/examples/bge.texture.1.py b/doc/python_api/examples/bge.texture.1.py
index bee1f251afa..732c786c667 100644
--- a/doc/python_api/examples/bge.texture.1.py
+++ b/doc/python_api/examples/bge.texture.1.py
@@ -1,6 +1,7 @@
"""
Texture Replacement
+++++++++++++++++++
+
Example of how to replace a texture in game with an external image.
``createTexture()`` and ``removeTexture()`` are to be called from a
module Python Controller.
diff --git a/doc/python_api/examples/bpy.app.handlers.py b/doc/python_api/examples/bpy.app.handlers.py
index 57b209e15f0..078f9df77f2 100644
--- a/doc/python_api/examples/bpy.app.handlers.py
+++ b/doc/python_api/examples/bpy.app.handlers.py
@@ -1,6 +1,7 @@
"""
Basic Handler Example
+++++++++++++++++++++
+
This script shows the most simple example of adding a handler.
"""
diff --git a/doc/python_api/examples/bpy.ops.1.py b/doc/python_api/examples/bpy.ops.1.py
index a00dbdafb90..b4137e5c740 100644
--- a/doc/python_api/examples/bpy.ops.1.py
+++ b/doc/python_api/examples/bpy.ops.1.py
@@ -7,8 +7,9 @@ act on specified rather than the selected or active data, or to execute an
operator in the different part of the user interface.
The context overrides are passed as a dictionary, with keys matching the context
-member names in bpy.context. For example to override bpy.context.active_object,
-you would pass {'active_object': object}.
+member names in bpy.context.
+For example to override ``bpy.context.active_object``,
+you would pass ``{'active_object': object}``.
"""
# remove all objects in scene rather than the selected ones
diff --git a/doc/python_api/examples/bpy.ops.py b/doc/python_api/examples/bpy.ops.py
index 9964ad915bf..76c494ad4f5 100644
--- a/doc/python_api/examples/bpy.ops.py
+++ b/doc/python_api/examples/bpy.ops.py
@@ -3,21 +3,21 @@ Calling Operators
-----------------
Provides python access to calling operators, this includes operators written in
-C, Python or Macros.
+C, Python or macros.
Only keyword arguments can be used to pass operator properties.
-Operators don't have return values as you might expect, instead they return a
-set() which is made up of: {'RUNNING_MODAL', 'CANCELLED', 'FINISHED',
-'PASS_THROUGH'}.
-Common return values are {'FINISHED'} and {'CANCELLED'}.
+Operators don't have return values as you might expect,
+instead they return a set() which is made up of:
+``{'RUNNING_MODAL', 'CANCELLED', 'FINISHED', 'PASS_THROUGH'}``.
+Common return values are ``{'FINISHED'}`` and ``{'CANCELLED'}``.
-Calling an operator in the wrong context will raise a RuntimeError,
+Calling an operator in the wrong context will raise a ``RuntimeError``,
there is a poll() method to avoid this problem.
-Note that the operator ID (bl_idname) in this example is 'mesh.subdivide',
-'bpy.ops' is just the access path for python.
+Note that the operator ID (bl_idname) in this example is ``mesh.subdivide``,
+``bpy.ops`` is just the access path for python.
Keywords and Positional Arguments
@@ -32,9 +32,9 @@ There are 3 optional positional arguments (documented in detail below).
bpy.ops.test.operator(override_context, execution_context, undo)
-* override_context - dict type
-* execution_context - string (enum)
-* undo - boolean
+- override_context - ``dict`` type.
+- execution_context - ``str`` (enum).
+- undo - ``bool`` type.
Each of these arguments is optional, but must be given in the order above.
diff --git a/doc/python_api/examples/bpy.types.AddonPreferences.1.py b/doc/python_api/examples/bpy.types.AddonPreferences.1.py
index 73f90acb3fa..7a065dbf6a5 100644
--- a/doc/python_api/examples/bpy.types.AddonPreferences.1.py
+++ b/doc/python_api/examples/bpy.types.AddonPreferences.1.py
@@ -8,7 +8,8 @@ bl_info = {
"warning": "",
"wiki_url": "",
"tracker_url": "",
- "category": "Object"}
+ "category": "Object",
+ }
import bpy
diff --git a/doc/python_api/examples/bpy.types.Menu.1.py b/doc/python_api/examples/bpy.types.Menu.1.py
index e82bf398e35..8ccc1123c35 100644
--- a/doc/python_api/examples/bpy.types.Menu.1.py
+++ b/doc/python_api/examples/bpy.types.Menu.1.py
@@ -1,6 +1,7 @@
"""
Submenus
++++++++
+
This menu demonstrates some different functions.
"""
import bpy
diff --git a/doc/python_api/examples/bpy.types.Menu.2.py b/doc/python_api/examples/bpy.types.Menu.2.py
index 26409f12f45..86288b5b1c5 100644
--- a/doc/python_api/examples/bpy.types.Menu.2.py
+++ b/doc/python_api/examples/bpy.types.Menu.2.py
@@ -1,6 +1,7 @@
"""
Extending Menus
+++++++++++++++
+
When creating menus for addons you can't reference menus in Blender's default
scripts.
Instead, the addon can add menu items to existing menus.
diff --git a/doc/python_api/examples/bpy.types.Menu.py b/doc/python_api/examples/bpy.types.Menu.py
index e10e44f108e..c2162444055 100644
--- a/doc/python_api/examples/bpy.types.Menu.py
+++ b/doc/python_api/examples/bpy.types.Menu.py
@@ -1,6 +1,7 @@
"""
Basic Menu Example
++++++++++++++++++
+
Here is an example of a simple menu. Menus differ from panels in that they must
reference from a header, panel or another menu.
diff --git a/doc/python_api/examples/bpy.types.Mesh.py b/doc/python_api/examples/bpy.types.Mesh.py
index 19ccd177d64..68cc42ec6bf 100644
--- a/doc/python_api/examples/bpy.types.Mesh.py
+++ b/doc/python_api/examples/bpy.types.Mesh.py
@@ -7,10 +7,10 @@ for more flexible mesh editing from python see :mod:`bmesh`.
Blender stores 4 main arrays to define mesh geometry.
-* :class:`Mesh.vertices` (3 points in space)
-* :class:`Mesh.edges` (reference 2 vertices)
-* :class:`Mesh.loops` (reference a single vertex and edge)
-* :class:`Mesh.polygons`: (reference a range of loops)
+- :class:`Mesh.vertices` (3 points in space)
+- :class:`Mesh.edges` (reference 2 vertices)
+- :class:`Mesh.loops` (reference a single vertex and edge)
+- :class:`Mesh.polygons`: (reference a range of loops)
Each polygon reference a slice in the loop array, this way, polygons do not store vertices or corner data such as UV's directly,
diff --git a/doc/python_api/examples/bpy.types.NodeTree.py b/doc/python_api/examples/bpy.types.NodeTree.py
index 401b3a01ae0..da2986636ea 100644
--- a/doc/python_api/examples/bpy.types.NodeTree.py
+++ b/doc/python_api/examples/bpy.types.NodeTree.py
@@ -1,6 +1,7 @@
"""
Poll Function
+++++++++++++++
+
The :class:`NodeTree.poll` function determines if a node tree is visible
in the given context (similar to how :class:`Panel.poll`
and :class:`Menu.poll` define visibility). If it returns False,
diff --git a/doc/python_api/examples/bpy.types.Object.py b/doc/python_api/examples/bpy.types.Object.py
index 2ddce248a5b..90c50bcfad7 100644
--- a/doc/python_api/examples/bpy.types.Object.py
+++ b/doc/python_api/examples/bpy.types.Object.py
@@ -1,6 +1,7 @@
"""
Basic Object Operations Example
+++++++++++++++++++++++++++++++
+
This script demonstrates basic operations on object like creating new
object, placing it into scene, selecting it and making it active.
"""
diff --git a/doc/python_api/examples/bpy.types.Operator.1.py b/doc/python_api/examples/bpy.types.Operator.1.py
index f007cdfa0a7..1ba13c040ba 100644
--- a/doc/python_api/examples/bpy.types.Operator.1.py
+++ b/doc/python_api/examples/bpy.types.Operator.1.py
@@ -1,6 +1,7 @@
"""
Invoke Function
+++++++++++++++
+
:class:`Operator.invoke` is used to initialize the operator from the context
at the moment the operator is called.
invoke() is typically used to assign properties which are then used by
diff --git a/doc/python_api/examples/bpy.types.Operator.2.py b/doc/python_api/examples/bpy.types.Operator.2.py
index 39ff5caae8a..e2f9a3a84c4 100644
--- a/doc/python_api/examples/bpy.types.Operator.2.py
+++ b/doc/python_api/examples/bpy.types.Operator.2.py
@@ -4,7 +4,7 @@ Calling a File Selector
This example shows how an operator can use the file selector.
Notice the invoke function calls a window manager method and returns
-RUNNING_MODAL, this means the file selector stays open and the operator does not
+``{'RUNNING_MODAL'}``, this means the file selector stays open and the operator does not
exit immediately after invoke finishes.
The file selector runs the operator, calling :class:`Operator.execute` when the
diff --git a/doc/python_api/examples/bpy.types.Operator.3.py b/doc/python_api/examples/bpy.types.Operator.3.py
index 7fdccd81379..d59c816319d 100644
--- a/doc/python_api/examples/bpy.types.Operator.3.py
+++ b/doc/python_api/examples/bpy.types.Operator.3.py
@@ -1,6 +1,7 @@
"""
Dialog Box
++++++++++
+
This operator uses its :class:`Operator.invoke` function to call a popup.
"""
import bpy
diff --git a/doc/python_api/examples/bpy.types.Operator.4.py b/doc/python_api/examples/bpy.types.Operator.4.py
index 885ed857842..e5bc6e5c70d 100644
--- a/doc/python_api/examples/bpy.types.Operator.4.py
+++ b/doc/python_api/examples/bpy.types.Operator.4.py
@@ -1,6 +1,7 @@
"""
Custom Drawing
++++++++++++++
+
By default operator properties use an automatic user interface layout.
If you need more control you can create your own layout with a
:class:`Operator.draw` function.
diff --git a/doc/python_api/examples/bpy.types.Operator.5.py b/doc/python_api/examples/bpy.types.Operator.5.py
index 78030c7d7c4..310eeceadf3 100644
--- a/doc/python_api/examples/bpy.types.Operator.5.py
+++ b/doc/python_api/examples/bpy.types.Operator.5.py
@@ -1,8 +1,9 @@
"""
Modal Execution
+++++++++++++++
+
This operator defines a :class:`Operator.modal` function which running,
-handling events until it returns {'FINISHED'} or {'CANCELLED'}.
+handling events until it returns ``{'FINISHED'}`` or ``{'CANCELLED'}``.
Grab, Rotate, Scale and Fly-Mode are examples of modal operators.
They are especially useful for interactive tools,
@@ -10,9 +11,9 @@ your operator can have its own state where keys toggle options as the operator
runs.
:class:`Operator.invoke` is used to initialize the operator as being by
-returning {'RUNNING_MODAL'}, initializing the modal loop.
+returning ``{'RUNNING_MODAL'}``, initializing the modal loop.
-Notice __init__() and __del__() are declared.
+Notice ``__init__()`` and ``__del__()`` are declared.
For other operator types they are not useful but for modal operators they will
be called before the :class:`Operator.invoke` and after the operator finishes.
"""
diff --git a/doc/python_api/examples/bpy.types.Operator.py b/doc/python_api/examples/bpy.types.Operator.py
index 0981712e1ff..4baa9380aa6 100644
--- a/doc/python_api/examples/bpy.types.Operator.py
+++ b/doc/python_api/examples/bpy.types.Operator.py
@@ -1,6 +1,7 @@
"""
Basic Operator Example
++++++++++++++++++++++
+
This script shows simple operator which prints a message.
Since the operator only has an :class:`Operator.execute` function it takes no
diff --git a/doc/python_api/examples/bpy.types.Panel.1.py b/doc/python_api/examples/bpy.types.Panel.1.py
index fbcdae8baeb..13a9f53fa7b 100644
--- a/doc/python_api/examples/bpy.types.Panel.1.py
+++ b/doc/python_api/examples/bpy.types.Panel.1.py
@@ -1,6 +1,7 @@
"""
Simple Object Panel
+++++++++++++++++++
+
This panel has a :class:`Panel.poll` and :class:`Panel.draw_header` function,
even though the contents is basic this closely resembles blenders panels.
"""
diff --git a/doc/python_api/examples/bpy.types.Panel.py b/doc/python_api/examples/bpy.types.Panel.py
index 1f64b953786..98187832b56 100644
--- a/doc/python_api/examples/bpy.types.Panel.py
+++ b/doc/python_api/examples/bpy.types.Panel.py
@@ -1,6 +1,7 @@
"""
Basic Panel Example
+++++++++++++++++++
+
This script is a simple panel which will draw into the object properties
section.
diff --git a/doc/python_api/examples/bpy.types.UIList.2.py b/doc/python_api/examples/bpy.types.UIList.2.py
index feed263b2e7..a02a0530a66 100644
--- a/doc/python_api/examples/bpy.types.UIList.2.py
+++ b/doc/python_api/examples/bpy.types.UIList.2.py
@@ -1,7 +1,8 @@
"""
Advanced UIList Example - Filtering and Reordering
++++++++++++++++++++++++++++++++++++++++++++++++++
-This script is an extended version of the UIList subclass used to show vertex groups. It is not used 'as is',
+
+This script is an extended version of the ``UIList`` subclass used to show vertex groups. It is not used 'as is',
because iterating over all vertices in a 'draw' function is a very bad idea for UI performances! However, it's a good
example of how to create/use filtering/reordering callbacks.
"""
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst b/doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst
index 59bd836d90e..d9f03395c34 100644
--- a/doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst
+++ b/doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst
@@ -133,10 +133,11 @@ base class --- :class:`PyObjectPlus`
Returns the contraint type (read only)
:type: integer
- - 1 = :class:`~bge.constraints.POINTTOPOINT_CONSTRAINT`
- - 2 = :class:`~bge.constraints.LINEHINGE_CONSTRAINT`
- - 3 = :class:`~bge.constraints.ANGULAR_CONSTRAINT`
- - 4 = :class:`~bge.constraints.CONETWIST_CONSTRAINT`
- - 11 = :class:`~bge.constraints.VEHICLE_CONSTRAINT`
- - 12 = :class:`~bge.constraints.GENERIC_6DOF_CONSTRAINT`
+
+ - :class:`~bge.constraints.POINTTOPOINT_CONSTRAINT`
+ - :class:`~bge.constraints.LINEHINGE_CONSTRAINT`
+ - :class:`~bge.constraints.ANGULAR_CONSTRAINT`
+ - :class:`~bge.constraints.CONETWIST_CONSTRAINT`
+ - :class:`~bge.constraints.VEHICLE_CONSTRAINT`
+ - :class:`~bge.constraints.GENERIC_6DOF_CONSTRAINT`
diff --git a/doc/python_api/rst/bgl.rst b/doc/python_api/rst/bgl.rst
index 67d0c59aa32..8b0ad63abb4 100644
--- a/doc/python_api/rst/bgl.rst
+++ b/doc/python_api/rst/bgl.rst
@@ -12,8 +12,12 @@ contents: dir(bgl). A simple search on the web can point to more
than enough material to teach OpenGL programming, from books to many
collections of tutorials.
-Here is a comprehensive `list of books <http://www.opengl.org/documentation/books/>`_ (non free). The `arcsynthesis tutorials <http://www.arcsynthesis.org/gltut/>`_ is one of the best resources to learn modern OpenGL and `g-truc <http://www.g-truc.net/post-tech-content-sample.html>`_ offers a set of extensive examples, including advanced features.
-
+Here is a comprehensive `list of books <http://www.opengl.org/documentation/books/>`__ (non free).
+The `arcsynthesis tutorials <http://www.arcsynthesis.org/gltut/>`__
+is one of the best resources to learn modern OpenGL and
+`g-truc <http://www.g-truc.net/post-tech-content-sample.html>`__
+offers a set of extensive examples, including advanced features.
+
.. note::
You can use the :class:`Image` type to load and set textures.
@@ -25,7 +29,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Operate on the accumulation buffer.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glAccum.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glAccum.xml>`__
:type op: Enumerated constant
:arg op: The accumulation buffer operation.
@@ -37,7 +41,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify the alpha test function.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glAlphaFunc.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glAlphaFunc.xml>`__
:type func: Enumerated constant
:arg func: Specifies the alpha comparison function.
@@ -50,7 +54,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Determine if textures are loaded in texture memory
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glAreTexturesResident.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glAreTexturesResident.xml>`__
:type n: int
:arg n: Specifies the number of textures to be queried.
@@ -66,7 +70,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Delimit the vertices of a primitive or a group of like primatives
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glBegin.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glBegin.xml>`__
:type mode: Enumerated constant
:arg mode: Specifies the primitive that will be create from vertices between
@@ -77,7 +81,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Bind a named texture to a texturing target
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glBindTexture.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glBindTexture.xml>`__
:type target: Enumerated constant
:arg target: Specifies the target to which the texture is bound.
@@ -89,7 +93,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Draw a bitmap
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glBitmap.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glBitmap.xml>`__
:type width, height: int
:arg width, height: Specify the pixel width and height of the bitmap image.
@@ -107,7 +111,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify pixel arithmetic
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glBlendFunc.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glBlendFunc.xml>`__
:type sfactor: Enumerated constant
:arg sfactor: Specifies how the red, green, blue, and alpha source blending factors are
@@ -121,7 +125,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Execute a display list
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCallList.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCallList.xml>`__
:type list: unsigned int
:arg list: Specifies the integer name of the display list to be executed.
@@ -131,7 +135,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Execute a list of display lists
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCallLists.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCallLists.xml>`__
:type n: int
:arg n: Specifies the number of display lists to be executed.
@@ -147,7 +151,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Clear buffers to preset values
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glClear.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glClear.xml>`__
:type mask: Enumerated constant(s)
:arg mask: Bitwise OR of masks that indicate the buffers to be cleared.
@@ -157,7 +161,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify clear values for the accumulation buffer
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glClearAccum.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glClearAccum.xml>`__
:type red, green, blue, alpha: float
:arg red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the
@@ -168,7 +172,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify clear values for the color buffers
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glClearColor.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glClearColor.xml>`__
:type red, green, blue, alpha: float
:arg red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the
@@ -179,7 +183,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify the clear value for the depth buffer
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glClearDepth.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glClearDepth.xml>`__
:type depth: int
:arg depth: Specifies the depth value used when the depth buffer is cleared.
@@ -190,7 +194,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify the clear value for the color index buffers
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glClearIndex.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glClearIndex.xml>`__
:type c: float
:arg c: Specifies the index used when the color index buffers are cleared.
@@ -201,7 +205,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify the clear value for the stencil buffer
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glClearStencil.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glClearStencil.xml>`__
:type s: int
:arg s: Specifies the index used when the stencil buffer is cleared. The initial value is 0.
@@ -211,7 +215,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify a plane against which all geometry is clipped
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glClipPlane.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glClipPlane.xml>`__
:type plane: Enumerated constant
:arg plane: Specifies which clipping plane is being positioned.
@@ -230,7 +234,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set a new color.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glColor.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glColor.xml>`__
:type red, green, blue, alpha: Depends on function prototype.
:arg red, green, blue: Specify new red, green, and blue values for the current color.
@@ -242,7 +246,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Enable and disable writing of frame buffer color components
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glColorMask.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glColorMask.xml>`__
:type red, green, blue, alpha: int (boolean)
:arg red, green, blue, alpha: Specify whether red, green, blue, and alpha can or cannot be
@@ -254,7 +258,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Cause a material color to track the current color
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glColorMaterial.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glColorMaterial.xml>`__
:type face: Enumerated constant
:arg face: Specifies whether front, back, or both front and back material parameters should
@@ -267,7 +271,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Copy pixels in the frame buffer
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCopyPixels.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCopyPixels.xml>`__
:type x, y: int
:arg x, y: Specify the window coordinates of the lower left corner of the rectangular
@@ -283,7 +287,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Copy pixels into a 2D texture image
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCopyTexImage2D.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCopyTexImage2D.xml>`__
:type target: Enumerated constant
:arg target: Specifies the target texture.
@@ -312,7 +316,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify whether front- or back-facing facets can be culled
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCullFace.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCullFace.xml>`__
:type mode: Enumerated constant
:arg mode: Specifies whether front- or back-facing facets are candidates for culling.
@@ -322,7 +326,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Delete a contiguous group of display lists
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDeleteLists.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDeleteLists.xml>`__
:type list: unsigned int
:arg list: Specifies the integer name of the first display list to delete
@@ -334,7 +338,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Delete named textures
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDeleteTextures.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDeleteTextures.xml>`__
:type n: int
:arg n: Specifies the number of textures to be deleted
@@ -346,7 +350,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify the value used for depth buffer comparisons
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDepthFunc.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDepthFunc.xml>`__
:type func: Enumerated constant
:arg func: Specifies the depth comparison function.
@@ -356,7 +360,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Enable or disable writing into the depth buffer
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDepthMask.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDepthMask.xml>`__
:type flag: int (boolean)
:arg flag: Specifies whether the depth buffer is enabled for writing. If flag is GL_FALSE,
@@ -368,7 +372,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify mapping of depth values from normalized device coordinates to window coordinates
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDepthRange.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDepthRange.xml>`__
:type zNear: int
:arg zNear: Specifies the mapping of the near clipping plane to window coordinates.
@@ -382,7 +386,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Disable server-side GL capabilities
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glEnable.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glEnable.xml>`__
:type cap: Enumerated constant
:arg cap: Specifies a symbolic constant indicating a GL capability.
@@ -392,7 +396,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify which color buffers are to be drawn into
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDrawBuffer.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDrawBuffer.xml>`__
:type mode: Enumerated constant
:arg mode: Specifies up to four color buffers to be drawn into.
@@ -402,7 +406,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Write a block of pixels to the frame buffer
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDrawPixels.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDrawPixels.xml>`__
:type width, height: int
:arg width, height: Specify the dimensions of the pixel rectangle to be
@@ -421,7 +425,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Flag edges as either boundary or non-boundary
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glEdgeFlag.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glEdgeFlag.xml>`__
:type flag: Depends of function prototype
:arg flag: Specifies the current edge flag value.The initial value is GL_TRUE.
@@ -431,7 +435,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Enable server-side GL capabilities
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glEnable.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glEnable.xml>`__
:type cap: Enumerated constant
:arg cap: Specifies a symbolic constant indicating a GL capability.
@@ -441,14 +445,14 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Delimit the vertices of a primitive or group of like primitives
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glBegin.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glBegin.xml>`__
.. function:: glEndList():
Create or replace a display list
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glNewList.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glNewList.xml>`__
.. function:: glEvalCoord (u,v):
@@ -458,7 +462,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Evaluate enabled one- and two-dimensional maps
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glEvalCoord.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glEvalCoord.xml>`__
:type u: Depends on function prototype.
:arg u: Specifies a value that is the domain coordinate u to the basis function defined
@@ -476,7 +480,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Compute a one- or two-dimensional grid of points or lines
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glEvalMesh.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glEvalMesh.xml>`__
:type mode: Enumerated constant
:arg mode: In glEvalMesh1, specifies whether to compute a one-dimensional
@@ -491,7 +495,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Generate and evaluate a single point in a mesh
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glEvalPoint.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glEvalPoint.xml>`__
:type i: int
:arg i: Specifies the integer value for grid domain variable i.
@@ -503,7 +507,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Controls feedback mode
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glFeedbackBuffer.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glFeedbackBuffer.xml>`__
:type size: int
:arg size: Specifies the maximum number of values that can be written into buffer.
@@ -518,14 +522,14 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Block until all GL execution is complete
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glFinish.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glFinish.xml>`__
.. function:: glFlush():
Force Execution of GL commands in finite time
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glFlush.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glFlush.xml>`__
.. function:: glFog (pname, param):
@@ -534,7 +538,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify fog parameters
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glFog.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glFog.xml>`__
:type pname: Enumerated constant
:arg pname: Specifies a single-valued fog parameter. If the function prototype
@@ -549,7 +553,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Define front- and back-facing polygons
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glFrontFace.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glFrontFace.xml>`__
:type mode: Enumerated constant
:arg mode: Specifies the orientation of front-facing polygons.
@@ -559,7 +563,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Multiply the current matrix by a perspective matrix
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glFrustum.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glFrustum.xml>`__
:type left, right: double (float)
:arg left, right: Specify the coordinates for the left and right vertical
@@ -576,7 +580,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Generate a contiguous set of empty display lists
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGenLists.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGenLists.xml>`__
:type range: int
:arg range: Specifies the number of contiguous empty display lists to be generated.
@@ -586,7 +590,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Generate texture names
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGenTextures.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGenTextures.xml>`__
:type n: int
:arg n: Specifies the number of textures name to be generated.
@@ -600,7 +604,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Return the value or values of a selected parameter
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGet.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGet.xml>`__
:type pname: Enumerated constant
:arg pname: Specifies the parameter value to be returned.
@@ -612,7 +616,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Return the coefficients of the specified clipping plane
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetClipPlane.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetClipPlane.xml>`__
:type plane: Enumerated constant
:arg plane: Specifies a clipping plane. The number of clipping planes depends on the
@@ -627,7 +631,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Return error information
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetError.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetError.xml>`__
.. function:: glGetLight (light, pname, params):
@@ -636,7 +640,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Return light source parameter values
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetLight.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetLight.xml>`__
:type light: Enumerated constant
:arg light: Specifies a light source. The number of possible lights depends on the
@@ -670,7 +674,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Return material parameters
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetMaterial.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetMaterial.xml>`__
:type face: Enumerated constant
:arg face: Specifies which of the two materials is being queried.
@@ -687,7 +691,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Return the specified pixel map
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetPixelMap.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetPixelMap.xml>`__
:type map: Enumerated constant
:arg map: Specifies the name of the pixel map to return.
@@ -699,7 +703,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Return the polygon stipple pattern
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetPolygonStipple.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetPolygonStipple.xml>`__
:type mask: :class:`bgl.Buffer` object I{type GL_BYTE}
:arg mask: Returns the stipple pattern. The initial value is all 1's.
@@ -709,7 +713,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Return a string describing the current GL connection
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetString.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetString.xml>`__
:type name: Enumerated constant
:arg name: Specifies a symbolic constant.
@@ -722,7 +726,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Return texture environment parameters
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetTexEnv.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetTexEnv.xml>`__
:type target: Enumerated constant
:arg target: Specifies a texture environment. Must be GL_TEXTURE_ENV.
@@ -738,7 +742,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Return texture coordinate generation parameters
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetTexGen.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetTexGen.xml>`__
:type coord: Enumerated constant
:arg coord: Specifies a texture coordinate.
@@ -752,7 +756,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Return a texture image
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetTexImage.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetTexImage.xml>`__
:type target: Enumerated constant
:arg target: Specifies which texture is to be obtained.
@@ -774,7 +778,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
return texture parameter values for a specific level of detail
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetTexLevelParameter.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetTexLevelParameter.xml>`__
:type target: Enumerated constant
:arg target: Specifies the symbolic name of the target texture.
@@ -793,7 +797,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Return texture parameter values
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetTexParameter.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetTexParameter.xml>`__
:type target: Enumerated constant
:arg target: Specifies the symbolic name of the target texture.
@@ -807,7 +811,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify implementation-specific hints
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glHint.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glHint.xml>`__
:type target: Enumerated constant
:arg target: Specifies a symbolic constant indicating the behavior to be
@@ -822,7 +826,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set the current color index
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIndex.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIndex.xml>`__
:type c: :class:`bgl.Buffer` object. Depends on function prototype.
:arg c: Specifies a pointer to a one element array that contains the new value for
@@ -833,7 +837,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Control the writing of individual bits in the color index buffers
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIndexMask.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIndexMask.xml>`__
:type mask: int
:arg mask: Specifies a bit mask to enable and disable the writing of individual bits
@@ -845,14 +849,14 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Initialize the name stack
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glInitNames.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glInitNames.xml>`__
.. function:: glIsEnabled(cap):
Test whether a capability is enabled
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIsEnabled.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIsEnabled.xml>`__
:type cap: Enumerated constant
:arg cap: Specifies a constant representing a GL capability.
@@ -862,7 +866,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Determine if a name corresponds to a display-list
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIsList.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIsList.xml>`__
:type list: unsigned int
:arg list: Specifies a potential display-list name.
@@ -872,7 +876,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Determine if a name corresponds to a texture
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIsTexture.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIsTexture.xml>`__
:type texture: unsigned int
:arg texture: Specifies a value that may be the name of a texture.
@@ -884,7 +888,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set the light source parameters
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLight.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLight.xml>`__
:type light: Enumerated constant
:arg light: Specifies a light. The number of lights depends on the implementation,
@@ -904,7 +908,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set the lighting model parameters
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLightModel.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLightModel.xml>`__
:type pname: Enumerated constant
:arg pname: Specifies a single-value light model parameter.
@@ -917,7 +921,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify the line stipple pattern
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLineStipple.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLineStipple.xml>`__
:type factor: int
:arg factor: Specifies a multiplier for each bit in the line stipple pattern.
@@ -934,7 +938,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify the width of rasterized lines.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLineWidth.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLineWidth.xml>`__
:type width: float
:arg width: Specifies the width of rasterized lines. The initial value is 1.
@@ -944,7 +948,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set the display-list base for glCallLists
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glListBase.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glListBase.xml>`__
:type base: unsigned int
:arg base: Specifies an integer offset that will be added to glCallLists
@@ -955,7 +959,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Replace the current matrix with the identity matrix
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLoadIdentity.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLoadIdentity.xml>`__
.. function:: glLoadMatrix (m):
@@ -964,7 +968,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Replace the current matrix with the specified matrix
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLoadMatrix.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLoadMatrix.xml>`__
:type m: :class:`bgl.Buffer` object. Depends on function prototype.
:arg m: Specifies a pointer to 16 consecutive values, which are used as the elements
@@ -975,7 +979,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Load a name onto the name stack.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLoadName.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLoadName.xml>`__
:type name: unsigned int
:arg name: Specifies a name that will replace the top value on the name stack.
@@ -985,7 +989,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify a logical pixel operation for color index rendering
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLogicOp.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLogicOp.xml>`__
:type opcode: Enumerated constant
:arg opcode: Specifies a symbolic constant that selects a logical operation.
@@ -997,7 +1001,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Define a one-dimensional evaluator
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glMap1.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glMap1.xml>`__
:type target: Enumerated constant
:arg target: Specifies the kind of values that are generated by the evaluator.
@@ -1022,7 +1026,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Define a two-dimensional evaluator
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glMap2.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glMap2.xml>`__
:type target: Enumerated constant
:arg target: Specifies the kind of values that are generated by the evaluator.
@@ -1063,7 +1067,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Define a one- or two-dimensional mesh
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glMapGrid.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glMapGrid.xml>`__
:type un: int
:arg un: Specifies the number of partitions in the grid range interval
@@ -1082,7 +1086,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify material parameters for the lighting model.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glMaterial.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glMaterial.xml>`__
:type face: Enumerated constant
:arg face: Specifies which face or faces are being updated. Must be one of:
@@ -1099,7 +1103,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify which matrix is the current matrix.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glMatrixMode.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glMatrixMode.xml>`__
:type mode: Enumerated constant
:arg mode: Specifies which matrix stack is the target for subsequent matrix operations.
@@ -1111,7 +1115,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Multiply the current matrix with the specified matrix
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glMultMatrix.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glMultMatrix.xml>`__
:type m: :class:`bgl.Buffer` object. Depends on function prototype.
:arg m: Points to 16 consecutive values that are used as the elements of a 4x4 column
@@ -1122,7 +1126,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Create or replace a display list
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glNewList.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glNewList.xml>`__
:type list: unsigned int
:arg list: Specifies the display list name
@@ -1137,7 +1141,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set the current normal vector
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glNormal.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glNormal.xml>`__
:type nx, ny, nz: Depends on function prototype. (non - 'v' prototypes only)
:arg nx, ny, nz: Specify the x, y, and z coordinates of the new current normal.
@@ -1151,7 +1155,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Multiply the current matrix with an orthographic matrix
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glOrtho.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glOrtho.xml>`__
:type left, right: double (float)
:arg left, right: Specify the coordinates for the left and
@@ -1168,7 +1172,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Place a marker in the feedback buffer
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPassThrough.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPassThrough.xml>`__
:type token: float
:arg token: Specifies a marker value to be placed in the feedback
@@ -1181,7 +1185,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set up pixel transfer maps
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPixelMap.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPixelMap.xml>`__
:type map: Enumerated constant
:arg map: Specifies a symbolic map name.
@@ -1197,7 +1201,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set pixel storage modes
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPixelStore.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPixelStore.xml>`__
:type pname: Enumerated constant
:arg pname: Specifies the symbolic name of the parameter to be set.
@@ -1213,7 +1217,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set pixel transfer modes
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPixelTransfer.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPixelTransfer.xml>`__
:type pname: Enumerated constant
:arg pname: Specifies the symbolic name of the pixel transfer parameter to be set.
@@ -1225,7 +1229,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify the pixel zoom factors
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPixelZoom.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPixelZoom.xml>`__
:type xfactor, yfactor: float
:arg xfactor, yfactor: Specify the x and y zoom factors for pixel write operations.
@@ -1235,7 +1239,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify the diameter of rasterized points
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPointSize.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPointSize.xml>`__
:type size: float
:arg size: Specifies the diameter of rasterized points. The initial value is 1.
@@ -1245,7 +1249,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Select a polygon rasterization mode
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPolygonMode.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPolygonMode.xml>`__
:type face: Enumerated constant
:arg face: Specifies the polygons that mode applies to.
@@ -1260,7 +1264,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set the scale and units used to calculate depth values
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPolygonOffset.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPolygonOffset.xml>`__
:type factor: float
:arg factor: Specifies a scale factor that is used to create a variable depth
@@ -1274,7 +1278,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set the polygon stippling pattern
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPolygonStipple.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPolygonStipple.xml>`__
:type mask: :class:`bgl.Buffer` object I{type GL_BYTE}
:arg mask: Specifies a pointer to a 32x32 stipple pattern that will be unpacked
@@ -1285,35 +1289,35 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Pop the server attribute stack
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPopAttrib.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPopAttrib.xml>`__
.. function:: glPopClientAttrib():
Pop the client attribute stack
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPopClientAttrib.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPopClientAttrib.xml>`__
.. function:: glPopMatrix():
Pop the current matrix stack
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPopMatrix.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPopMatrix.xml>`__
.. function:: glPopName():
Pop the name stack
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPopName.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPopName.xml>`__
.. function:: glPrioritizeTextures(n, textures, priorities):
Set texture residence priority
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPrioritizeTextures.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPrioritizeTextures.xml>`__
:type n: int
:arg n: Specifies the number of textures to be prioritized.
@@ -1329,7 +1333,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Push the server attribute stack
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPushAttrib.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPushAttrib.xml>`__
:type mask: Enumerated constant(s)
:arg mask: Specifies a mask that indicates which attributes to save.
@@ -1339,7 +1343,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Push the client attribute stack
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPushClientAttrib.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPushClientAttrib.xml>`__
:type mask: Enumerated constant(s)
:arg mask: Specifies a mask that indicates which attributes to save.
@@ -1349,14 +1353,14 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Push the current matrix stack
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPushMatrix.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPushMatrix.xml>`__
.. function:: glPushName(name):
Push the name stack
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPushName.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glPushName.xml>`__
:type name: unsigned int
:arg name: Specifies a name that will be pushed onto the name stack.
@@ -1372,7 +1376,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify the raster position for pixel operations
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glRasterPos.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glRasterPos.xml>`__
:type x, y, z, w: Depends on function prototype. (z and w for '3' and '4' prototypes only)
:arg x, y, z, w: Specify the x,y,z, and w object coordinates (if present) for the
@@ -1404,7 +1408,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Select a color buffer source for pixels.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glReadBuffer.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glReadBuffer.xml>`__
:type mode: Enumerated constant
:arg mode: Specifies a color buffer.
@@ -1414,7 +1418,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Read a block of pixels from the frame buffer
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glReadPixels.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glReadPixels.xml>`__
:type x, y: int
:arg x, y: Specify the window coordinates of the first pixel that is read
@@ -1437,7 +1441,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Draw a rectangle
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glRect.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glRect.xml>`__
:type x1, y1: Depends on function prototype. (for non 'v' prototypes only)
:arg x1, y1: Specify one vertex of a rectangle
@@ -1452,7 +1456,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set rasterization mode
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glRenderMode.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glRenderMode.xml>`__
:type mode: Enumerated constant
:arg mode: Specifies the rasterization mode.
@@ -1464,7 +1468,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Multiply the current matrix by a rotation matrix
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glRotate.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glRotate.xml>`__
:type angle: Depends on function prototype.
:arg angle: Specifies the angle of rotation in degrees.
@@ -1478,7 +1482,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Multiply the current matrix by a general scaling matrix
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glScale.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glScale.xml>`__
:type x, y, z: Depends on function prototype.
:arg x, y, z: Specify scale factors along the x, y, and z axes, respectively.
@@ -1488,7 +1492,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Define the scissor box
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glScissor.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glScissor.xml>`__
:type x, y: int
:arg x, y: Specify the lower left corner of the scissor box. Initially (0, 0).
@@ -1502,7 +1506,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Establish a buffer for selection mode values
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glSelectBuffer.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glSelectBuffer.xml>`__
:type size: int
:arg size: Specifies the size of buffer
@@ -1514,7 +1518,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Select flat or smooth shading
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glShadeModel.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glShadeModel.xml>`__
:type mode: Enumerated constant
:arg mode: Specifies a symbolic value representing a shading technique.
@@ -1524,7 +1528,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set function and reference value for stencil testing
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glStencilFuc.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glStencilFuc.xml>`__
:type func: Enumerated constant
:arg func: Specifies the test function.
@@ -1541,7 +1545,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Control the writing of individual bits in the stencil planes
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glStencilMask.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glStencilMask.xml>`__
:type mask: unsigned int
:arg mask: Specifies a bit mask to enable and disable writing of individual bits
@@ -1552,7 +1556,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set stencil test actions
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glStencilOp.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glStencilOp.xml>`__
:type fail: Enumerated constant
:arg fail: Specifies the action to take when the stencil test fails.
@@ -1580,7 +1584,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set the current texture coordinates
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glTexCoord.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glTexCoord.xml>`__
:type s, t, r, q: Depends on function prototype. (r and q for '3' and '4' prototypes only)
:arg s, t, r, q: Specify s, t, r, and q texture coordinates. Not all parameters are
@@ -1596,7 +1600,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set texture environment parameters
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glTexEnv.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glTexEnv.xml>`__
:type target: Enumerated constant
:arg target: Specifies a texture environment. Must be GL_TEXTURE_ENV.
@@ -1615,7 +1619,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Control the generation of texture coordinates
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glTexGen.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glTexGen.xml>`__
:type coord: Enumerated constant
:arg coord: Specifies a texture coordinate.
@@ -1633,7 +1637,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify a one-dimensional texture image
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glTexImage1D.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glTexImage1D.xml>`__
:type target: Enumerated constant
:arg target: Specifies the target texture.
@@ -1660,7 +1664,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify a two-dimensional texture image
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glTexImage2D.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glTexImage2D.xml>`__
:type target: Enumerated constant
:arg target: Specifies the target texture.
@@ -1693,7 +1697,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set texture parameters
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glTexParameter.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glTexParameter.xml>`__
:type target: Enumerated constant
:arg target: Specifies the target texture.
@@ -1710,7 +1714,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Multiply the current matrix by a translation matrix
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glTranslate.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glTranslate.xml>`__
:type x, y, z: Depends on function prototype.
:arg x, y, z: Specify the x, y, and z coordinates of a translation vector.
@@ -1725,7 +1729,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Specify a vertex
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glVertex.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glVertex.xml>`__
:type x, y, z, w: Depends on function prototype (z and w for '3' and '4' prototypes only)
:arg x, y, z, w: Specify x, y, z, and w coordinates of a vertex. Not all parameters
@@ -1741,7 +1745,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Set the viewport
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glViewport.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glViewport.xml>`__
:type x, y: int
:arg x, y: Specify the lower left corner of the viewport rectangle,
@@ -1849,7 +1853,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Installs a program object as part of current rendering state
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glUseProgram.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glUseProgram.xml>`__
:type program: int
:arg program: Specifies the handle of the program object whose executables are to be used as part of current rendering state.
@@ -1859,7 +1863,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Validates a program object
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glValidateProgram.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glValidateProgram.xml>`__
:type program: int
:arg program: Specifies the handle of the program object to be validated.
@@ -1869,7 +1873,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Links a program object.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLinkProgram.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glLinkProgram.xml>`__
:type program: int
:arg program: Specifies the handle of the program object to be linked.
@@ -1879,7 +1883,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Select active texture unit.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glActiveTexture.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glActiveTexture.xml>`__
:type texture: int
:arg texture: Constant in ``GL_TEXTURE0`` 0 - 8
@@ -1889,7 +1893,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Attaches a shader object to a program object.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glAttachShader.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glAttachShader.xml>`__
:type program: int
:arg program: Specifies the program object to which a shader object will be attached.
@@ -1901,7 +1905,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Compiles a shader object.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCompileShader.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCompileShader.xml>`__
:type shader: int
:arg shader: Specifies the shader object to be compiled.
@@ -1911,7 +1915,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Creates a program object
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCreateProgram.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCreateProgram.xml>`__
:rtype: int
:return: The new program or zero if an error occurs.
@@ -1921,7 +1925,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Creates a shader object.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCreateShader.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glCreateShader.xml>`__
:type shaderType: Specifies the type of shader to be created.
Must be one of ``GL_VERTEX_SHADER``,
@@ -1938,7 +1942,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Deletes a program object.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDeleteProgram.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDeleteProgram.xml>`__
:type program: int
:arg program: Specifies the program object to be deleted.
@@ -1948,7 +1952,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Deletes a shader object.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDeleteShader.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDeleteShader.xml>`__
:type shader: int
:arg shader: Specifies the shader object to be deleted.
@@ -1958,7 +1962,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Detaches a shader object from a program object to which it is attached.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDetachShader.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glDetachShader.xml>`__
:type program: int
:arg program: Specifies the program object from which to detach the shader object.
@@ -1970,7 +1974,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Returns the handles of the shader objects attached to a program object.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetAttachedShaders.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetAttachedShaders.xml>`__
:type program: int
:arg program: Specifies the program object to be queried.
@@ -1986,7 +1990,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Returns the information log for a program object.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetProgramInfoLog.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetProgramInfoLog.xml>`__
:type program: int
:arg program: Specifies the program object whose information log is to be queried.
@@ -2002,7 +2006,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Returns the information log for a shader object.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetShaderInfoLog.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetShaderInfoLog.xml>`__
:type shader: int
:arg shader: Specifies the shader object whose information log is to be queried.
@@ -2018,7 +2022,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Returns a parameter from a program object.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetProgram.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetProgram.xml>`__
:type program: int
:arg program: Specifies the program object to be queried.
@@ -2032,7 +2036,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Determines if a name corresponds to a shader object.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIsShader.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIsShader.xml>`__
:type shader: int
:arg shader: Specifies a potential shader object.
@@ -2042,7 +2046,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Determines if a name corresponds to a program object
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIsProgram.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIsProgram.xml>`__
:type program: int
:arg program: Specifies a potential program object.
@@ -2052,7 +2056,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Returns the source code string from a shader object
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetShaderSource.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetShaderSource.xml>`__
:type shader: int
:arg shader: Specifies the shader object to be queried.
@@ -2068,7 +2072,7 @@ Here is a comprehensive `list of books <http://www.opengl.org/documentation/book
Replaces the source code in a shader object.
- .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glShaderSource.xml>`_
+ .. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/html/glShaderSource.xhtml>`__
:type shader: int
:arg shader: Specifies the handle of the shader object whose source code is to be replaced.
diff --git a/doc/python_api/rst/gpu.rst b/doc/python_api/rst/gpu.rst
index aaceb3ce32e..b56523c2206 100644
--- a/doc/python_api/rst/gpu.rst
+++ b/doc/python_api/rst/gpu.rst
@@ -16,24 +16,24 @@ and in the game engine.
.. warning::
- The API provided by this module should be consider unstable. The data exposed by the API
- are are closely related to Blender's internal GLSL code and may change if the GLSL code
- is modified (e.g. new uniform type).
+ The API provided by this module is subject to change.
+ The data exposed by the API are are closely related to Blender's internal GLSL code
+ and may change if the GLSL code is modified (e.g. new uniform type).
Constants
=========
-GLSL data type
+GLSL Data Type
--------------
.. _data-type:
Type of GLSL data.
-For shader uniforms, the data type determines which glUniform function
+For shader uniforms, the data type determines which ``glUniform`` function
variant to use to send the uniform value to the GPU.
-For vertex attributes, the data type determines which glVertexAttrib function
+For vertex attributes, the data type determines which ``glVertexAttrib`` function
variant to use to send the vertex attribute to the GPU.
See export_shader_
@@ -42,53 +42,37 @@ See export_shader_
one integer
- :value: 1
-
.. data:: GPU_DATA_1F
one float
- :value: 2
-
.. data:: GPU_DATA_2F
two floats
- :value: 3
-
.. data:: GPU_DATA_3F
three floats
- :value: 4
-
.. data:: GPU_DATA_4F
four floats
- :value: 5
-
.. data:: GPU_DATA_9F
matrix 3x3 in column-major order
- :value: 6
-
.. data:: GPU_DATA_16F
matrix 4x4 in column-major order
- :value: 7
-
.. data:: GPU_DATA_4UB
four unsigned byte
- :value: 8
-
-GLSL uniform type
------------------
+GLSL Uniform Types
+------------------
.. _uniform-type:
@@ -101,7 +85,7 @@ The calculation of some of the uniforms is based on matrices available in the sc
.. _mat4_cam_to_world:
.. _mat4_world_to_cam:
- *mat4_cam_to_world*
+ ``mat4_cam_to_world``
Model matrix of the camera. OpenGL 4x4 matrix that converts
camera local coordinates to world coordinates. In blender this is obtained from the
'matrix_world' attribute of the camera object.
@@ -112,7 +96,7 @@ The calculation of some of the uniforms is based on matrices available in the sc
.. _mat4_object_to_world:
.. _mat4_world_to_object:
- *mat4_object_to_world*
+ ``mat4_object_to_world``
Model matrix of the object that is being rendered. OpenGL 4x4 matric that converts
object local coordinates to world coordinates. In blender this is obtained from the
'matrix_world' attribute of the object.
@@ -122,7 +106,7 @@ The calculation of some of the uniforms is based on matrices available in the sc
.. _mat4_lamp_to_world:
.. _mat4_world_to_lamp:
- *mat4_lamp_to_world*
+ ``mat4_lamp_to_world``
Model matrix of the lamp lighting the object. OpenGL 4x4 matrix that converts lamp
local coordinates to world coordinates. In blender this is obtained from the
'matrix_world' attribute of the lamp object.
@@ -130,151 +114,299 @@ The calculation of some of the uniforms is based on matrices available in the sc
Some uniform will need the *mat4_world_to_lamp* matrix
computed as the inverse of this matrix.
+
+.. note::
+
+ Any uniforms used for view projections or transformations (object, lamp matrices for eg),
+ can only be set once per frame.
+
+
+GLSL Object Uniforms
+^^^^^^^^^^^^^^^^^^^^
+
+.. note::
+
+ - Object transformations and color must be set before drawing the object.
+ - There is at most one uniform of these types per shader.
+
.. data:: GPU_DYNAMIC_OBJECT_VIEWMAT
- The uniform is a 4x4 GL matrix that converts world coordinates to
- camera coordinates (see mat4_world_to_cam_). Can be set once per frame.
- There is at most one uniform of that type per shader.
+ A matrix that converts world coordinates to camera coordinates (see mat4_world_to_cam_).
- :value: 1
+ :type: matrix4x4
.. data:: GPU_DYNAMIC_OBJECT_MAT
- The uniform is a 4x4 GL matrix that converts object coordinates
- to world coordinates (see mat4_object_to_world_). Must be set before drawing the object.
- There is at most one uniform of that type per shader.
+ A matrix that converts object coordinates to world coordinates (see mat4_object_to_world_).
- :value: 2
+ :type: matrix4x4
.. data:: GPU_DYNAMIC_OBJECT_VIEWIMAT
The uniform is a 4x4 GL matrix that converts coordinates
in camera space to world coordinates (see mat4_cam_to_world_).
- Can be set once per frame.
- There is at most one uniform of that type per shader.
- :value: 3
+ :type: matrix4x4
.. data:: GPU_DYNAMIC_OBJECT_IMAT
The uniform is a 4x4 GL matrix that converts world coodinates
to object coordinates (see mat4_world_to_object_).
- Must be set before drawing the object.
- There is at most one uniform of that type per shader.
- :value: 4
+ :type: matrix4x4
.. data:: GPU_DYNAMIC_OBJECT_COLOR
- The uniform is a vector of 4 float representing a RGB color + alpha defined at object level.
- Each values between 0.0 and 1.0. In blender it corresponds to the 'color' attribute of the object.
- Must be set before drawing the object.
- There is at most one uniform of that type per shader.
+ An RGB color + alpha defined at object level.
+ Each values between 0.0 and 1.0.
- :value: 5
+ See :class:`bpy.types.Object.color`.
+
+ :type: float4
+
+.. data:: GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE
+
+ Multiplier for bump-map scaling.
+
+ :type: float
-.. data:: GPU_DYNAMIC_LAMP_DYNVEC
- The uniform is a vector of 3 float representing the direction of light in camera space.
- In Blender, this is computed by
+GLSL Lamp Uniforms
+^^^^^^^^^^^^^^^^^^
- mat4_world_to_cam_ * (-vec3_lamp_Z_axis)
+.. note::
- as the lamp Z axis points to the opposite direction of light.
- The norm of the vector should be unity. Can be set once per frame.
There is one uniform of that type per lamp lighting the material.
- :value: 6
+.. data:: GPU_DYNAMIC_LAMP_DYNVEC
-.. data:: GPU_DYNAMIC_LAMP_DYNCO
+ Represents the direction of light in camera space.
- The uniform is a vector of 3 float representing the position of the light in camera space.
- Computed as
+ Computed as:
+ mat4_world_to_cam_ * (-vec3_lamp_Z_axis)
- mat4_world_to_cam_ * vec3_lamp_pos
+ .. note::
+ - The lamp Z axis points to the opposite direction of light.
+ - The norm of the vector should be unit length.
- Can be set once per frame.
- There is one uniform of that type per lamp lighting the material.
+ :type: float3
- :value: 7
+.. data:: GPU_DYNAMIC_LAMP_DYNCO
-.. data:: GPU_DYNAMIC_LAMP_DYNIMAT
+ Represents the position of the light in camera space.
- The uniform is a 4x4 GL matrix that converts vector in camera space to lamp space.
- Computed as
+ Computed as:
+ mat4_world_to_cam_ * vec3_lamp_pos
- mat4_world_to_lamp_ * mat4_cam_to_world_
+ :type: float3
- Can be set once per frame.
- There is one uniform of that type per lamp lighting the material.
+.. data:: GPU_DYNAMIC_LAMP_DYNIMAT
- :value: 8
+ Matrix that converts vector in camera space to lamp space.
+
+ Computed as:
+ mat4_world_to_lamp_ * mat4_cam_to_world_
+
+ :type: matrix4x4
.. data:: GPU_DYNAMIC_LAMP_DYNPERSMAT
- The uniform is a 4x4 GL matrix that converts a vector in camera space to shadow buffer depth space.
- Computed as
+ Matrix that converts a vector in camera space to shadow buffer depth space.
- mat4_perspective_to_depth_ * mat4_lamp_to_perspective_ * mat4_world_to_lamp_ * mat4_cam_to_world_.
+ Computed as:
+ mat4_perspective_to_depth_ * mat4_lamp_to_perspective_ * mat4_world_to_lamp_ * mat4_cam_to_world_.
.. _mat4_perspective_to_depth:
- *mat4_perspective_to_depth* is a fixed matrix defined as follow::
+ ``mat4_perspective_to_depth`` is a fixed matrix defined as follow::
0.5 0.0 0.0 0.5
0.0 0.5 0.0 0.5
0.0 0.0 0.5 0.5
0.0 0.0 0.0 1.0
- This uniform can be set once per frame. There is one uniform of that type per lamp casting shadow in the scene.
+ .. note::
- :value: 9
+ - There is one uniform of that type per lamp casting shadow in the scene.
+
+ :type: matrix4x4
.. data:: GPU_DYNAMIC_LAMP_DYNENERGY
- The uniform is a single float representing the lamp energy. In blender it corresponds
- to the 'energy' attribute of the lamp data block.
- There is one uniform of that type per lamp lighting the material.
+ See :class:`bpy.types.Lamp.energy`.
- :value: 10
+ :type: float
.. data:: GPU_DYNAMIC_LAMP_DYNCOL
- The uniform is a vector of 3 float representing the lamp color.
- Color elements are between 0.0 and 1.0. In blender it corresponds
- to the 'color' attribute of the lamp data block.
- There is one uniform of that type per lamp lighting the material.
+ See :class:`bpy.types.Lamp.color`.
+
+ :type: float3
+
+.. data:: GPU_DYNAMIC_LAMP_DISTANCE
+
+ See :class:`bpy.types.Lamp.distance`.
+
+ :type: float
+
+.. data:: GPU_DYNAMIC_LAMP_ATT1
+
+ See
+ :class:`bpy.types.PointLamp.linear_attenuation`,
+ :class:`bpy.types.SpotLamp.linear_attenuation`.
+
+ :type: float
+
+.. data:: GPU_DYNAMIC_LAMP_ATT2
+
+ See
+ :class:`bpy.types.PointLamp.quadratic_attenuation`,
+ :class:`bpy.types.SpotLamp.quadratic_attenuation`.
- :value: 11
+ :type: float
+
+.. data:: GPU_DYNAMIC_LAMP_SPOTSIZE
+
+ See :class:`bpy.types.SpotLamp.spot_size`.
+
+ :type: float
+
+.. data:: GPU_DYNAMIC_LAMP_SPOTBLEND
+
+ See :class:`bpy.types.SpotLamp.spot_blend`.
+
+ :type: float
+
+
+GLSL Sampler Uniforms
+^^^^^^^^^^^^^^^^^^^^^
.. data:: GPU_DYNAMIC_SAMPLER_2DBUFFER
- The uniform is an integer representing an internal texture used for certain effect
+ Represents an internal texture used for certain effect
(color band, etc).
- :value: 12
+ :type: integer
.. data:: GPU_DYNAMIC_SAMPLER_2DIMAGE
- The uniform is an integer representing a texture loaded from an image file.
+ Represents a texture loaded from an image file.
- :value: 13
+ :type: integer
.. data:: GPU_DYNAMIC_SAMPLER_2DSHADOW
- The uniform is an float representing the bumpmap scaling.
+ Represents a texture loaded from a shadow buffer file.
- :value: 14
+ :type: integer
-.. data:: GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE
- The uniform is an integer representing a shadow buffer corresponding to a lamp
- casting shadow.
+GLSL Mist Uniforms
+^^^^^^^^^^^^^^^^^^
+
+.. data:: GPU_DYNAMIC_MIST_ENABLE:
+
+ See :class:`bpy.types.WorldMistSettings.use_mist`.
+
+ :type: float (0 or 1)
+
+.. data:: GPU_DYNAMIC_MIST_START
- :value: 15
+ See :class:`bpy.types.WorldMistSettings.start`.
+ :type: float
-GLSL attribute type
+ See :class:`bpy.types.WorldMistSettings.depth`.
+
+.. data:: GPU_DYNAMIC_MIST_DISTANCE
+
+ :type: float
+
+ See :class:`bpy.types.WorldMistSettings.intensity`.
+
+.. data:: GPU_DYNAMIC_MIST_INTENSITY
+
+ :type: float
+
+.. data:: GPU_DYNAMIC_MIST_TYPE
+
+ See :class:`bpy.types.WorldMistSettings.falloff`.
+
+ :type: float (used as an index into the type)
+
+.. data:: GPU_DYNAMIC_MIST_COLOR
+
+
+GLSL World Uniforms
+^^^^^^^^^^^^^^^^^^^
+
+.. data:: GPU_DYNAMIC_HORIZON_COLOR
+
+ See :class:`bpy.types.World.horizon_color`.
+
+ :type: float3
+
+.. data:: GPU_DYNAMIC_AMBIENT_COLOR
+
+ See :class:`bpy.types.World.ambient_color`.
+
+ :type: float3
+
+
+GLSL Material Uniforms
+^^^^^^^^^^^^^^^^^^^^^^
+
+.. data:: GPU_DYNAMIC_MAT_DIFFRGB
+
+ See :class:`bpy.types.Material.diffuse_color`.
+
+ :type: float3
+
+.. data:: GPU_DYNAMIC_MAT_REF
+
+ See :class:`bpy.types.Material.diffuse_intensity`.
+
+ :type: float
+
+.. data:: GPU_DYNAMIC_MAT_SPECRGB
+
+ See :class:`bpy.types.Material.specular_color`.
+
+ :type: float3
+
+.. data:: GPU_DYNAMIC_MAT_SPEC
+
+ See :class:`bpy.types.Material.specular_intensity`.
+
+ :type: float
+
+.. data:: GPU_DYNAMIC_MAT_HARD
+
+ See :class:`bpy.types.Material.specular_hardness`.
+
+ :type: float
+
+.. data:: GPU_DYNAMIC_MAT_EMIT
+
+ See :class:`bpy.types.Material.emit`.
+
+ :type: float
+
+.. data:: GPU_DYNAMIC_MAT_AMB
+
+ See :class:`bpy.types.Material.ambient`.
+
+ :type: float
+
+.. data:: GPU_DYNAMIC_MAT_ALPHA
+
+ See :class:`bpy.types.Material.alpha`.
+
+ :type: float
+
+
+
+GLSL Attribute Type
-------------------
.. _attribute-type:
@@ -291,9 +423,7 @@ layer that contains the vertex attribute.
.. code-block:: python
- mesh.uv_textures[attribute["name"]]
-
- :value: 5
+ mesh.uv_layers[attribute["name"]]
.. data:: CD_MCOL
@@ -306,8 +436,6 @@ layer that contains the vertex attribute.
mesh.vertex_colors[attribute["name"]]
- :value: 6
-
.. data:: CD_ORCO
Vertex attribute is original coordinates. Data type is vector 3 float.
@@ -319,8 +447,6 @@ layer that contains the vertex attribute.
mesh.vertices
- :value: 14
-
.. data:: CD_TANGENT
Vertex attribute is the tangent vector. Data type is vector 4 float.
@@ -330,8 +456,6 @@ layer that contains the vertex attribute.
C function to compute the tangent layer from the other layers can be obtained from
blender.org.
- :value: 18
-
Functions
=========
@@ -341,8 +465,12 @@ Functions
.. function:: export_shader(scene,material)
Extracts the GLSL shader producing the visual effect of material in scene for the purpose of
- reusing the shader in an external engine. This function is meant to be used in material exporter
- so that the GLSL shader can be exported entirely. The return value is a dictionary containing the
+ reusing the shader in an external engine.
+
+ This function is meant to be used in material exporter
+ so that the GLSL shader can be exported entirely.
+
+ The return value is a dictionary containing the
shader source code and all associated data.
:arg scene: the scene in which the material in rendered.
@@ -354,76 +482,91 @@ Functions
The dictionary contains the following elements:
- * ["fragment"] : string
+ - ``["fragment"]``: string
fragment shader source code.
- * ["vertex"] : string
+ - ``["vertex"]``: string
vertex shader source code.
- * ["uniforms"] : sequence
+ - ``["uniforms"]``: sequence
list of uniforms used in fragment shader, can be empty list. Each element of the
sequence is a dictionary with the following elements:
- * ["varname"] : string
+ - ``["varname"]``: string
name of the uniform in the fragment shader. Always of the form 'unf<number>'.
- * ["datatype"] : integer
+ - ``["datatype"]``: integer
data type of the uniform variable. Can be one of the following:
- * :data:`gpu.GPU_DATA_1I` : use glUniform1i
- * :data:`gpu.GPU_DATA_1F` : use glUniform1fv
- * :data:`gpu.GPU_DATA_2F` : use glUniform2fv
- * :data:`gpu.GPU_DATA_3F` : use glUniform3fv
- * :data:`gpu.GPU_DATA_4F` : use glUniform4fv
- * :data:`gpu.GPU_DATA_9F` : use glUniformMatrix3fv
- * :data:`gpu.GPU_DATA_16F` : use glUniformMatrix4fv
+ .. hlist::
+ :columns: 2
+
+ - :data:`gpu.GPU_DATA_1I` : use ``glUniform1i``
+ - :data:`gpu.GPU_DATA_1F` : use ``glUniform1fv``
+ - :data:`gpu.GPU_DATA_2F` : use ``glUniform2fv``
+ - :data:`gpu.GPU_DATA_3F` : use ``glUniform3fv``
+ - :data:`gpu.GPU_DATA_4F` : use ``glUniform4fv``
+ - :data:`gpu.GPU_DATA_9F` : use ``glUniformMatrix3fv``
+ - :data:`gpu.GPU_DATA_16F` : use ``glUniformMatrix4fv``
- * ["type"] : integer
+ - ``["type"]``: integer
type of uniform, determines the origin and method of calculation. See uniform-type_.
Depending on the type, more elements will be be present.
- * ["lamp"] : :class:`bpy.types.Object`
- Reference to the lamp object from which the uniforms value are extracted. Set for the following uniforms types:
+ - ``["lamp"]``: :class:`bpy.types.Object`
+ Reference to the lamp object from which the uniforms value are extracted.
+ Set for the following uniforms types:
.. hlist::
- :columns: 3
+ :columns: 2
- * :data:`gpu.GPU_DYNAMIC_LAMP_DYNVEC`
- * :data:`gpu.GPU_DYNAMIC_LAMP_DYNCO`
- * :data:`gpu.GPU_DYNAMIC_LAMP_DYNIMAT`
- * :data:`gpu.GPU_DYNAMIC_LAMP_DYNPERSMAT`
- * :data:`gpu.GPU_DYNAMIC_LAMP_DYNENERGY`
- * :data:`gpu.GPU_DYNAMIC_LAMP_DYNCOL`
- * :data:`gpu.GPU_DYNAMIC_SAMPLER_2DSHADOW`
+ - :data:`gpu.GPU_DYNAMIC_LAMP_DYNVEC`
+ - :data:`gpu.GPU_DYNAMIC_LAMP_DYNCO`
+ - :data:`gpu.GPU_DYNAMIC_LAMP_DYNIMAT`
+ - :data:`gpu.GPU_DYNAMIC_LAMP_DYNPERSMAT`
+ - :data:`gpu.GPU_DYNAMIC_LAMP_DYNENERGY`
+ - :data:`gpu.GPU_DYNAMIC_LAMP_DYNCOL`
+ - :data:`gpu.GPU_DYNAMIC_SAMPLER_2DSHADOW`
Notes:
- * The uniforms :data:`gpu.GPU_DYNAMIC_LAMP_DYNVEC`, :data:`gpu.GPU_DYNAMIC_LAMP_DYNCO`, :data:`gpu.GPU_DYNAMIC_LAMP_DYNIMAT` and :data:`gpu.GPU_DYNAMIC_LAMP_DYNPERSMAT`
- refer to the lamp object position and orientation, both of can be derived from the object world matrix:
+ - The uniforms
+ :data:`gpu.GPU_DYNAMIC_LAMP_DYNVEC`,
+ :data:`gpu.GPU_DYNAMIC_LAMP_DYNCO`,
+ :data:`gpu.GPU_DYNAMIC_LAMP_DYNIMAT` and
+ :data:`gpu.GPU_DYNAMIC_LAMP_DYNPERSMAT`
+ refer to the lamp object position and orientation,
+ both of can be derived from the object world matrix:
.. code-block:: python
obmat = uniform["lamp"].matrix_world
where obmat is the mat4_lamp_to_world_ matrix of the lamp as a 2 dimensional array,
- the lamp world location location is in obmat[3].
+ the lamp world location location is in ``obmat[3]``.
- * The uniform types :data:`gpu.GPU_DYNAMIC_LAMP_DYNENERGY` and :data:`gpu.GPU_DYNAMIC_LAMP_DYNCOL` refer to the lamp data bloc that you get from:
+ - The uniform types
+ :data:`gpu.GPU_DYNAMIC_LAMP_DYNENERGY` and
+ :data:`gpu.GPU_DYNAMIC_LAMP_DYNCOL`
+ refer to the lamp data bloc that you get from:
.. code-block:: python
la = uniform["lamp"].data
- from which you get la.energy and la.color
+ from which you get ``lamp.energy`` and ``lamp.color``
- * Lamp duplication is not supported: if you have duplicated lamps in your scene
+ - Lamp duplication is not supported: if you have duplicated lamps in your scene
(i.e. lamp that are instantiated by dupligroup, etc), this element will only
give you a reference to the orignal lamp and you will not know which instance
of the lamp it is refering too. You can still handle that case in the exporter
by distributing the uniforms amongst the duplicated lamps.
- * ["image"] : :class:`bpy.types.Image`
- Reference to the image databloc. Set for uniform type :data:`gpu.GPU_DYNAMIC_SAMPLER_2DIMAGE`. You can get the image data from:
+ - ``["image"]``: :class:`bpy.types.Image`
+ Reference to the image databloc.
+ Set for uniform type
+ :data:`gpu.GPU_DYNAMIC_SAMPLER_2DIMAGE`.
+ You can get the image data from:
.. code-block:: python
@@ -432,60 +575,63 @@ Functions
# image size as a 2-dimensional array of int
uniform["image"].size
- * ["texnumber"] : integer
+ - ``["texnumber"]``: integer
Channel number to which the texture is bound when drawing the object.
- Set for uniform types :data:`gpu.GPU_DYNAMIC_SAMPLER_2DBUFFER`, :data:`gpu.GPU_DYNAMIC_SAMPLER_2DIMAGE` and :data:`gpu.GPU_DYNAMIC_SAMPLER_2DSHADOW`.
+ Set for uniform types
+ :data:`gpu.GPU_DYNAMIC_SAMPLER_2DBUFFER`,
+ :data:`gpu.GPU_DYNAMIC_SAMPLER_2DIMAGE` and
+ :data:`gpu.GPU_DYNAMIC_SAMPLER_2DSHADOW`.
This is provided for information only: when reusing the shader outside blencer,
you are free to assign the textures to the channel of your choice and to pass
that number channel to the GPU in the uniform.
- * ["texpixels"] : byte array
- texture data for uniform type :data:`gpu.GPU_DYNAMIC_SAMPLER_2DBUFFER`. Although
- the corresponding uniform is a 2D sampler, the texture is always a 1D texture
- of n x 1 pixel. The texture size n is provided in ["texsize"] element.
+ - ``["texpixels"]``: byte array
+ texture data for uniform type :data:`gpu.GPU_DYNAMIC_SAMPLER_2DBUFFER`.
+ Although the corresponding uniform is a 2D sampler,
+ the texture is always a 1D texture of n x 1 pixel.
+ The texture size n is provided in ["texsize"] element.
These texture are only used for computer generated texture (colorband, etc).
- The texture data is provided so that you can make a real image out of it in the
- exporter.
+ The texture data is provided so that you can make a real image out of it in the exporter.
- * ["texsize"] : integer
+ - ``["texsize"]``: integer
horizontal size of texture for uniform type :data:`gpu.GPU_DYNAMIC_SAMPLER_2DBUFFER`.
The texture data is in ["texpixels"].
- * ["attributes"] : sequence
+ - ``["attributes"]``: sequence
list of attributes used in vertex shader, can be empty. Blender doesn't use
standard attributes except for vertex position and normal. All other vertex
- attributes must be passed using the generic glVertexAttrib functions.
+ attributes must be passed using the generic ``glVertexAttrib`` functions.
The attribute data can be found in the derived mesh custom data using RNA.
Each element of the sequence is a dictionary containing the following elements:
- * ["varname"] : string
+ - ``["varname"]``: string
name of the uniform in the vertex shader. Always of the form 'att<number>'.
- * ["datatype"] : integer
+ - ``["datatype"]``: integer
data type of vertex attribute, can be one of the following:
- * :data:`gpu.GPU_DATA_2F` : use glVertexAttrib2fv
- * :data:`gpu.GPU_DATA_3F` : use glVertexAttrib3fv
- * :data:`gpu.GPU_DATA_4F` : use glVertexAttrib4fv
- * :data:`gpu.GPU_DATA_4UB` : use glVertexAttrib4ubv
+ - :data:`gpu.GPU_DATA_2F`: use ``glVertexAttrib2fv``
+ - :data:`gpu.GPU_DATA_3F`: use ``glVertexAttrib3fv``
+ - :data:`gpu.GPU_DATA_4F`: use ``glVertexAttrib4fv``
+ - :data:`gpu.GPU_DATA_4UB`: use ``glVertexAttrib4ubv``
- * ["number"] : integer
- generic attribute number. This is provided for information only. Blender
- doesn't use glBindAttribLocation to place generic attributes at specific location,
+ - ``["number"]``: integer
+ Generic attribute number. This is provided for information only.
+ Blender doesn't use ``glBindAttribLocation`` to place generic attributes at specific location,
it lets the shader compiler place the attributes automatically and query the
- placement with glGetAttribLocation. The result of this placement is returned in
- this element.
+ placement with ``glGetAttribLocation``.
+ The result of this placement is returned in this element.
When using this shader in a render engine, you should either use
- glBindAttribLocation to force the attribute at this location or use
- glGetAttribLocation to get the placement chosen by the compiler of your GPU.
+ ``glBindAttribLocation`` to force the attribute at this location or use
+ ``glGetAttribLocation`` to get the placement chosen by the compiler of your GPU.
- * ["type"] : integer
+ - ``["type"]``: integer
type of the mesh custom data from which the vertex attribute is loaded.
See attribute-type_.
- * ["name"] : string or integer
+ - ``["name"]``: string or integer
custom data layer name, used for attribute type :data:`gpu.CD_MTFACE` and :data:`gpu.CD_MCOL`.
Example:
@@ -512,14 +658,14 @@ Notes
.. _mat4_lamp_to_perspective:
-1. Calculation of the *mat4_lamp_to_perspective* matrix for a spot lamp.
+#. Calculation of the ``mat4_lamp_to_perspective`` matrix for a spot lamp.
- The following pseudo code shows how the *mat4_lamp_to_perspective* matrix is computed
+ The following pseudo code shows how the ``mat4_lamp_to_perspective`` matrix is computed
in blender for uniforms of :data:`gpu.GPU_DYNAMIC_LAMP_DYNPERSMAT` type:
.. code-block:: python
- #Get the lamp datablock with:
+ # Get the lamp datablock with:
lamp = bpy.data.objects[uniform["lamp"]].data
# Compute the projection matrix:
@@ -531,11 +677,11 @@ Notes
# The size of the projection plane is computed with the usual formula:
wsize = lamp.clista * tan(lamp.spotsize/2)
- #And the projection matrix:
+ # And the projection matrix:
mat4_lamp_to_perspective = glFrustum(-wsize, wsize, -wsize, wsize, lamp.clista, lamp.clipend)
-2. Creation of the shadow map for a spot lamp.
+#. Creation of the shadow map for a spot lamp.
The shadow map is the depth buffer of a render performed by placing the camera at the
- spot light position. The size of the shadow map is given by the attribute lamp.bufsize :
+ spot light position. The size of the shadow map is given by the attribute ``lamp.bufsize``:
shadow map size in pixel, same size in both dimensions.
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 2d771524543..99b8325cff3 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -1600,7 +1600,7 @@ def write_rst_contents(basepath):
fw("\n")
# fw("`A PDF version of this document is also available <%s>`_\n" % BLENDER_PDF_FILENAME)
- fw("This site can be downloaded for offline use `Download the full Documentation (zipped HTML files)<%s>`_\n" % BLENDER_ZIP_FILENAME)
+ fw("This site can be downloaded for offline use `Download the full Documentation (zipped HTML files) <%s>`_\n" % BLENDER_ZIP_FILENAME)
fw("\n")
diff --git a/extern/libredcode/format.c b/extern/libredcode/format.c
index 8c6cae5234e..9a3023fa2c0 100644
--- a/extern/libredcode/format.c
+++ b/extern/libredcode/format.c
@@ -78,7 +78,7 @@ static unsigned char* read_packet(FILE * fp, char * expect)
len = read_be32(len);
if (strcmp(expect, head) != 0) {
- fprintf(stderr, "Read: %s, expect: %s\n", head, expect);
+ /* fprintf(stderr, "Read: %s, expect: %s\n", head, expect); */
return NULL;
}
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake
index d7c59f42a5e..10a166b6e44 100644
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
@@ -87,6 +87,13 @@ if(CYCLES_STANDALONE_REPOSITORY)
find_package(OpenEXR)
####
+ # OpenShadingLanguage
+ if(WITH_CYCLES_OSL)
+ find_package(OpenShadingLanguage REQUIRED)
+ find_package(LLVM REQUIRED)
+ endif()
+
+ ####
# Boost
set(__boost_packages filesystem regex system thread date_time)
if(WITH_CYCLES_NETWORK)
@@ -97,6 +104,8 @@ if(CYCLES_STANDALONE_REPOSITORY)
# libraries works, could be different for someone's else libs..
if(APPLE OR MSVC)
list(APPEND __boost_packages wave)
+ elseif(NOT (${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6"))
+ list(APPEND __boost_packages wave)
endif()
endif()
find_package(Boost 1.48 COMPONENTS ${__boost_packages} REQUIRED)
@@ -114,13 +123,6 @@ if(CYCLES_STANDALONE_REPOSITORY)
set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
####
- # OpenShadingLanguage
- if(WITH_CYCLES_OSL)
- find_package(OpenShadingLanguage REQUIRED)
- find_package(LLVM REQUIRED)
- endif()
-
- ####
# Logging
if(WITH_CYCLES_LOGGING)
find_package(Glog REQUIRED)
diff --git a/intern/cycles/kernel/geom/geom_triangle_intersect.h b/intern/cycles/kernel/geom/geom_triangle_intersect.h
index c30c71bbf1a..65f6c9af441 100644
--- a/intern/cycles/kernel/geom/geom_triangle_intersect.h
+++ b/intern/cycles/kernel/geom/geom_triangle_intersect.h
@@ -98,7 +98,7 @@ void triangle_intersect_precalc(float3 dir,
}
/* TODO(sergey): Make it general utility function. */
-ccl_device_inline float xor_signmast(float x, int y)
+ccl_device_inline float xor_signmask(float x, int y)
{
return __int_as_float(__float_as_int(x) ^ y);
}
@@ -140,13 +140,15 @@ ccl_device_inline bool triangle_intersect(KernelGlobals *kg,
/* Calculate scaled barycentric coordinates. */
float U = Cx * By - Cy * Bx;
- int sign_mask = (__float_as_int(U) & 0x80000000);
float V = Ax * Cy - Ay * Cx;
- if(sign_mask != (__float_as_int(V) & 0x80000000)) {
- return false;
- }
float W = Bx * Ay - By * Ax;
- if(sign_mask != (__float_as_int(W) & 0x80000000)) {
+ const int sign_mask = (__float_as_int(U) & 0x80000000);
+ /* TODO(sergey): Check if multiplication plus sign check is faster
+ * or at least same speed (but robust for endian types).
+ */
+ if(sign_mask != (__float_as_int(V) & 0x80000000) ||
+ sign_mask != (__float_as_int(W) & 0x80000000))
+ {
return false;
}
@@ -156,13 +158,13 @@ ccl_device_inline bool triangle_intersect(KernelGlobals *kg,
return false;
}
- /* Calculate scaled z−coordinates of vertices and use them to calculate
+ /* Calculate scaled z-coordinates of vertices and use them to calculate
* the hit distance.
*/
const float T = (U * A_kz + V * B_kz + W * C_kz) * Sz;
- const float sign_T = xor_signmast(T, sign_mask);
+ const float sign_T = xor_signmask(T, sign_mask);
if((sign_T < 0.0f) ||
- (sign_T > isect->t * xor_signmast(det, sign_mask)))
+ (sign_T > isect->t * xor_signmask(det, sign_mask)))
{
return false;
}
@@ -173,9 +175,16 @@ ccl_device_inline bool triangle_intersect(KernelGlobals *kg,
if(kernel_tex_fetch(__prim_visibility, triAddr) & visibility)
#endif
{
- if(len_squared(cross(tri_b - tri_a, tri_c - tri_a)) < 1e-16f) {
+#ifdef __KERNEL_GPU__
+ float4 a = tri_b - tri_a, b = tri_c - tri_a;
+ if(len_squared(make_float3(a.y*b.z - a.z*b.y,
+ a.z*b.x - a.x*b.z,
+ a.x*b.y - a.y*b.x)) < 1e-16f)
+ {
return false;
}
+#endif
+
/* Normalize U, V, W, and T. */
const float inv_det = 1.0f / det;
isect->prim = triAddr;
@@ -256,9 +265,9 @@ ccl_device_inline void triangle_intersect_subsurface(
* the hit distance.
*/
const float T = (U * A_kz + V * B_kz + W * C_kz) * Sz;
- const float sign_T = xor_signmast(T, sign_mask);
+ const float sign_T = xor_signmask(T, sign_mask);
if((sign_T < 0.0f) ||
- (sign_T > tmax * xor_signmast(det, sign_mask)))
+ (sign_T > tmax * xor_signmask(det, sign_mask)))
{
return;
}
diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h
index 24d4b01302c..7590ec2d706 100644
--- a/intern/cycles/kernel/kernel_light.h
+++ b/intern/cycles/kernel/kernel_light.h
@@ -620,7 +620,12 @@ ccl_device void lamp_light_sample(KernelGlobals *kg, int lamp,
}
}
-ccl_device bool lamp_light_eval(KernelGlobals *kg, int lamp, float3 P, float3 D, float t, LightSample *ls)
+#if defined(__KERNEL_CUDA__) && (__CUDA_ARCH__ >= 500) && (defined(i386) || defined(_M_IX86))
+ccl_device_noinline
+#else
+ccl_device
+#endif
+bool lamp_light_eval(KernelGlobals *kg, int lamp, float3 P, float3 D, float t, LightSample *ls)
{
float4 data0 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 0);
float4 data1 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 1);
diff --git a/intern/cycles/render/camera.cpp b/intern/cycles/render/camera.cpp
index df2a1d348d6..127d116e556 100644
--- a/intern/cycles/render/camera.cpp
+++ b/intern/cycles/render/camera.cpp
@@ -53,6 +53,7 @@ Camera::Camera()
longitude_min = -M_PI_F;
longitude_max = M_PI_F;
fov = M_PI_4_F;
+ fov_pre = fov_post = fov;
sensorwidth = 0.036f;
sensorheight = 0.024f;
@@ -91,19 +92,26 @@ Camera::~Camera()
void Camera::compute_auto_viewplane()
{
- float aspect = (float)width/(float)height;
-
- if(width >= height) {
- viewplane.left = -aspect;
- viewplane.right = aspect;
- viewplane.bottom = -1.0f;
+ if(type == CAMERA_PANORAMA) {
+ viewplane.left = 0.0f;
+ viewplane.right = 1.0f;
+ viewplane.bottom = 0.0f;
viewplane.top = 1.0f;
}
else {
- viewplane.left = -1.0f;
- viewplane.right = 1.0f;
- viewplane.bottom = -1.0f/aspect;
- viewplane.top = 1.0f/aspect;
+ float aspect = (float)width/(float)height;
+ if(width >= height) {
+ viewplane.left = -aspect;
+ viewplane.right = aspect;
+ viewplane.bottom = -1.0f;
+ viewplane.top = 1.0f;
+ }
+ else {
+ viewplane.left = -1.0f;
+ viewplane.right = 1.0f;
+ viewplane.bottom = -1.0f/aspect;
+ viewplane.top = 1.0f/aspect;
+ }
}
}
@@ -417,9 +425,9 @@ BoundBox Camera::viewplane_bounds_get()
BoundBox bounds = BoundBox::empty;
if(type == CAMERA_PANORAMA) {
- bounds.grow(make_float3(cameratoworld.w.x,
- cameratoworld.w.y,
- cameratoworld.w.z));
+ bounds.grow(make_float3(cameratoworld.x.w,
+ cameratoworld.y.w,
+ cameratoworld.z.w));
}
else {
bounds.grow(transform_raster_to_world(0.0f, 0.0f));
diff --git a/intern/cycles/render/integrator.cpp b/intern/cycles/render/integrator.cpp
index 465d7ea02c6..9f8d5b50ccd 100644
--- a/intern/cycles/render/integrator.cpp
+++ b/intern/cycles/render/integrator.cpp
@@ -100,6 +100,7 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
* transparent shaders in the scene. Otherwise we can disable it
* to improve performance a bit. */
if(transparent_shadows) {
+ kintegrator->transparent_shadows = false;
foreach(Shader *shader, scene->shaders) {
/* keep this in sync with SD_HAS_TRANSPARENT_SHADOW in shader.cpp */
if((shader->has_surface_transparent && shader->use_transparent_shadow) || shader->has_volume) {
diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp
index 31be2a3d3f4..aba3e7237d2 100644
--- a/intern/cycles/render/shader.cpp
+++ b/intern/cycles/render/shader.cpp
@@ -18,6 +18,7 @@
#include "camera.h"
#include "device.h"
#include "graph.h"
+#include "integrator.h"
#include "light.h"
#include "mesh.h"
#include "nodes.h"
@@ -338,6 +339,7 @@ void ShaderManager::device_update_common(Device *device,
uint *shader_flag = dscene->shader_flag.resize(shader_flag_size);
uint i = 0;
bool has_volumes = false;
+ bool has_transparent_shadow = false;
foreach(Shader *shader, scene->shaders) {
uint flag = 0;
@@ -355,8 +357,8 @@ void ShaderManager::device_update_common(Device *device,
flag |= SD_HAS_ONLY_VOLUME;
/* todo: this could check more fine grained, to skip useless volumes
- * enclosed inside an opaque bsdf, although we still need to handle
- * the case with camera inside volumes too */
+ * enclosed inside an opaque bsdf.
+ */
flag |= SD_HAS_TRANSPARENT_SHADOW;
}
if(shader->heterogeneous_volume && shader->has_heterogeneous_volume)
@@ -382,6 +384,8 @@ void ShaderManager::device_update_common(Device *device,
shader_flag[i++] = flag;
shader_flag[i++] = shader->pass_id;
+
+ has_transparent_shadow |= (flag & SD_HAS_TRANSPARENT_SHADOW);
}
device->tex_alloc("__shader_flag", dscene->shader_flag);
@@ -404,6 +408,10 @@ void ShaderManager::device_update_common(Device *device,
/* integrator */
KernelIntegrator *kintegrator = &dscene->data.integrator;
kintegrator->use_volumes = has_volumes;
+ /* TODO(sergey): De-duplicate with flags set in integrator.cpp. */
+ if(scene->integrator->transparent_shadows) {
+ kintegrator->transparent_shadows = has_transparent_shadow;
+ }
}
void ShaderManager::device_free_common(Device *device, DeviceScene *dscene, Scene *scene)
diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp
index 6d26666a748..02b43abec6c 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -246,6 +246,7 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
if (framebuffer_config) {
m_context = glXCreateContextAttribsARB(m_display, framebuffer_config[0], s_sharedContext, True, attribs);
+ XFree(framebuffer_config);
}
}
else {
diff --git a/intern/ghost/intern/GHOST_DisplayManagerX11.cpp b/intern/ghost/intern/GHOST_DisplayManagerX11.cpp
index 0cc116292c0..b3e6f2e53fa 100644
--- a/intern/ghost/intern/GHOST_DisplayManagerX11.cpp
+++ b/intern/ghost/intern/GHOST_DisplayManagerX11.cpp
@@ -117,7 +117,7 @@ getDisplaySetting(
if (dpy == NULL)
return GHOST_kFailure;
- (void) display;
+ (void)display;
#ifdef WITH_X11_XF86VMODE
int majorVersion, minorVersion;
@@ -149,6 +149,7 @@ getDisplaySetting(
GHOST_ASSERT(display < 1, "Only single display systems are currently supported.\n");
GHOST_ASSERT(index < 1, "Requested setting outside of valid range.\n");
+ (void)index;
setting.xPixels = DisplayWidth(dpy, DefaultScreen(dpy));
setting.yPixels = DisplayHeight(dpy, DefaultScreen(dpy));
@@ -267,6 +268,8 @@ setCurrentDisplaySetting(
return GHOST_kSuccess;
#else
+ (void)setting;
+
/* Just pretend the request was successful. */
return GHOST_kSuccess;
#endif
diff --git a/intern/opensubdiv/opensubdiv_capi.h b/intern/opensubdiv/opensubdiv_capi.h
index 0103952ec0c..ef6db92b1e8 100644
--- a/intern/opensubdiv/opensubdiv_capi.h
+++ b/intern/opensubdiv/opensubdiv_capi.h
@@ -85,7 +85,7 @@ const struct OpenSubdiv_TopologyRefinerDescr *openSubdiv_getGLMeshTopologyRefine
OpenSubdiv_GLMesh *gl_mesh);
/* ** Initialize/Deinitialize global OpenGL drawing buffers/GLSL programs ** */
-void openSubdiv_osdGLDisplayInit(void);
+bool openSubdiv_osdGLDisplayInit(void);
void openSubdiv_osdGLDisplayDeinit(void);
/* ** Evaluator API ** */
diff --git a/intern/opensubdiv/opensubdiv_gpu_capi.cc b/intern/opensubdiv/opensubdiv_gpu_capi.cc
index f80ecce00a8..31996a1bab8 100644
--- a/intern/opensubdiv/opensubdiv_gpu_capi.cc
+++ b/intern/opensubdiv/opensubdiv_gpu_capi.cc
@@ -214,7 +214,7 @@ GLuint compileShader(GLenum shaderType,
fprintf(stderr, "Section: %s\n", sdefine);
fprintf(stderr, "Defines: %s\n", define);
fprintf(stderr, "Source: %s\n", sources[2]);
- exit(1);
+ return 0;
}
return shader;
@@ -225,12 +225,21 @@ GLuint linkProgram(const char *define)
GLuint vertexShader = compileShader(GL_VERTEX_SHADER,
"VERTEX_SHADER",
define);
+ if (vertexShader == 0) {
+ return 0;
+ }
GLuint geometryShader = compileShader(GL_GEOMETRY_SHADER,
"GEOMETRY_SHADER",
define);
+ if (geometryShader == 0) {
+ return 0;
+ }
GLuint fragmentShader = compileShader(GL_FRAGMENT_SHADER,
"FRAGMENT_SHADER",
define);
+ if (fragmentShader == 0) {
+ return 0;
+ }
GLuint program = glCreateProgram();
@@ -279,7 +288,8 @@ GLuint linkProgram(const char *define)
glGetProgramInfoLog(program, sizeof(emsg), 0, emsg);
fprintf(stderr, "Error linking GLSL program : %s\n", emsg);
fprintf(stderr, "Defines: %s\n", define);
- exit(1);
+ glDeleteProgram(program);
+ return 0;
}
glUniformBlockBinding(program,
@@ -363,9 +373,10 @@ void bindProgram(GLMeshInterface * /*mesh*/,
} /* namespace */
-void openSubdiv_osdGLDisplayInit(void)
+bool openSubdiv_osdGLDisplayInit(void)
{
static bool need_init = true;
+ static bool init_success = false;
if (need_init) {
g_flat_fill_solid_program = linkProgram("#define FLAT_SHADING\n");
g_flat_fill_texture2d_program = linkProgram("#define USE_TEXTURE_2D\n#define FLAT_SHADING\n");
@@ -379,7 +390,13 @@ void openSubdiv_osdGLDisplayInit(void)
sizeof(g_lighting_data), NULL, GL_STATIC_DRAW);
need_init = false;
+ init_success = g_flat_fill_solid_program != 0 &&
+ g_flat_fill_texture2d_program != 0 &&
+ g_smooth_fill_solid_program != 0 &&
+ g_smooth_fill_texture2d_program != 0 &&
+ g_wireframe_program;
}
+ return init_success;
}
void openSubdiv_osdGLDisplayDeinit(void)
@@ -635,7 +652,9 @@ void openSubdiv_osdGLMeshDisplay(OpenSubdiv_GLMesh *gl_mesh,
(GLMeshInterface *)(gl_mesh->descriptor);
/* Make sure all global invariants are initialized. */
- openSubdiv_osdGLDisplayInit();
+ if (!openSubdiv_osdGLDisplayInit()) {
+ return;
+ }
/* Setup GLSL/OpenGL to draw patches in current context. */
GLuint program = preapre_patchDraw(mesh, fill_quads != 0);
diff --git a/release/scripts/modules/bpy_extras/anim_utils.py b/release/scripts/modules/bpy_extras/anim_utils.py
index 4ee5e685668..021a8bbb530 100644
--- a/release/scripts/modules/bpy_extras/anim_utils.py
+++ b/release/scripts/modules/bpy_extras/anim_utils.py
@@ -142,6 +142,13 @@ def bake_action(frame_start,
obj_info.append(obj_frame_info(obj))
# -------------------------------------------------------------------------
+ # Clean (store initial data)
+ if do_clean and action is not None:
+ clean_orig_data = {fcu: {p.co[1] for p in fcu.keyframe_points} for fcu in action.fcurves}
+ else:
+ clean_orig_data = {}
+
+ # -------------------------------------------------------------------------
# Create action
# in case animation data hasn't been created
@@ -230,12 +237,19 @@ def bake_action(frame_start,
if do_clean:
for fcu in action.fcurves:
+ fcu_orig_data = clean_orig_data.get(fcu, set())
+
keyframe_points = fcu.keyframe_points
i = 1
- while i < len(fcu.keyframe_points) - 1:
+ while i < len(keyframe_points) - 1:
+ val = keyframe_points[i].co[1]
+
+ if val in fcu_orig_data:
+ i += 1
+ continue
+
val_prev = keyframe_points[i - 1].co[1]
val_next = keyframe_points[i + 1].co[1]
- val = keyframe_points[i].co[1]
if abs(val - val_prev) + abs(val - val_next) < 0.0001:
keyframe_points.remove(keyframe_points[i])
diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py
index 44722fa7162..195b5767189 100644
--- a/release/scripts/modules/rna_prop_ui.py
+++ b/release/scripts/modules/rna_prop_ui.py
@@ -39,6 +39,11 @@ def rna_idprop_ui_del(item):
pass
+def rna_idprop_ui_prop_update(item, prop):
+ prop_rna = item.path_resolve("[\"%s\"]" % prop.replace("\"", "\\\""), False)
+ prop_rna.update()
+
+
def rna_idprop_ui_prop_get(item, prop, create=True):
rna_ui = rna_idprop_ui_get(item, create)
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index edf60aa40e7..c228e33965f 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1132,7 +1132,11 @@ class WM_OT_properties_edit(Operator):
)
def execute(self, context):
- from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
+ from rna_prop_ui import (
+ rna_idprop_ui_prop_get,
+ rna_idprop_ui_prop_clear,
+ rna_idprop_ui_prop_update,
+ )
data_path = self.data_path
value = self.value
@@ -1164,6 +1168,9 @@ class WM_OT_properties_edit(Operator):
exec_str = "item[%r] = %s" % (prop, repr(value_eval))
# print(exec_str)
exec(exec_str)
+
+ rna_idprop_ui_prop_update(item, prop)
+
self._last_prop[:] = [prop]
prop_type = type(item[prop])
@@ -1245,7 +1252,10 @@ class WM_OT_properties_add(Operator):
data_path = rna_path
def execute(self, context):
- from rna_prop_ui import rna_idprop_ui_prop_get
+ from rna_prop_ui import (
+ rna_idprop_ui_prop_get,
+ rna_idprop_ui_prop_update,
+ )
data_path = self.data_path
item = eval("context.%s" % data_path)
@@ -1263,6 +1273,7 @@ class WM_OT_properties_add(Operator):
prop = unique_name(item.keys())
item[prop] = 1.0
+ rna_idprop_ui_prop_update(item, prop)
# not essential, but without this we get [#31661]
prop_ui = rna_idprop_ui_prop_get(item, prop)
@@ -1298,10 +1309,14 @@ class WM_OT_properties_remove(Operator):
property = rna_property
def execute(self, context):
- from rna_prop_ui import rna_idprop_ui_prop_clear
+ from rna_prop_ui import (
+ rna_idprop_ui_prop_clear,
+ rna_idprop_ui_prop_update,
+ )
data_path = self.data_path
item = eval("context.%s" % data_path)
prop = self.property
+ rna_idprop_ui_prop_update(item, prop)
del item[prop]
rna_idprop_ui_prop_clear(item, prop)
diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index e528f6358bc..1f1802aa373 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -461,6 +461,10 @@ class RENDER_PT_encoding(RenderButtonsPanel, Panel):
split.prop(rd.ffmpeg, "format")
if ffmpeg.format in {'AVI', 'QUICKTIME', 'MKV', 'OGG', 'MPEG4'}:
split.prop(ffmpeg, "codec")
+ if ffmpeg.codec == 'H264':
+ row = layout.row()
+ row.label()
+ row.prop(ffmpeg, "use_lossless_output")
elif rd.ffmpeg.format == 'H264':
split.prop(ffmpeg, "use_lossless_output")
else:
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index 9a8775b3e21..7cf506efd7e 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -177,8 +177,10 @@ class SEQUENCER_MT_view(Menu):
layout.separator()
if is_sequencer_view:
+ layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("sequencer.view_all", text="View all Sequences")
layout.operator("sequencer.view_selected")
+ layout.operator_context = 'INVOKE_DEFAULT'
if is_preview:
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.operator("sequencer.view_all_preview", text="Fit preview in window")
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index 6fb27cf7577..3e784752f10 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -381,6 +381,10 @@ void CustomData_bmesh_update_active_layers(struct CustomData *fdata, struct Cust
void CustomData_bmesh_do_versions_update_active_layers(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata);
void CustomData_bmesh_init_pool(struct CustomData *data, int totelem, const char htype);
+#ifndef NDEBUG
+bool CustomData_from_bmeshpoly_test(CustomData *fdata, CustomData *pdata, CustomData *ldata, bool fallback);
+#endif
+
/* External file storage */
void CustomData_external_add(struct CustomData *data,
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 6c3564167b6..d13786facce 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -593,8 +593,6 @@ void DM_generate_tangent_tessface_data(DerivedMesh *dm, bool generate)
if (!polyindex)
return;
- CustomData_from_bmeshpoly(fdata, pdata, ldata, totface);
-
if (generate) {
for (i = 0; i < ldata->totlayer; i++) {
if (ldata->layers[i].type == CD_TANGENT)
@@ -603,6 +601,8 @@ void DM_generate_tangent_tessface_data(DerivedMesh *dm, bool generate)
CustomData_bmesh_update_active_layers(fdata, pdata, ldata);
}
+ BLI_assert(CustomData_from_bmeshpoly_test(fdata, pdata, ldata, true));
+
loopindex = MEM_mallocN(sizeof(*loopindex) * totface, __func__);
for (mf_idx = 0, mf = mface; mf_idx < totface; mf_idx++, mf++) {
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index 807ae9094fd..07ce96461e5 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -169,15 +169,15 @@ float BKE_camera_object_dof_distance(Object *ob)
if (ob->type != OB_CAMERA)
return 0.0f;
if (cam->dof_ob) {
- /* too simple, better to return the distance on the view axis only
- * return len_v3v3(ob->obmat[3], cam->dof_ob->obmat[3]); */
- float mat[4][4], imat[4][4], obmat[4][4];
-
- copy_m4_m4(obmat, ob->obmat);
- normalize_m4(obmat);
- invert_m4_m4(imat, obmat);
- mul_m4_m4m4(mat, imat, cam->dof_ob->obmat);
- return fabsf(mat[3][2]);
+#if 0
+ /* too simple, better to return the distance on the view axis only */
+ return len_v3v3(ob->obmat[3], cam->dof_ob->obmat[3]);
+#else
+ float view_dir[3], dof_dir[3];
+ normalize_v3_v3(view_dir, ob->obmat[2]);
+ sub_v3_v3v3(dof_dir, ob->obmat[3], cam->dof_ob->obmat[3]);
+ return fabsf(dot_v3v3(view_dir, dof_dir));
+#endif
}
return cam->YF_dofdist;
}
@@ -959,11 +959,6 @@ void BKE_camera_to_gpu_dof(struct Object *camera, struct GPUFXSettings *r_fx_set
r_fx_settings->dof = &cam->gpu_dof;
r_fx_settings->dof->focal_length = cam->lens;
r_fx_settings->dof->sensor = BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
- if (cam->dof_ob) {
- r_fx_settings->dof->focus_distance = len_v3v3(cam->dof_ob->obmat[3], camera->obmat[3]);
- }
- else {
- r_fx_settings->dof->focus_distance = cam->YF_dofdist;
- }
+ r_fx_settings->dof->focus_distance = BKE_camera_object_dof_distance(camera);
}
}
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index aad6681fa2a..acfec306997 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -975,7 +975,6 @@ void BKE_histogram_update_sample_line(Histogram *hist, ImBuf *ibuf, const ColorM
{
int i, x, y;
const float *fp;
- float rgb[3];
unsigned char *cp;
int x1 = 0.5f + hist->co[0][0] * ibuf->x;
@@ -1004,16 +1003,36 @@ void BKE_histogram_update_sample_line(Histogram *hist, ImBuf *ibuf, const ColorM
}
else {
if (ibuf->rect_float) {
+ float rgba[4];
fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x));
- copy_v3_v3(rgb, fp);
- IMB_colormanagement_processor_apply_v3(cm_processor, rgb);
+ switch (ibuf->channels) {
+ case 4:
+ copy_v4_v4(rgba, fp);
+ IMB_colormanagement_processor_apply_v4(cm_processor, rgba);
+ break;
+ case 3:
+ copy_v3_v3(rgba, fp);
+ IMB_colormanagement_processor_apply_v3(cm_processor, rgba);
+ rgba[3] = 1.0f;
+ break;
+ case 2:
+ copy_v3_fl(rgba, fp[0]);
+ rgba[3] = fp[1];
+ break;
+ case 1:
+ copy_v3_fl(rgba, fp[0]);
+ rgba[3] = 1.0f;
+ break;
+ default:
+ BLI_assert(0);
+ }
- hist->data_luma[i] = IMB_colormanagement_get_luminance(rgb);
- hist->data_r[i] = rgb[0];
- hist->data_g[i] = rgb[1];
- hist->data_b[i] = rgb[2];
- hist->data_a[i] = fp[3];
+ hist->data_luma[i] = IMB_colormanagement_get_luminance(rgba);
+ hist->data_r[i] = rgba[0];
+ hist->data_g[i] = rgba[1];
+ hist->data_b[i] = rgba[2];
+ hist->data_a[i] = rgba[3];
}
else if (ibuf->rect) {
cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x);
@@ -1148,8 +1167,28 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, const ColorManagedViewSettings *
for (x = 0; x < ibuf->x; x++) {
float rgba[4], ycc[3], luma;
if (is_float) {
- copy_v4_v4(rgba, rf);
- IMB_colormanagement_processor_apply_v4(cm_processor, rgba);
+
+ switch (ibuf->channels) {
+ case 4:
+ copy_v4_v4(rgba, rf);
+ IMB_colormanagement_processor_apply_v4(cm_processor, rgba);
+ break;
+ case 3:
+ copy_v3_v3(rgba, rf);
+ IMB_colormanagement_processor_apply_v3(cm_processor, rgba);
+ rgba[3] = 1.0f;
+ break;
+ case 2:
+ copy_v3_fl(rgba, rf[0]);
+ rgba[3] = rf[1];
+ break;
+ case 1:
+ copy_v3_fl(rgba, rf[0]);
+ rgba[3] = 1.0f;
+ break;
+ default:
+ BLI_assert(0);
+ }
}
else {
for (c = 0; c < 4; c++)
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 416125e53ad..ed50bdda744 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -2501,6 +2501,10 @@ void CustomData_to_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData *l
void CustomData_from_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData *ldata, int total)
{
int i;
+
+ /* avoid accumulating extra layers */
+ BLI_assert(!CustomData_from_bmeshpoly_test(fdata, pdata, ldata, false));
+
for (i = 0; i < pdata->totlayer; i++) {
if (pdata->layers[i].type == CD_MTEXPOLY) {
CustomData_add_layer_named(fdata, CD_MTFACE, CD_CALLOC, NULL, total, pdata->layers[i].name);
@@ -2527,6 +2531,41 @@ void CustomData_from_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData
CustomData_bmesh_update_active_layers(fdata, pdata, ldata);
}
+#ifndef NDEBUG
+/**
+ * Debug check, used to assert when we expect layers to be in/out of sync.
+ *
+ * \param fallback: Use when there are no layers to handle,
+ * since callers may expect success or failure.
+ */
+bool CustomData_from_bmeshpoly_test(CustomData *fdata, CustomData *pdata, CustomData *ldata, bool fallback)
+{
+ int a_num = 0, b_num = 0;
+#define LAYER_CMP(l_a, t_a, l_b, t_b) \
+ ((a_num += CustomData_number_of_layers(l_a, t_a)) == (b_num += CustomData_number_of_layers(l_b, t_b)))
+
+ if (!LAYER_CMP(pdata, CD_MTEXPOLY, fdata, CD_MTFACE))
+ return false;
+ if (!LAYER_CMP(ldata, CD_MLOOPCOL, fdata, CD_MCOL))
+ return false;
+ if (!LAYER_CMP(ldata, CD_PREVIEW_MLOOPCOL, fdata, CD_PREVIEW_MCOL))
+ return false;
+ if (!LAYER_CMP(ldata, CD_ORIGSPACE_MLOOP, fdata, CD_ORIGSPACE))
+ return false;
+ if (!LAYER_CMP(ldata, CD_NORMAL, fdata, CD_TESSLOOPNORMAL))
+ return false;
+ if (!LAYER_CMP(ldata, CD_TANGENT, fdata, CD_TANGENT))
+ return false;
+
+#undef TEST_RET
+
+ /* if no layers are on either CustomData's,
+ * then there was nothing to do... */
+ return a_num ? true : fallback;
+}
+#endif
+
+
void CustomData_bmesh_update_active_layers(CustomData *fdata, CustomData *pdata, CustomData *ldata)
{
int act;
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 2adf8ebc615..23261b63486 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -777,7 +777,7 @@ makebreak:
if ((tb_scale.h != 0.0f) &&
(cu->totbox > (curbox + 1)) &&
- ((-(yof - tb_scale.y)) > (tb_scale.h - (linedist * cu->fsize)) - yof_scale))
+ ((-(yof - tb_scale.y)) > (tb_scale.h - linedist) - yof_scale))
{
maxlen = 0;
curbox++;
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index ef760f2da26..36aeb97c3f0 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -2578,21 +2578,10 @@ static void image_init_imageuser(Image *ima, ImageUser *iuser)
RenderResult *rr = ima->rr;
iuser->multi_index = 0;
- iuser->layer = iuser->view = 0;
- iuser->passtype = SCE_PASS_COMBINED;
-
- if (rr) {
- RenderLayer *rl = rr->layers.first;
-
- if (rl) {
- RenderPass *rp = rl->passes.first;
-
- if (rp)
- iuser->passtype = rp->passtype;
- }
+ iuser->layer = iuser->pass = iuser->view = 0;
+ if (rr)
BKE_image_multilayer_index(rr, iuser);
- }
}
void BKE_image_init_imageuser(Image *ima, ImageUser *iuser)
@@ -2740,6 +2729,52 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal)
}
}
+#define PASSTYPE_UNSET -1
+/* return renderpass for a given pass index and active view */
+/* fallback to available if there are missing passes for active view */
+static RenderPass *image_render_pass_get(RenderLayer *rl, const int pass, const int view, int *r_passindex)
+{
+ RenderPass *rpass_ret = NULL;
+ RenderPass *rpass;
+
+ int rp_index = 0;
+ int rp_passtype = PASSTYPE_UNSET;
+
+ for (rpass = rl->passes.first; rpass; rpass = rpass->next, rp_index++) {
+ if (rp_index == pass) {
+ rpass_ret = rpass;
+ if (view == 0) {
+ /* no multiview or left eye */
+ break;
+ }
+ else {
+ rp_passtype = rpass->passtype;
+ }
+ }
+ /* multiview */
+ else if ((rp_passtype != PASSTYPE_UNSET) &&
+ (rpass->passtype == rp_passtype) &&
+ (rpass->view_id == view))
+ {
+ rpass_ret = rpass;
+ break;
+ }
+ }
+
+ /* fallback to the first pass in the layer */
+ if (rpass_ret == NULL) {
+ rp_index = 0;
+ rpass_ret = rl->passes.first;
+ }
+
+ if (r_passindex) {
+ *r_passindex = (rpass == rpass_ret ? rp_index : pass);
+ }
+
+ return rpass_ret;
+}
+#undef PASSTYPE_UNSET
+
/* if layer or pass changes, we need an index for the imbufs list */
/* note it is called for rendered results, but it doesnt use the index! */
/* and because rendered results use fake layer/passes, don't correct for wrong indices here */
@@ -2759,27 +2794,16 @@ RenderPass *BKE_image_multilayer_index(RenderResult *rr, ImageUser *iuser)
if (RE_HasFakeLayer(rr)) rl_index += 1;
for (rl = rr->layers.first; rl; rl = rl->next, rl_index++) {
- for (rpass = rl->passes.first; rpass; rpass = rpass->next, index++) {
- if (iuser->layer == rl_index &&
- iuser->passtype == rpass->passtype &&
- rv_index == rpass->view_id)
- {
- break;
- }
- }
- if (rpass)
+ if (iuser->layer == rl_index) {
+ int rp_index;
+ rpass = image_render_pass_get(rl, iuser->pass, rv_index, &rp_index);
+ iuser->multi_index = index + rp_index;
break;
+ }
+ else {
+ index += BLI_listbase_count(&rl->passes);
+ }
}
- iuser->multi_index = (rpass ? index : 0);
- }
-
- if (rpass == NULL) {
- rl = rr->layers.first;
- if (rl)
- rpass = rl->passes.first;
-
- if (rpass && iuser)
- iuser->passtype = rpass->passtype;
}
return rpass;
@@ -3613,7 +3637,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **r_loc
float *rectf, *rectz;
unsigned int *rect;
float dither;
- int channels, layer, passtype;
+ int channels, layer, pass;
ImBuf *ibuf;
int from_render = (ima->render_slot == ima->last_render_slot);
int actview;
@@ -3630,7 +3654,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **r_loc
channels = 4;
layer = iuser->layer;
- passtype = iuser->passtype;
+ pass = iuser->pass;
actview = iuser->view;
if ((ima->flag & IMA_IS_STEREO) && (iuser->flag & IMA_SHOW_STEREO))
@@ -3693,19 +3717,10 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **r_loc
else if (rres.layers.first) {
RenderLayer *rl = BLI_findlink(&rres.layers, layer - (rres.have_combined ? 1 : 0));
if (rl) {
- RenderPass *rpass;
-
- for (rpass = rl->passes.first; rpass; rpass = rpass->next) {
- if (passtype == rpass->passtype &&
- actview == rpass->view_id)
- {
- break;
- }
- }
-
+ RenderPass *rpass = image_render_pass_get(rl, pass, actview, NULL);
if (rpass) {
rectf = rpass->rect;
- if (passtype == SCE_PASS_COMBINED) {
+ if (pass == 0) {
if (rectf == NULL) {
/* Happens when Save Buffers is enabled.
* Use display buffer stored in the render layer.
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index 3e6edbe01e8..1333d28960c 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -43,6 +43,7 @@
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
#include "DNA_anim_types.h"
+#include "DNA_space_types.h"
#include "BKE_fcurve.h"
#include "BKE_sequencer.h"
@@ -2480,7 +2481,7 @@ void BKE_sequence_effect_speed_rebuild_map(Scene *scene, Sequence *seq, bool for
if ((seq->seq1->enddisp != seq->seq1->start) &&
(seq->seq1->len != 0))
{
- fallback_fac = 1.0f;
+ fallback_fac = (float) seq->seq1->len / (float) (seq->seq1->enddisp - seq->seq1->start);
flags = SEQ_SPEED_INTEGRATE;
fcu = NULL;
}
@@ -2920,12 +2921,22 @@ static ImBuf *do_text_effect(const SeqRenderData *context, Sequence *seq, float
const char *display_device;
const int mono = blf_mono_font_render; // XXX
int y_ofs, x, y;
+ float proxy_size_comp;
display_device = context->scene->display_settings.display_device;
display = IMB_colormanagement_display_get_named(display_device);
+ /* Compensate text size for preview render size. */
+ if (context->preview_render_size == SEQ_PROXY_RENDER_SIZE_100) {
+ /* Should be rendered at 100%, but context->preview_render_size = 99 right now. */
+ proxy_size_comp = 1.0f;
+ }
+ else {
+ proxy_size_comp = context->preview_render_size / 100.0f;
+ }
+
/* set before return */
- BLF_size(mono, (context->scene->r.size / 100.0f) * data->text_size, 72);
+ BLF_size(mono, proxy_size_comp * (context->scene->r.size / 100) * data->text_size, 72);
BLF_buffer(mono, out->rect_float, (unsigned char *)out->rect, width, height, out->channels, display);
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index 5ecd2fc74e8..7d492586b7d 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -50,6 +50,7 @@
#include "BKE_lattice.h"
#include "BKE_deform.h"
+#include "BKE_editmesh.h"
#include "BKE_mesh.h" /* for OMP limits. */
#include "BKE_subsurf.h"
@@ -278,6 +279,14 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, bool for
BLI_SPACE_TRANSFORM_SETUP(&local2aux, calc->ob, calc->smd->auxTarget);
}
+ /* use editmesh to avoid array allocation */
+ if (calc->smd->target && calc->target->type == DM_TYPE_EDITBMESH) {
+ treeData.em_evil = BKE_editmesh_from_object(calc->smd->target);
+ }
+ if (calc->smd->auxTarget && auxMesh->type == DM_TYPE_EDITBMESH) {
+ auxData.em_evil = BKE_editmesh_from_object(calc->smd->auxTarget);
+ }
+
/* After sucessufuly build the trees, start projection vertexs */
if (bvhtree_from_mesh_looptri(&treeData, calc->target, 0.0, 4, 6) &&
(auxMesh == NULL || bvhtree_from_mesh_looptri(&auxData, auxMesh, 0.0, 4, 6)))
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 3a73d4cc0c7..4692af0ffa7 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -1610,17 +1610,16 @@ bool BLI_testextensie_glob(const char *str, const char *ext_fnmatch)
while (ext_step[0]) {
const char *ext_next;
- int len_ext;
+ size_t len_ext;
if ((ext_next = strchr(ext_step, ';'))) {
- len_ext = (int)(ext_next - ext_step) + 1;
+ len_ext = ext_next - ext_step + 1;
+ BLI_strncpy(pattern, ext_step, (len_ext > sizeof(pattern)) ? sizeof(pattern) : len_ext);
}
else {
- len_ext = sizeof(pattern);
+ len_ext = BLI_strncpy_rlen(pattern, ext_step, sizeof(pattern));
}
- BLI_strncpy(pattern, ext_step, len_ext);
-
if (fnmatch(pattern, str, FNM_CASEFOLD) == 0) {
return true;
}
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 9f6abb58e2c..7172327adac 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6526,6 +6526,7 @@ void blo_lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *cursc
else if (sl->spacetype == SPACE_FILE) {
SpaceFile *sfile = (SpaceFile *)sl;
sfile->op = NULL;
+ sfile->previews_timer = NULL;
}
else if (sl->spacetype == SPACE_ACTION) {
SpaceAction *saction = (SpaceAction *)sl;
@@ -6609,7 +6610,13 @@ void blo_lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *cursc
BLI_mempool_iternew(so->treestore, &iter);
while ((tselem = BLI_mempool_iterstep(&iter))) {
- tselem->id = restore_pointer_by_name(newmain, tselem->id, USER_IGNORE);
+ /* Do not try to restore pointers to drivers/sequence/etc., can crash in undo case! */
+ if (TSE_IS_REAL_ID(tselem)) {
+ tselem->id = restore_pointer_by_name(newmain, tselem->id, USER_IGNORE);
+ }
+ else {
+ tselem->id = NULL;
+ }
}
if (so->treehash) {
/* rebuild hash table, because it depends on ids too */
@@ -7056,6 +7063,7 @@ static bool direct_link_screen(FileData *fd, bScreen *sc)
sfile->files = NULL;
sfile->layout = NULL;
sfile->op = NULL;
+ sfile->previews_timer = NULL;
sfile->params = newdataadr(fd, sfile->params);
}
else if (sl->spacetype == SPACE_CLIP) {
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 4260348390e..a7e91e2b9fa 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -767,7 +767,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
{
SpaceImage *sima = (SpaceImage *) sl;
sima->iuser.flag |= IMA_SHOW_STEREO;
- sima->iuser.passtype = SCE_PASS_COMBINED;
break;
}
}
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index 9fba5b147bf..cb1c856c05d 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -2947,7 +2947,7 @@ static void bevel_build_rings(BevelParams *bp, BMesh *bm, BevVert *bv)
BLI_array_append(ve, v == vm->boundstart ? NULL : frep_e);
}
else {
- BLI_array_append(vf, frep);
+ BLI_array_append(vf, boundvert_rep_face(v, NULL));
BLI_array_append(ve, NULL);
}
} while ((v = v->next) != vm->boundstart);
diff --git a/source/blender/compositor/nodes/COM_ImageNode.cpp b/source/blender/compositor/nodes/COM_ImageNode.cpp
index 572e63a2ced..facd422c217 100644
--- a/source/blender/compositor/nodes/COM_ImageNode.cpp
+++ b/source/blender/compositor/nodes/COM_ImageNode.cpp
@@ -40,19 +40,19 @@ ImageNode::ImageNode(bNode *editorNode) : Node(editorNode)
}
NodeOperation *ImageNode::doMultilayerCheck(NodeConverter &converter, RenderLayer *rl, Image *image, ImageUser *user,
- int framenumber, int outputsocketIndex, int passtype, int view, DataType datatype) const
+ int framenumber, int outputsocketIndex, int passindex, int view, DataType datatype) const
{
NodeOutput *outputSocket = this->getOutputSocket(outputsocketIndex);
MultilayerBaseOperation *operation = NULL;
switch (datatype) {
case COM_DT_VALUE:
- operation = new MultilayerValueOperation(passtype, view);
+ operation = new MultilayerValueOperation(passindex, view);
break;
case COM_DT_VECTOR:
- operation = new MultilayerVectorOperation(passtype, view);
+ operation = new MultilayerVectorOperation(passindex, view);
break;
case COM_DT_COLOR:
- operation = new MultilayerColorOperation(passtype, view);
+ operation = new MultilayerColorOperation(passindex, view);
break;
default:
break;
@@ -124,20 +124,21 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo
}
if (rpass) {
+ int passindex = BLI_findindex(&rl->passes, rpass);
switch (rpass->channels) {
case 1:
operation = doMultilayerCheck(converter, rl, image, imageuser, framenumber, index,
- rpass->passtype, view, COM_DT_VALUE);
+ passindex, view, COM_DT_VALUE);
break;
/* using image operations for both 3 and 4 channels (RGB and RGBA respectively) */
/* XXX any way to detect actual vector images? */
case 3:
operation = doMultilayerCheck(converter, rl, image, imageuser, framenumber, index,
- rpass->passtype, view, COM_DT_VECTOR);
+ passindex, view, COM_DT_VECTOR);
break;
case 4:
operation = doMultilayerCheck(converter, rl, image, imageuser, framenumber, index,
- rpass->passtype, view, COM_DT_COLOR);
+ passindex, view, COM_DT_COLOR);
break;
default:
/* dummy operation is added below */
diff --git a/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp b/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp
index 00be3b1cdde..b57dd4e32c3 100644
--- a/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp
+++ b/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp
@@ -27,9 +27,9 @@ extern "C" {
# include "IMB_imbuf_types.h"
}
-MultilayerBaseOperation::MultilayerBaseOperation(int passtype, int view) : BaseImageOperation()
+MultilayerBaseOperation::MultilayerBaseOperation(int passindex, int view) : BaseImageOperation()
{
- this->m_passtype = passtype;
+ this->m_passId = passindex;
this->m_view = view;
}
@@ -39,7 +39,7 @@ ImBuf *MultilayerBaseOperation::getImBuf()
int view = this->m_imageUser->view;
this->m_imageUser->view = this->m_view;
- this->m_imageUser->passtype = this->m_passtype;
+ this->m_imageUser->pass = this->m_passId;
if (BKE_image_multilayer_index(this->m_image->rr, this->m_imageUser)) {
ImBuf *ibuf = BaseImageOperation::getImBuf();
diff --git a/source/blender/compositor/operations/COM_MultilayerImageOperation.h b/source/blender/compositor/operations/COM_MultilayerImageOperation.h
index 2e140577d74..46a9319c373 100644
--- a/source/blender/compositor/operations/COM_MultilayerImageOperation.h
+++ b/source/blender/compositor/operations/COM_MultilayerImageOperation.h
@@ -29,7 +29,7 @@
class MultilayerBaseOperation : public BaseImageOperation {
private:
- int m_passtype;
+ int m_passId;
int m_view;
RenderLayer *m_renderlayer;
protected:
@@ -38,13 +38,13 @@ public:
/**
* Constructor
*/
- MultilayerBaseOperation(int passtype, int view);
+ MultilayerBaseOperation(int passindex, int view);
void setRenderLayer(RenderLayer *renderlayer) { this->m_renderlayer = renderlayer; }
};
class MultilayerColorOperation : public MultilayerBaseOperation {
public:
- MultilayerColorOperation(int passtype, int view) : MultilayerBaseOperation(passtype, view) {
+ MultilayerColorOperation(int passindex, int view) : MultilayerBaseOperation(passindex, view) {
this->addOutputSocket(COM_DT_COLOR);
}
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
@@ -52,7 +52,7 @@ public:
class MultilayerValueOperation : public MultilayerBaseOperation {
public:
- MultilayerValueOperation(int passtype, int view) : MultilayerBaseOperation(passtype, view) {
+ MultilayerValueOperation(int passindex, int view) : MultilayerBaseOperation(passindex, view) {
this->addOutputSocket(COM_DT_VALUE);
}
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
@@ -60,7 +60,7 @@ public:
class MultilayerVectorOperation : public MultilayerBaseOperation {
public:
- MultilayerVectorOperation(int passtype, int view) : MultilayerBaseOperation(passtype, view) {
+ MultilayerVectorOperation(int passindex, int view) : MultilayerBaseOperation(passindex, view) {
this->addOutputSocket(COM_DT_VECTOR);
}
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h
index 080820e67a1..17db1cb8548 100644
--- a/source/blender/editors/include/ED_transform.h
+++ b/source/blender/editors/include/ED_transform.h
@@ -135,7 +135,7 @@ void BIF_createTransformOrientation(struct bContext *C, struct ReportList *repor
void BIF_selectTransformOrientation(struct bContext *C, struct TransformOrientation *ts);
void BIF_selectTransformOrientationValue(struct bContext *C, int orientation);
-void ED_getTransformOrientationMatrix(const struct bContext *C, float orientation_mat[3][3], const bool activeOnly);
+void ED_getTransformOrientationMatrix(const struct bContext *C, float orientation_mat[3][3], const short around);
int BIF_countTransformOrientation(const struct bContext *C);
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 42a9638d988..259e2e3a0c9 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -5703,7 +5703,9 @@ static int ui_do_but_COLORBAND(bContext *C, uiBlock *block, uiBut *but, uiHandle
{
ColorBand *coba;
CBData *cbd;
- int mx, my, a, xco, mindist = 12;
+ /* ignore zoom-level for mindist */
+ int mindist = (50 * UI_DPI_FAC) * block->aspect;
+ int mx, my, a, xco;
mx = event->x;
my = event->y;
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 356e85e9d63..b9bacb8203b 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -520,9 +520,10 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
}
if (data_path) {
+ const char *data_delim = (data_path[0] == '[') ? "" : ".";
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]),
- "%s.%s", /* no need to translate */
- id_path, data_path);
+ "%s%s%s", /* no need to translate */
+ id_path, data_delim, data_path);
MEM_freeN(data_path);
}
else if (prop) {
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index 75ee6d17307..465677a7e3f 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -190,7 +190,7 @@ static void image_buffer_rect_update(RenderJob *rj, RenderResult *rr, ImBuf *ibu
* - sergey -
*/
/* TODO(sergey): Need to check has_combined here? */
- if (iuser->passtype == SCE_PASS_COMBINED) {
+ if (iuser->pass == 0) {
RenderView *rv;
size_t view_id = BKE_scene_multiview_view_id_get(&scene->r, viewname);
rv = RE_RenderViewGetById(rr, view_id);
@@ -525,6 +525,7 @@ static void render_image_update_pass_and_layer(RenderJob *rj, RenderResult *rr,
}
}
+ iuser->pass = sima->iuser.pass;
iuser->layer = sima->iuser.layer;
RE_ReleaseResult(rj->re);
@@ -898,7 +899,6 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even
rj->write_still = is_write_still && !is_animation;
rj->iuser.scene = scene;
rj->iuser.ok = 1;
- rj->iuser.passtype = SCE_PASS_COMBINED;
rj->reports = op->reports;
rj->orig_layer = 0;
rj->last_layer = 0;
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 987a709104c..0851a40718c 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -1793,6 +1793,8 @@ ScrArea *ED_screen_full_newspace(bContext *C, ScrArea *sa, int type)
*/
void ED_screen_full_prevspace(bContext *C, ScrArea *sa, const bool was_prev_temp)
{
+ BLI_assert(sa->full);
+
if (sa->flag & AREA_FLAG_STACKED_FULLSCREEN) {
/* stacked fullscreen -> only go back to previous screen and don't toggle out of fullscreen */
ED_area_prevspace(C, sa);
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index cf13c9c1d83..7108b2bda6f 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -298,6 +298,7 @@ typedef struct ProjPaintState {
float cloneOffset[2];
float projectMat[4][4]; /* Projection matrix, use for getting screen coords */
+ float projectMatInv[4][4]; /* inverse of projectMat */
float viewDir[3]; /* View vector, use for do_backfacecull and for ray casting with an ortho viewport */
float viewPos[3]; /* View location in object relative 3D space, so can compare to verts */
float clipsta, clipend;
@@ -1247,6 +1248,55 @@ static void screen_px_from_persp(
}
+/**
+ * Set a direction vector based on a screen location.
+ * (use for perspective view, else we can simply use `ps->viewDir`)
+ *
+ * Similar functionality to #ED_view3d_win_to_vector
+ *
+ * \param r_dir: Resulting direction (length is undefined).
+ */
+static void screen_px_to_vector_persp(
+ int winx, int winy, const float projmat_inv[4][4], const float view_pos[3],
+ const float co_px[2],
+ float r_dir[3])
+{
+ r_dir[0] = 2.0f * (co_px[0] / winx) - 1.0f;
+ r_dir[1] = 2.0f * (co_px[1] / winy) - 1.0f;
+ r_dir[2] = -0.5f;
+ mul_project_m4_v3((float(*)[4])projmat_inv, r_dir);
+ sub_v3_v3(r_dir, view_pos);
+}
+
+/**
+ * Special function to return the factor fo a point along a line in pixel space.
+ *
+ * This is needed since we can't use #line_point_factor_v2 for perspective screen-space coords.
+ *
+ * \param p: 2D screen-space location.
+ * \param v1, v2: 3D object-space locations.
+ */
+static float screen_px_line_point_factor_v2_persp(
+ const ProjPaintState *ps,
+ const float p[2],
+ const float v1[3], const float v2[3])
+{
+ const float zero[3] = {0};
+ float v1_proj[3], v2_proj[3];
+ float dir[3];
+
+ screen_px_to_vector_persp(ps->winx, ps->winy, ps->projectMatInv, ps->viewPos, p, dir);
+
+ sub_v3_v3v3(v1_proj, v1, ps->viewPos);
+ sub_v3_v3v3(v2_proj, v2, ps->viewPos);
+
+ project_plane_v3_v3v3(v1_proj, v1_proj, dir);
+ project_plane_v3_v3v3(v2_proj, v2_proj, dir);
+
+ return line_point_factor_v2(zero, v1_proj, v2_proj);
+}
+
+
static void project_face_pixel(
const float *lt_tri_uv[3], ImBuf *ibuf_other, const float w[3],
unsigned char rgba_ub[4], float rgba_f[4])
@@ -2680,8 +2730,15 @@ static void project_paint_face_init(
line_clip_rect2f(clip_rect, bucket_bounds, vCoSS[fidx1], vCoSS[fidx2], bucket_clip_edges[0], bucket_clip_edges[1]))
{
if (len_squared_v2v2(vCoSS[fidx1], vCoSS[fidx2]) > FLT_EPSILON) { /* avoid div by zero */
- fac1 = line_point_factor_v2(bucket_clip_edges[0], vCoSS[fidx1], vCoSS[fidx2]);
- fac2 = line_point_factor_v2(bucket_clip_edges[1], vCoSS[fidx1], vCoSS[fidx2]);
+
+ if (is_ortho) {
+ fac1 = line_point_factor_v2(bucket_clip_edges[0], vCoSS[fidx1], vCoSS[fidx2]);
+ fac2 = line_point_factor_v2(bucket_clip_edges[1], vCoSS[fidx1], vCoSS[fidx2]);
+ }
+ else {
+ fac1 = screen_px_line_point_factor_v2_persp(ps, bucket_clip_edges[0], vCo[fidx1], vCo[fidx2]);
+ fac2 = screen_px_line_point_factor_v2_persp(ps, bucket_clip_edges[1], vCo[fidx1], vCo[fidx2]);
+ }
interp_v2_v2v2(seam_subsection[0], lt_uv_pxoffset[fidx1], lt_uv_pxoffset[fidx2], fac1);
interp_v2_v2v2(seam_subsection[1], lt_uv_pxoffset[fidx1], lt_uv_pxoffset[fidx2], fac2);
@@ -3104,6 +3161,7 @@ static void proj_paint_state_viewport_init(
mul_m4_m4m4(ps->projectMat, winmat, vmat);
}
+ invert_m4_m4(ps->projectMatInv, ps->projectMat);
/* viewDir - object relative */
copy_m3_m4(mat, viewinv);
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 6fa5f62177f..6dc1855401d 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -224,6 +224,7 @@ static bool paint_brush_update(bContext *C,
bool location_sampled = false;
bool location_success = false;
bool do_random = false;
+ bool do_random_mask = false;
/* XXX: Use pressure value from first brush step for brushes which don't
* support strokes (grab, thumb). They depends on initial state and
* brush coord/pressure/etc.
@@ -271,9 +272,11 @@ static bool paint_brush_update(bContext *C,
}
if (paint_supports_dynamic_tex_coords(brush, mode)) {
- if (((brush->mtex.brush_map_mode == MTEX_MAP_MODE_VIEW) ||
- (brush->mtex.brush_map_mode == MTEX_MAP_MODE_AREA) ||
- (brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)))
+
+ if (ELEM(brush->mtex.brush_map_mode,
+ MTEX_MAP_MODE_VIEW,
+ MTEX_MAP_MODE_AREA,
+ MTEX_MAP_MODE_RANDOM))
{
do_random = true;
}
@@ -286,6 +289,15 @@ static bool paint_brush_update(bContext *C,
/* take care of mask texture, if any */
if (brush->mask_mtex.tex) {
+
+ if (ELEM(brush->mask_mtex.brush_map_mode,
+ MTEX_MAP_MODE_VIEW,
+ MTEX_MAP_MODE_AREA,
+ MTEX_MAP_MODE_RANDOM))
+ {
+ do_random_mask = true;
+ }
+
if (brush->mask_mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)
BKE_brush_randomize_texture_coords(ups, true);
else {
@@ -357,7 +369,9 @@ static bool paint_brush_update(bContext *C,
ups->brush_rotation += -brush->mtex.random_angle / 2.0f +
brush->mtex.random_angle * BLI_frand();
}
+ }
+ if (do_random_mask) {
if (brush->mask_mtex.brush_angle_mode & MTEX_ANGLE_RANDOM) {
ups->brush_rotation_sec += -brush->mask_mtex.random_angle / 2.0f +
brush->mask_mtex.random_angle * BLI_frand();
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index f53d3781d90..0c652587ad1 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -233,6 +233,9 @@ typedef struct FileListEntryCache {
int flags;
+ /* This one gathers all entries from both block and misc caches. Used for easy bulk-freing. */
+ ListBase cached_entries;
+
/* Block cache: all entries between start and end index. used for part of the list on diplay. */
FileDirEntry **block_entries;
int block_start_index, block_end_index, block_center_index, block_cursor;
@@ -1016,6 +1019,7 @@ static void filelist_entry_free(FileDirEntry *entry)
static void filelist_direntryarr_free(FileDirEntryArr *array)
{
+#if 0
FileDirEntry *entry, *entry_next;
for (entry = array->entries.first; entry; entry = entry_next) {
@@ -1023,6 +1027,9 @@ static void filelist_direntryarr_free(FileDirEntryArr *array)
filelist_entry_free(entry);
}
BLI_listbase_clear(&array->entries);
+#else
+ BLI_assert(BLI_listbase_is_empty(&array->entries));
+#endif
array->nbr_entries = 0;
array->nbr_entries_filtered = -1;
array->entry_idx_start = -1;
@@ -1182,6 +1189,8 @@ static void filelist_cache_previews_push(FileList *filelist, FileDirEntry *entry
static void filelist_cache_init(FileListEntryCache *cache, size_t cache_size)
{
+ BLI_listbase_clear(&cache->cached_entries);
+
cache->block_cursor = cache->block_start_index = cache->block_center_index = cache->block_end_index = 0;
cache->block_entries = MEM_mallocN(sizeof(*cache->block_entries) * cache_size, __func__);
@@ -1200,30 +1209,38 @@ static void filelist_cache_init(FileListEntryCache *cache, size_t cache_size)
static void filelist_cache_free(FileListEntryCache *cache)
{
+ FileDirEntry *entry, *entry_next;
+
if (!(cache->flags & FLC_IS_INIT)) {
return;
}
filelist_cache_previews_free(cache, true);
- /* Note we nearly have nothing to do here, entries are just 'borrowed', not owned by cache... */
MEM_freeN(cache->block_entries);
BLI_ghash_free(cache->misc_entries, NULL, NULL);
MEM_freeN(cache->misc_entries_indices);
BLI_ghash_free(cache->uuids, NULL, NULL);
+
+ for (entry = cache->cached_entries.first; entry; entry = entry_next) {
+ entry_next = entry->next;
+ filelist_entry_free(entry);
+ }
+ BLI_listbase_clear(&cache->cached_entries);
}
static void filelist_cache_clear(FileListEntryCache *cache, size_t new_size)
{
+ FileDirEntry *entry, *entry_next;
+
if (!(cache->flags & FLC_IS_INIT)) {
return;
}
filelist_cache_previews_clear(cache);
- /* Note we nearly have nothing to do here, entries are just 'borrowed', not owned by cache... */
cache->block_cursor = cache->block_start_index = cache->block_center_index = cache->block_end_index = 0;
if (new_size != cache->size) {
cache->block_entries = MEM_reallocN(cache->block_entries, sizeof(*cache->block_entries) * new_size);
@@ -1239,6 +1256,12 @@ static void filelist_cache_clear(FileListEntryCache *cache, size_t new_size)
BLI_ghash_clear_ex(cache->uuids, NULL, NULL, new_size * 2);
cache->size = new_size;
+
+ for (entry = cache->cached_entries.first; entry; entry = entry_next) {
+ entry_next = entry->next;
+ filelist_entry_free(entry);
+ }
+ BLI_listbase_clear(&cache->cached_entries);
}
FileList *filelist_new(short type)
@@ -1417,6 +1440,7 @@ int filelist_files_ensure(FileList *filelist)
static FileDirEntry *filelist_file_create_entry(FileList *filelist, const int index)
{
FileListInternEntry *entry = filelist->filelist_intern.filtered[index];
+ FileListEntryCache *cache = &filelist->filelist_cache;
FileDirEntry *ret;
FileDirEntryRevision *rev;
@@ -1435,13 +1459,13 @@ static FileDirEntry *filelist_file_create_entry(FileList *filelist, const int in
ret->blentype = entry->blentype;
ret->typeflag = entry->typeflag;
- BLI_addtail(&filelist->filelist.entries, ret);
+ BLI_addtail(&cache->cached_entries, ret);
return ret;
}
static void filelist_file_release_entry(FileList *filelist, FileDirEntry *entry)
{
- BLI_remlink(&filelist->filelist.entries, entry);
+ BLI_remlink(&filelist->filelist_cache.cached_entries, entry);
filelist_entry_free(entry);
}
@@ -2167,14 +2191,14 @@ static int filelist_readjob_list_dir(
entry = MEM_callocN(sizeof(*entry), __func__);
entry->relpath = MEM_dupallocN(files[i].relname);
- if (S_ISDIR(files[i].s.st_mode)) {
- entry->typeflag |= FILE_TYPE_DIR;
- }
entry->st = files[i].s;
/* Set file type. */
- /* If we are considering .blend files as libs, promote them to directory status! */
- if (do_lib && BLO_has_bfile_extension(entry->relpath)) {
+ if (S_ISDIR(files[i].s.st_mode)) {
+ entry->typeflag = FILE_TYPE_DIR;
+ }
+ else if (do_lib && BLO_has_bfile_extension(entry->relpath)) {
+ /* If we are considering .blend files as libs, promote them to directory status. */
char name[FILE_MAX];
entry->typeflag = FILE_TYPE_BLENDER;
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index 579860726c6..3af210f376b 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -418,7 +418,7 @@ static void ui_imageuser_pass_menu(bContext *UNUSED(C), uiLayout *layout, void *
uiItemS(layout);
- nr = (rl ? BLI_listbase_count(&rl->passes) : 0) - 1;
+ nr = 0;
fake_name = ui_imageuser_pass_fake_name(rl);
if (fake_name) {
@@ -427,7 +427,8 @@ static void ui_imageuser_pass_menu(bContext *UNUSED(C), uiLayout *layout, void *
}
/* rendered results don't have a Combined pass */
- for (rpass = rl ? rl->passes.last : NULL; rpass; rpass = rpass->prev, nr--) {
+ /* multiview: the ordering must be ascending, so the left-most pass is always the one picked */
+ for (rpass = rl ? rl->passes.first : NULL; rpass; rpass = rpass->next, nr++) {
/* just show one pass of each kind */
if (passflag & rpass->passtype)
@@ -436,18 +437,17 @@ static void ui_imageuser_pass_menu(bContext *UNUSED(C), uiLayout *layout, void *
passflag |= rpass->passtype;
final:
- uiDefButI(block, UI_BTYPE_BUT_MENU, B_NOP, IFACE_(rpass->internal_name), 0, 0,
- UI_UNIT_X * 5, UI_UNIT_X, &iuser->passtype, (float) rpass->passtype, 0.0, 0, -1, "");
+ uiDefButS(block, UI_BTYPE_BUT_MENU, B_NOP, IFACE_(rpass->internal_name), 0, 0,
+ UI_UNIT_X * 5, UI_UNIT_X, &iuser->pass, (float) nr, 0.0, 0, -1, "");
}
if (fake_name) {
fake_name = NULL;
rpass = &rpass_fake;
+ nr = 0;
goto final;
}
- BLI_assert(nr == -1);
-
BKE_image_release_renderresult(scene, image);
}
@@ -550,7 +550,6 @@ static void image_multi_incpass_cb(bContext *C, void *rr_v, void *iuser_v)
ImageUser *iuser = iuser_v;
RenderLayer *rl;
RenderPass *rp;
- RenderPass *next = NULL;
int layer = iuser->layer;
if (RE_HasFakeLayer(rr))
@@ -559,20 +558,20 @@ static void image_multi_incpass_cb(bContext *C, void *rr_v, void *iuser_v)
rl = BLI_findlink(&rr->layers, layer);
if (rl) {
- for (rp = rl->passes.first; rp; rp = rp->next) {
- if (rp->passtype == iuser->passtype) {
- next = rp->next;
- if (next != NULL && next->passtype == rp->passtype)
- next = next->next;
+ RenderPass *rpass = BLI_findlink(&rl->passes, iuser->pass);
+ int rp_index = iuser->pass + 1;
+
+ if (rpass == NULL)
+ return;
+
+ for (rp = rpass->next; rp; rp = rp->next, rp_index++) {
+ if (rp->passtype != rpass->passtype) {
+ iuser->pass = rp_index;
+ BKE_image_multilayer_index(rr, iuser);
+ WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
break;
}
}
-
- if (next != NULL && iuser->passtype != next->passtype) {
- iuser->passtype = next->passtype;
- BKE_image_multilayer_index(rr, iuser);
- WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
- }
}
}
static void image_multi_decpass_cb(bContext *C, void *rr_v, void *iuser_v)
@@ -581,29 +580,31 @@ static void image_multi_decpass_cb(bContext *C, void *rr_v, void *iuser_v)
ImageUser *iuser = iuser_v;
RenderLayer *rl;
RenderPass *rp;
- RenderPass *prev = NULL;
int layer = iuser->layer;
+ if (iuser->pass == 0)
+ return;
+
if (RE_HasFakeLayer(rr))
layer -= 1;
rl = BLI_findlink(&rr->layers, layer);
if (rl) {
- for (rp = rl->passes.last; rp; rp = rp->prev) {
- if (rp->passtype == iuser->passtype) {
- prev = rp->prev;
- if (prev != NULL && prev->passtype == rp->passtype)
- prev = prev->prev;
+ RenderPass *rpass = BLI_findlink(&rl->passes, iuser->pass);
+ int rp_index = 0;
+
+ if (rpass == NULL)
+ return;
+
+ for (rp = rl->passes.first; rp; rp = rp->next, rp_index++) {
+ if (rp->passtype == rpass->passtype) {
+ iuser->pass = rp_index - 1;
+ BKE_image_multilayer_index(rr, iuser);
+ WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
break;
}
}
-
- if (prev != NULL && iuser->passtype != prev->passtype) {
- iuser->passtype = prev->passtype;
- BKE_image_multilayer_index(rr, iuser);
- WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
- }
}
}
@@ -692,7 +693,7 @@ static void uiblock_layer_pass_buttons(uiLayout *layout, Image *image, RenderRes
/* pass */
fake_name = ui_imageuser_pass_fake_name(rl);
- rpass = (rl ? RE_pass_find_by_type(rl, iuser->passtype, ((RenderView *)rr->views.first)->name) : NULL);
+ rpass = (rl ? BLI_findlink(&rl->passes, iuser->pass - (fake_name ? 1 : 0)) : NULL);
display_name = rpass ? rpass->internal_name : (fake_name ? fake_name : "");
but = uiDefMenuBut(block, ui_imageuser_pass_menu, rnd_pt, IFACE_(display_name),
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 928e064b730..98a0752f64d 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -157,7 +157,6 @@ static SpaceLink *image_new(const bContext *UNUSED(C))
simage->iuser.fie_ima = 2;
simage->iuser.frames = 100;
simage->iuser.flag = IMA_SHOW_STEREO;
- simage->iuser.passtype = SCE_PASS_COMBINED;
scopes_new(&simage->scopes);
simage->sample_line_hist.height = 100;
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 1ddd25f9219..6d420674f3e 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -220,7 +220,7 @@ static void do_item_rename(ARegion *ar, TreeElement *te, TreeStoreElem *tselem,
else if (tselem->id->lib) {
BKE_report(reports, RPT_WARNING, "Cannot edit external libdata");
}
- else if (te->idcode == ID_LI && te->parent) {
+ else if (te->idcode == ID_LI && ((Library *)tselem->id)->parent) {
BKE_report(reports, RPT_WARNING, "Cannot edit the path of an indirectly linked library");
}
else {
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index b18dd31d286..c89a1bb1b9f 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -68,47 +68,6 @@ typedef struct TreeElement {
#define TE_LAZY_CLOSED 4
#define TE_FREE_NAME 8
-/* TreeStoreElem types */
-#define TSE_NLA 1
-#define TSE_NLA_ACTION 2
-#define TSE_DEFGROUP_BASE 3
-#define TSE_DEFGROUP 4
-#define TSE_BONE 5
-#define TSE_EBONE 6
-#define TSE_CONSTRAINT_BASE 7
-#define TSE_CONSTRAINT 8
-#define TSE_MODIFIER_BASE 9
-#define TSE_MODIFIER 10
-#define TSE_LINKED_OB 11
-// #define TSE_SCRIPT_BASE 12 // UNUSED
-#define TSE_POSE_BASE 13
-#define TSE_POSE_CHANNEL 14
-#define TSE_ANIM_DATA 15
-#define TSE_DRIVER_BASE 16
-#define TSE_DRIVER 17
-
-#define TSE_PROXY 18
-#define TSE_R_LAYER_BASE 19
-#define TSE_R_LAYER 20
-#define TSE_R_PASS 21
-#define TSE_LINKED_MAT 22
-/* NOTE, is used for light group */
-#define TSE_LINKED_LAMP 23
-#define TSE_POSEGRP_BASE 24
-#define TSE_POSEGRP 25
-#define TSE_SEQUENCE 26
-#define TSE_SEQ_STRIP 27
-#define TSE_SEQUENCE_DUP 28
-#define TSE_LINKED_PSYS 29
-#define TSE_RNA_STRUCT 30
-#define TSE_RNA_PROPERTY 31
-#define TSE_RNA_ARRAY_ELEM 32
-#define TSE_NLA_TRACK 33
-#define TSE_KEYMAP 34
-#define TSE_KEYMAP_ITEM 35
-#define TSE_ID_BASE 36
-#define TSE_GP_LAYER 37
-
/* button events */
#define OL_NAMEBUTTON 1
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 37fa007b4a7..d84ab595b22 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -3769,7 +3769,7 @@ static void axis_set_view(bContext *C, View3D *v3d, ARegion *ar,
float twmat[3][3];
/* same as transform manipulator when normal is set */
- ED_getTransformOrientationMatrix(C, twmat, true);
+ ED_getTransformOrientationMatrix(C, twmat, V3D_ACTIVE);
mat3_to_quat(obact_quat, twmat);
invert_qt(obact_quat);
diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c
index e2fbbf58a5c..0bda6e37fd1 100644
--- a/source/blender/editors/space_view3d/view3d_walk.c
+++ b/source/blender/editors/space_view3d/view3d_walk.c
@@ -62,6 +62,9 @@
#define USE_TABLET_SUPPORT
+/* ensure the target position is one we can reach, see: T45771 */
+#define USE_PIXELSIZE_NATIVE_SUPPORT
+
/* prototypes */
static float getVelocityZeroTime(const float gravity, const float velocity);
@@ -578,6 +581,16 @@ static bool initWalkInfo(bContext *C, WalkInfo *walk, wmOperator *op)
walk->center_mval[0] = walk->ar->winx * 0.5f;
walk->center_mval[1] = walk->ar->winy * 0.5f;
+#ifdef USE_PIXELSIZE_NATIVE_SUPPORT
+ walk->center_mval[0] += walk->ar->winrct.xmin;
+ walk->center_mval[1] += walk->ar->winrct.ymin;
+
+ WM_cursor_compatible_xy(win, &walk->center_mval[0], &walk->center_mval[1]);
+
+ walk->center_mval[0] -= walk->ar->winrct.xmin;
+ walk->center_mval[1] -= walk->ar->winrct.ymin;
+#endif
+
copy_v2_v2_int(walk->prev_mval, walk->center_mval);
WM_cursor_warp(win,
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 3cc53807d8d..d8000f03e86 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -2075,47 +2075,41 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
t->launch_event = LEFTMOUSE;
}
+ unit_m3(t->spacemtx);
+
initTransInfo(C, t, op, event);
+ initTransformOrientation(C, t);
if (t->spacetype == SPACE_VIEW3D) {
- initTransformOrientation(C, t);
-
t->draw_handle_apply = ED_region_draw_cb_activate(t->ar->type, drawTransformApply, t, REGION_DRAW_PRE_VIEW);
t->draw_handle_view = ED_region_draw_cb_activate(t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW);
t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL);
t->draw_handle_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), helpline_poll, drawHelpline, t);
}
else if (t->spacetype == SPACE_IMAGE) {
- unit_m3(t->spacemtx);
t->draw_handle_view = ED_region_draw_cb_activate(t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW);
//t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL);
t->draw_handle_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), helpline_poll, drawHelpline, t);
}
else if (t->spacetype == SPACE_CLIP) {
- unit_m3(t->spacemtx);
t->draw_handle_view = ED_region_draw_cb_activate(t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW);
t->draw_handle_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), helpline_poll, drawHelpline, t);
}
else if (t->spacetype == SPACE_NODE) {
- unit_m3(t->spacemtx);
/*t->draw_handle_apply = ED_region_draw_cb_activate(t->ar->type, drawTransformApply, t, REGION_DRAW_PRE_VIEW);*/
t->draw_handle_view = ED_region_draw_cb_activate(t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW);
t->draw_handle_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), helpline_poll, drawHelpline, t);
}
else if (t->spacetype == SPACE_IPO) {
- unit_m3(t->spacemtx);
t->draw_handle_view = ED_region_draw_cb_activate(t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW);
//t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL);
t->draw_handle_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), helpline_poll, drawHelpline, t);
}
else if (t->spacetype == SPACE_ACTION) {
- unit_m3(t->spacemtx);
t->draw_handle_view = ED_region_draw_cb_activate(t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW);
//t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL);
t->draw_handle_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), helpline_poll, drawHelpline, t);
}
- else
- unit_m3(t->spacemtx);
createTransData(C, t); // make TransData structs from selection
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index cdd260b3edb..aab065675fe 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -727,7 +727,7 @@ bool createSpaceNormalTangent(float mat[3][3], const float normal[3], const floa
struct TransformOrientation *addMatrixSpace(struct bContext *C, float mat[3][3],
const char *name, const bool overwrite);
-bool applyTransformOrientation(const struct bContext *C, float mat[3][3], char r_name[64]);
+bool applyTransformOrientation(const struct bContext *C, float mat[3][3], char r_name[64], int index);
#define ORIENTATION_NONE 0
#define ORIENTATION_NORMAL 1
@@ -735,7 +735,8 @@ bool applyTransformOrientation(const struct bContext *C, float mat[3][3], char r
#define ORIENTATION_EDGE 3
#define ORIENTATION_FACE 4
-int getTransformOrientation(const struct bContext *C, float normal[3], float plane[3], const bool activeOnly);
+int getTransformOrientation_ex(const struct bContext *C, float normal[3], float plane[3], const short around);
+int getTransformOrientation(const struct bContext *C, float normal[3], float plane[3]);
void freeEdgeSlideTempFaces(EdgeSlideData *sld);
void freeEdgeSlideVerts(TransInfo *t);
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index a08abb866e8..03f62a39a92 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1206,18 +1206,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
t->around = V3D_CURSOR;
}
- if (op && ((prop = RNA_struct_find_property(op->ptr, "constraint_orientation")) &&
- RNA_property_is_set(op->ptr, prop)))
- {
- t->current_orientation = RNA_property_enum_get(op->ptr, prop);
-
- if (t->current_orientation >= V3D_MANIP_CUSTOM + BIF_countTransformOrientation(C)) {
- t->current_orientation = V3D_MANIP_GLOBAL;
- }
- }
- else {
- t->current_orientation = v3d->twmode;
- }
+ t->current_orientation = v3d->twmode;
/* exceptional case */
if (t->around == V3D_LOCAL) {
@@ -1304,6 +1293,16 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
}
t->around = V3D_CENTER;
}
+
+ if (op && ((prop = RNA_struct_find_property(op->ptr, "constraint_orientation")) &&
+ RNA_property_is_set(op->ptr, prop)))
+ {
+ t->current_orientation = RNA_property_enum_get(op->ptr, prop);
+
+ if (t->current_orientation >= V3D_MANIP_CUSTOM + BIF_countTransformOrientation(C)) {
+ t->current_orientation = V3D_MANIP_GLOBAL;
+ }
+ }
if (op && ((prop = RNA_struct_find_property(op->ptr, "release_confirm")) &&
RNA_property_is_set(op->ptr, prop)))
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index 309c538de74..be0e67cd5b2 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -885,7 +885,7 @@ static int calc_manipulator_stats(const bContext *C)
/* fall-through */
case V3D_MANIP_NORMAL:
if (obedit || ob->mode & OB_MODE_POSE) {
- ED_getTransformOrientationMatrix(C, mat, (v3d->around == V3D_ACTIVE));
+ ED_getTransformOrientationMatrix(C, mat, v3d->around);
copy_m4_m3(rv3d->twmat, mat);
break;
}
@@ -897,7 +897,7 @@ static int calc_manipulator_stats(const bContext *C)
* use the active pones axis for display [#33575], this works as expected on a single bone
* and users who select many bones will understand whats going on and what local means
* when they start transforming */
- ED_getTransformOrientationMatrix(C, mat, (v3d->around == V3D_ACTIVE));
+ ED_getTransformOrientationMatrix(C, mat, v3d->around);
copy_m4_m3(rv3d->twmat, mat);
break;
}
@@ -910,7 +910,7 @@ static int calc_manipulator_stats(const bContext *C)
copy_m4_m3(rv3d->twmat, mat);
break;
default: /* V3D_MANIP_CUSTOM */
- if (applyTransformOrientation(C, mat, NULL)) {
+ if (applyTransformOrientation(C, mat, NULL, v3d->twmode - V3D_MANIP_CUSTOM)) {
copy_m4_m3(rv3d->twmat, mat);
}
break;
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index cea19e928bc..d6fbc46715e 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -36,6 +36,7 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
#include "BLI_math.h"
@@ -144,7 +145,7 @@ static TransformOrientation *createBoneSpace(bContext *C, ReportList *reports,
float mat[3][3];
float normal[3], plane[3];
- getTransformOrientation(C, normal, plane, 0);
+ getTransformOrientation(C, normal, plane);
if (createSpaceNormalTangent(mat, normal, plane) == 0) {
BKE_reports_prepend(reports, "Cannot use zero-length bone");
@@ -164,7 +165,7 @@ static TransformOrientation *createCurveSpace(bContext *C, ReportList *reports,
float mat[3][3];
float normal[3], plane[3];
- getTransformOrientation(C, normal, plane, 0);
+ getTransformOrientation(C, normal, plane);
if (createSpaceNormalTangent(mat, normal, plane) == 0) {
BKE_reports_prepend(reports, "Cannot use zero-length curve");
@@ -186,7 +187,7 @@ static TransformOrientation *createMeshSpace(bContext *C, ReportList *reports,
float normal[3], plane[3];
int type;
- type = getTransformOrientation(C, normal, plane, 0);
+ type = getTransformOrientation(C, normal, plane);
switch (type) {
case ORIENTATION_VERT:
@@ -390,15 +391,12 @@ int BIF_countTransformOrientation(const bContext *C)
return BLI_listbase_count(transform_spaces);
}
-bool applyTransformOrientation(const bContext *C, float mat[3][3], char *r_name)
+bool applyTransformOrientation(const bContext *C, float mat[3][3], char *r_name, int index)
{
- View3D *v3d = CTX_wm_view3d(C);
- int selected_index = (v3d->twmode - V3D_MANIP_CUSTOM);
-
ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces;
- TransformOrientation *ts = BLI_findlink(transform_spaces, selected_index);
+ TransformOrientation *ts = BLI_findlink(transform_spaces, index);
- BLI_assert(selected_index >= 0);
+ BLI_assert(index >= 0);
if (ts) {
if (r_name) {
@@ -442,7 +440,6 @@ static int count_bone_select(bArmature *arm, ListBase *lb, const bool do_it)
void initTransformOrientation(bContext *C, TransInfo *t)
{
- View3D *v3d = CTX_wm_view3d(C);
Object *ob = CTX_data_active_object(C);
Object *obedit = CTX_data_active_object(C);
@@ -462,7 +459,7 @@ void initTransformOrientation(bContext *C, TransInfo *t)
case V3D_MANIP_NORMAL:
if (obedit || (ob && ob->mode & OB_MODE_POSE)) {
BLI_strncpy(t->spacename, IFACE_("normal"), sizeof(t->spacename));
- ED_getTransformOrientationMatrix(C, t->spacemtx, (v3d->around == V3D_ACTIVE));
+ ED_getTransformOrientationMatrix(C, t->spacemtx, t->around);
break;
}
/* fall-through */ /* we define 'normal' as 'local' in Object mode */
@@ -480,7 +477,9 @@ void initTransformOrientation(bContext *C, TransInfo *t)
break;
case V3D_MANIP_VIEW:
- if (t->ar->regiontype == RGN_TYPE_WINDOW) {
+ if ((t->spacetype == SPACE_VIEW3D) &&
+ (t->ar->regiontype == RGN_TYPE_WINDOW))
+ {
RegionView3D *rv3d = t->ar->regiondata;
float mat[3][3];
@@ -494,7 +493,7 @@ void initTransformOrientation(bContext *C, TransInfo *t)
}
break;
default: /* V3D_MANIP_CUSTOM */
- if (applyTransformOrientation(C, t->spacemtx, t->spacename)) {
+ if (applyTransformOrientation(C, t->spacemtx, t->spacename, t->current_orientation - V3D_MANIP_CUSTOM)) {
/* pass */
}
else {
@@ -585,14 +584,14 @@ static unsigned int bm_mesh_faces_select_get_n(BMesh *bm, BMVert **elems, const
}
#endif
-int getTransformOrientation(const bContext *C, float normal[3], float plane[3], const bool activeOnly)
+int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3], const short around)
{
Scene *scene = CTX_data_scene(C);
- View3D *v3d = CTX_wm_view3d(C);
Object *obedit = CTX_data_edit_object(C);
Base *base;
Object *ob = OBACT;
int result = ORIENTATION_NONE;
+ const bool activeOnly = (around == V3D_ACTIVE);
zero_v3(normal);
zero_v3(plane);
@@ -855,7 +854,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
/* exception */
if (flag) {
float tvec[3];
- if ((v3d->around == V3D_LOCAL) ||
+ if ((around == V3D_LOCAL) ||
ELEM(flag, SEL_F2, SEL_F1 | SEL_F3, SEL_F1 | SEL_F2 | SEL_F3))
{
BKE_nurb_bezt_calc_normal(nu, bezt, tvec);
@@ -1017,6 +1016,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
}
else {
/* we need the one selected object, if its not active */
+ View3D *v3d = CTX_wm_view3d(C);
ob = OBACT;
if (ob && (ob->flag & SELECT)) {
/* pass */
@@ -1042,14 +1042,22 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
return result;
}
-void ED_getTransformOrientationMatrix(const bContext *C, float orientation_mat[3][3], const bool activeOnly)
+int getTransformOrientation(const bContext *C, float normal[3], float plane[3])
+{
+ /* dummy value, not V3D_ACTIVE and not V3D_LOCAL */
+ short around = V3D_CENTER;
+
+ return getTransformOrientation_ex(C, normal, plane, around);
+}
+
+void ED_getTransformOrientationMatrix(const bContext *C, float orientation_mat[3][3], const short around)
{
float normal[3] = {0.0, 0.0, 0.0};
float plane[3] = {0.0, 0.0, 0.0};
int type;
- type = getTransformOrientation(C, normal, plane, activeOnly);
+ type = getTransformOrientation_ex(C, normal, plane, around);
switch (type) {
case ORIENTATION_NORMAL:
diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h
index 6088dccd4e9..56a8842a8d2 100644
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@ -55,7 +55,8 @@ typedef struct ImageUser {
char ok;
char multiview_eye; /* multiview current eye - for internal use of drawing routines */
- int passtype;
+ short pass;
+ short pad;
short multi_index, view, layer; /* listbase indices, for menu browsing or retrieve buffer */
short flag;
diff --git a/source/blender/makesdna/DNA_outliner_types.h b/source/blender/makesdna/DNA_outliner_types.h
index 53061b55e2d..984e3334414 100644
--- a/source/blender/makesdna/DNA_outliner_types.h
+++ b/source/blender/makesdna/DNA_outliner_types.h
@@ -56,7 +56,55 @@ typedef struct TreeStore {
#define TSE_CHILDSEARCH 8
#define TSE_SEARCHMATCH 16
-/* TreeStoreElem types in BIF_outliner.h */
+/* TreeStoreElem->types */
+#define TSE_NLA 1 /* NO ID */
+#define TSE_NLA_ACTION 2
+#define TSE_DEFGROUP_BASE 3
+#define TSE_DEFGROUP 4
+#define TSE_BONE 5
+#define TSE_EBONE 6
+#define TSE_CONSTRAINT_BASE 7
+#define TSE_CONSTRAINT 8
+#define TSE_MODIFIER_BASE 9
+#define TSE_MODIFIER 10
+#define TSE_LINKED_OB 11
+/* #define TSE_SCRIPT_BASE 12 */ /* UNUSED */
+#define TSE_POSE_BASE 13
+#define TSE_POSE_CHANNEL 14
+#define TSE_ANIM_DATA 15
+#define TSE_DRIVER_BASE 16 /* NO ID */
+/* #define TSE_DRIVER 17 */ /* UNUSED */
+
+#define TSE_PROXY 18
+#define TSE_R_LAYER_BASE 19
+#define TSE_R_LAYER 20
+#define TSE_R_PASS 21
+#define TSE_LINKED_MAT 22
+/* NOTE, is used for light group */
+#define TSE_LINKED_LAMP 23
+#define TSE_POSEGRP_BASE 24
+#define TSE_POSEGRP 25
+#define TSE_SEQUENCE 26 /* NO ID */
+#define TSE_SEQ_STRIP 27 /* NO ID */
+#define TSE_SEQUENCE_DUP 28 /* NO ID */
+#define TSE_LINKED_PSYS 29
+#define TSE_RNA_STRUCT 30 /* NO ID */
+#define TSE_RNA_PROPERTY 31 /* NO ID */
+#define TSE_RNA_ARRAY_ELEM 32 /* NO ID */
+#define TSE_NLA_TRACK 33 /* NO ID */
+#define TSE_KEYMAP 34 /* NO ID */
+#define TSE_KEYMAP_ITEM 35 /* NO ID */
+#define TSE_ID_BASE 36 /* NO ID */
+#define TSE_GP_LAYER 37 /* NO ID */
+
+
+/* Check whether given TreeStoreElem should have a real ID in its ->id member. */
+#define TSE_IS_REAL_ID(_tse) \
+ (!ELEM((_tse)->type, TSE_NLA, TSE_NLA_TRACK, TSE_DRIVER_BASE, \
+ TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP, \
+ TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM, \
+ TSE_KEYMAP, TSE_KEYMAP_ITEM, TSE_ID_BASE, TSE_GP_LAYER))
+
#endif
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 41bb0386ce6..b7478fd3311 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -4720,6 +4720,7 @@ char *RNA_path_full_struct_py(struct PointerRNA *ptr)
char *RNA_path_full_property_py(PointerRNA *ptr, PropertyRNA *prop, int index)
{
char *id_path;
+ const char *data_delim;
char *data_path;
char *ret;
@@ -4733,13 +4734,15 @@ char *RNA_path_full_property_py(PointerRNA *ptr, PropertyRNA *prop, int index)
data_path = RNA_path_from_ID_to_property(ptr, prop);
+ data_delim = (data_path && data_path[0] == '[') ? "" : ".";
+
if ((index == -1) || (RNA_property_array_check(prop) == false)) {
- ret = BLI_sprintfN("%s.%s",
- id_path, data_path);
+ ret = BLI_sprintfN("%s%s%s",
+ id_path, data_delim, data_path);
}
else {
- ret = BLI_sprintfN("%s.%s[%d]",
- id_path, data_path, index);
+ ret = BLI_sprintfN("%s%s%s[%d]",
+ id_path, data_delim, data_path, index);
}
MEM_freeN(id_path);
if (data_path) {
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index 0d0b440ec08..561f5c9dd26 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -539,6 +539,11 @@ static void rna_def_imageuser(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */
RNA_def_property_ui_text(prop, "Layer", "Layer in multilayer image");
+ prop = RNA_def_property(srna, "multilayer_pass", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "pass");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */
+ RNA_def_property_ui_text(prop, "Pass", "Pass in multilayer image");
+
prop = RNA_def_property(srna, "multilayer_view", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "view");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */
diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c
index 88f0fbf4ce0..cd6ef3f16a4 100644
--- a/source/blender/python/generic/bgl.c
+++ b/source/blender/python/generic/bgl.c
@@ -1667,6 +1667,13 @@ static void py_module_dict_add_int(PyObject *dict, const char *name, int value)
Py_DECREF(item);
}
+static void py_module_dict_add_int64(PyObject *dict, const char *name, int64_t value)
+{
+ PyObject *item;
+ PyDict_SetItemString(dict, name, item = PyLong_FromLongLong(value));
+ Py_DECREF(item);
+}
+
static void py_module_dict_add_method(PyObject *submodule, PyObject *dict, PyMethodDef *method_def, bool is_valid)
{
if (is_valid) {
@@ -2332,6 +2339,7 @@ PyObject *BPyInit_bgl(void)
}
#define PY_DICT_ADD_INT(x) py_module_dict_add_int(dict, #x, x)
+#define PY_DICT_ADD_INT64(x) py_module_dict_add_int64(dict, #x, x)
/* GL_VERSION_1_1 */
{
@@ -3024,15 +3032,57 @@ PyObject *BPyInit_bgl(void)
/* GL_VERSION_1_4 */
{
+ PY_DICT_ADD_INT(GL_BLEND_DST_ALPHA);
+ PY_DICT_ADD_INT(GL_BLEND_DST_RGB);
+ PY_DICT_ADD_INT(GL_BLEND_SRC_ALPHA);
+ PY_DICT_ADD_INT(GL_BLEND_SRC_RGB);
PY_DICT_ADD_INT(GL_CONSTANT_ALPHA);
PY_DICT_ADD_INT(GL_CONSTANT_COLOR);
+ PY_DICT_ADD_INT(GL_DECR_WRAP);
+ PY_DICT_ADD_INT(GL_DEPTH_COMPONENT16);
+ PY_DICT_ADD_INT(GL_DEPTH_COMPONENT24);
+ PY_DICT_ADD_INT(GL_DEPTH_COMPONENT32);
PY_DICT_ADD_INT(GL_FUNC_ADD);
PY_DICT_ADD_INT(GL_FUNC_REVERSE_SUBTRACT);
PY_DICT_ADD_INT(GL_FUNC_SUBTRACT);
+ PY_DICT_ADD_INT(GL_INCR_WRAP);
PY_DICT_ADD_INT(GL_MAX);
+ PY_DICT_ADD_INT(GL_MAX_TEXTURE_LOD_BIAS);
PY_DICT_ADD_INT(GL_MIN);
+ PY_DICT_ADD_INT(GL_MIRRORED_REPEAT);
PY_DICT_ADD_INT(GL_ONE_MINUS_CONSTANT_ALPHA);
PY_DICT_ADD_INT(GL_ONE_MINUS_CONSTANT_COLOR);
+ PY_DICT_ADD_INT(GL_POINT_FADE_THRESHOLD_SIZE);
+ PY_DICT_ADD_INT(GL_TEXTURE_COMPARE_FUNC);
+ PY_DICT_ADD_INT(GL_TEXTURE_COMPARE_MODE);
+ PY_DICT_ADD_INT(GL_TEXTURE_DEPTH_SIZE);
+ PY_DICT_ADD_INT(GL_TEXTURE_LOD_BIAS);
+ }
+ /* adding in GL_VERSION_1_4 removed from core profile */
+ if (use_deprecated == true) {
+ PY_DICT_ADD_INT(GL_COLOR_SUM);
+ PY_DICT_ADD_INT(GL_COMPARE_R_TO_TEXTURE);
+ PY_DICT_ADD_INT(GL_CURRENT_FOG_COORDINATE);
+ PY_DICT_ADD_INT(GL_CURRENT_SECONDARY_COLOR);
+ PY_DICT_ADD_INT(GL_DEPTH_TEXTURE_MODE);
+ PY_DICT_ADD_INT(GL_FOG_COORDINATE);
+ PY_DICT_ADD_INT(GL_FOG_COORDINATE_ARRAY);
+ PY_DICT_ADD_INT(GL_FOG_COORDINATE_ARRAY_POINTER);
+ PY_DICT_ADD_INT(GL_FOG_COORDINATE_ARRAY_STRIDE);
+ PY_DICT_ADD_INT(GL_FOG_COORDINATE_ARRAY_TYPE);
+ PY_DICT_ADD_INT(GL_FOG_COORDINATE_SOURCE);
+ PY_DICT_ADD_INT(GL_FRAGMENT_DEPTH);
+ PY_DICT_ADD_INT(GL_GENERATE_MIPMAP);
+ PY_DICT_ADD_INT(GL_GENERATE_MIPMAP_HINT);
+ PY_DICT_ADD_INT(GL_POINT_DISTANCE_ATTENUATION);
+ PY_DICT_ADD_INT(GL_POINT_SIZE_MAX);
+ PY_DICT_ADD_INT(GL_POINT_SIZE_MIN);
+ PY_DICT_ADD_INT(GL_SECONDARY_COLOR_ARRAY);
+ PY_DICT_ADD_INT(GL_SECONDARY_COLOR_ARRAY_POINTER);
+ PY_DICT_ADD_INT(GL_SECONDARY_COLOR_ARRAY_SIZE);
+ PY_DICT_ADD_INT(GL_SECONDARY_COLOR_ARRAY_STRIDE);
+ PY_DICT_ADD_INT(GL_SECONDARY_COLOR_ARRAY_TYPE);
+ PY_DICT_ADD_INT(GL_TEXTURE_FILTER_CONTROL);
}
@@ -3216,23 +3266,262 @@ PyObject *BPyInit_bgl(void)
PY_DICT_ADD_INT(GL_SLUMINANCE_ALPHA);
}
-
/* GL_VERSION_3_0 */
{
+ PY_DICT_ADD_INT(GL_BGRA_INTEGER);
+ PY_DICT_ADD_INT(GL_BGR_INTEGER);
+ PY_DICT_ADD_INT(GL_BLUE_INTEGER);
+ PY_DICT_ADD_INT(GL_BUFFER_ACCESS_FLAGS);
+ PY_DICT_ADD_INT(GL_BUFFER_MAP_LENGTH);
+ PY_DICT_ADD_INT(GL_BUFFER_MAP_OFFSET);
+ PY_DICT_ADD_INT(GL_CLAMP_READ_COLOR);
+ PY_DICT_ADD_INT(GL_CLIP_DISTANCE0);
+ PY_DICT_ADD_INT(GL_CLIP_DISTANCE1);
+ PY_DICT_ADD_INT(GL_CLIP_DISTANCE2);
+ PY_DICT_ADD_INT(GL_CLIP_DISTANCE3);
+ PY_DICT_ADD_INT(GL_CLIP_DISTANCE4);
+ PY_DICT_ADD_INT(GL_CLIP_DISTANCE5);
+#if 0
+ PY_DICT_ADD_INT(GL_CLIP_DISTANCE6);
+ PY_DICT_ADD_INT(GL_CLIP_DISTANCE7);
+#endif
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT0);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT1);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT2);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT3);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT4);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT5);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT6);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT7);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT8);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT9);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT10);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT11);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT12);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT13);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT14);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT15);
+#if 0
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT16);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT17);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT18);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT19);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT20);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT21);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT22);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT23);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT24);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT25);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT26);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT27);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT28);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT29);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT30);
+ PY_DICT_ADD_INT(GL_COLOR_ATTACHMENT31);
+#endif
+ PY_DICT_ADD_INT(GL_COMPARE_REF_TO_TEXTURE);
+ PY_DICT_ADD_INT(GL_COMPRESSED_RED);
+ PY_DICT_ADD_INT(GL_COMPRESSED_RED_RGTC1);
+ PY_DICT_ADD_INT(GL_COMPRESSED_RG);
+ PY_DICT_ADD_INT(GL_COMPRESSED_RG_RGTC2);
+ PY_DICT_ADD_INT(GL_COMPRESSED_SIGNED_RED_RGTC1);
+ PY_DICT_ADD_INT(GL_COMPRESSED_SIGNED_RG_RGTC2);
+ PY_DICT_ADD_INT(GL_CONTEXT_FLAGS);
+ PY_DICT_ADD_INT(GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT);
+ PY_DICT_ADD_INT(GL_DEPTH24_STENCIL8);
+ PY_DICT_ADD_INT(GL_DEPTH32F_STENCIL8);
+ PY_DICT_ADD_INT(GL_DEPTH_ATTACHMENT);
+ PY_DICT_ADD_INT(GL_DEPTH_COMPONENT32F);
+ PY_DICT_ADD_INT(GL_DEPTH_STENCIL);
+ PY_DICT_ADD_INT(GL_DEPTH_STENCIL_ATTACHMENT);
+ PY_DICT_ADD_INT(GL_DRAW_FRAMEBUFFER);
+ PY_DICT_ADD_INT(GL_DRAW_FRAMEBUFFER_BINDING);
+ PY_DICT_ADD_INT(GL_FIXED_ONLY);
+ PY_DICT_ADD_INT(GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_BINDING);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_COMPLETE);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_DEFAULT);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_SRGB);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_UNDEFINED);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_UNSUPPORTED);
+ PY_DICT_ADD_INT(GL_GREEN_INTEGER);
+ PY_DICT_ADD_INT(GL_HALF_FLOAT);
+ PY_DICT_ADD_INT(GL_INDEX);
+ PY_DICT_ADD_INT(GL_INTERLEAVED_ATTRIBS);
+ PY_DICT_ADD_INT(GL_INT_SAMPLER_1D);
+ PY_DICT_ADD_INT(GL_INT_SAMPLER_1D_ARRAY);
+ PY_DICT_ADD_INT(GL_INT_SAMPLER_2D);
+ PY_DICT_ADD_INT(GL_INT_SAMPLER_2D_ARRAY);
+ PY_DICT_ADD_INT(GL_INT_SAMPLER_3D);
+ PY_DICT_ADD_INT(GL_INT_SAMPLER_CUBE);
+ PY_DICT_ADD_INT(GL_INVALID_FRAMEBUFFER_OPERATION);
+ PY_DICT_ADD_INT(GL_MAJOR_VERSION);
+ PY_DICT_ADD_INT(GL_MAP_FLUSH_EXPLICIT_BIT);
+ PY_DICT_ADD_INT(GL_MAP_INVALIDATE_BUFFER_BIT);
+ PY_DICT_ADD_INT(GL_MAP_INVALIDATE_RANGE_BIT);
+ PY_DICT_ADD_INT(GL_MAP_READ_BIT);
+ PY_DICT_ADD_INT(GL_MAP_UNSYNCHRONIZED_BIT);
+ PY_DICT_ADD_INT(GL_MAP_WRITE_BIT);
+ PY_DICT_ADD_INT(GL_MAX_ARRAY_TEXTURE_LAYERS);
+ PY_DICT_ADD_INT(GL_MAX_CLIP_DISTANCES);
+ PY_DICT_ADD_INT(GL_MAX_COLOR_ATTACHMENTS);
+ PY_DICT_ADD_INT(GL_MAX_PROGRAM_TEXEL_OFFSET);
+ PY_DICT_ADD_INT(GL_MAX_RENDERBUFFER_SIZE);
+ PY_DICT_ADD_INT(GL_MAX_SAMPLES);
+ PY_DICT_ADD_INT(GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS);
+ PY_DICT_ADD_INT(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS);
+ PY_DICT_ADD_INT(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS);
+ PY_DICT_ADD_INT(GL_MAX_VARYING_COMPONENTS);
+ PY_DICT_ADD_INT(GL_MINOR_VERSION);
+ PY_DICT_ADD_INT(GL_MIN_PROGRAM_TEXEL_OFFSET);
+ PY_DICT_ADD_INT(GL_NUM_EXTENSIONS);
+ PY_DICT_ADD_INT(GL_PRIMITIVES_GENERATED);
+ PY_DICT_ADD_INT(GL_PROXY_TEXTURE_1D_ARRAY);
+ PY_DICT_ADD_INT(GL_PROXY_TEXTURE_2D_ARRAY);
+ PY_DICT_ADD_INT(GL_QUERY_BY_REGION_NO_WAIT);
+ PY_DICT_ADD_INT(GL_QUERY_BY_REGION_WAIT);
+ PY_DICT_ADD_INT(GL_QUERY_NO_WAIT);
+ PY_DICT_ADD_INT(GL_QUERY_WAIT);
+ PY_DICT_ADD_INT(GL_R11F_G11F_B10F);
+ PY_DICT_ADD_INT(GL_R16);
+ PY_DICT_ADD_INT(GL_R16F);
+ PY_DICT_ADD_INT(GL_R16I);
+ PY_DICT_ADD_INT(GL_R16UI);
+ PY_DICT_ADD_INT(GL_R32F);
+ PY_DICT_ADD_INT(GL_R32I);
+ PY_DICT_ADD_INT(GL_R32UI);
+ PY_DICT_ADD_INT(GL_R8);
+ PY_DICT_ADD_INT(GL_R8I);
+ PY_DICT_ADD_INT(GL_R8UI);
+ PY_DICT_ADD_INT(GL_RASTERIZER_DISCARD);
+ PY_DICT_ADD_INT(GL_READ_FRAMEBUFFER);
+ PY_DICT_ADD_INT(GL_READ_FRAMEBUFFER_BINDING);
+ PY_DICT_ADD_INT(GL_RED_INTEGER);
+ PY_DICT_ADD_INT(GL_RENDERBUFFER);
+ PY_DICT_ADD_INT(GL_RENDERBUFFER_ALPHA_SIZE);
+ PY_DICT_ADD_INT(GL_RENDERBUFFER_BINDING);
+ PY_DICT_ADD_INT(GL_RENDERBUFFER_BLUE_SIZE);
+ PY_DICT_ADD_INT(GL_RENDERBUFFER_DEPTH_SIZE);
+ PY_DICT_ADD_INT(GL_RENDERBUFFER_GREEN_SIZE);
+ PY_DICT_ADD_INT(GL_RENDERBUFFER_HEIGHT);
+ PY_DICT_ADD_INT(GL_RENDERBUFFER_INTERNAL_FORMAT);
+ PY_DICT_ADD_INT(GL_RENDERBUFFER_RED_SIZE);
+ PY_DICT_ADD_INT(GL_RENDERBUFFER_SAMPLES);
+ PY_DICT_ADD_INT(GL_RENDERBUFFER_STENCIL_SIZE);
+ PY_DICT_ADD_INT(GL_RENDERBUFFER_WIDTH);
+ PY_DICT_ADD_INT(GL_RG);
+ PY_DICT_ADD_INT(GL_RG16);
+ PY_DICT_ADD_INT(GL_RG16F);
+ PY_DICT_ADD_INT(GL_RG16I);
+ PY_DICT_ADD_INT(GL_RG16UI);
+ PY_DICT_ADD_INT(GL_RG32F);
+ PY_DICT_ADD_INT(GL_RG32I);
+ PY_DICT_ADD_INT(GL_RG32UI);
+ PY_DICT_ADD_INT(GL_RG8);
+ PY_DICT_ADD_INT(GL_RG8I);
+ PY_DICT_ADD_INT(GL_RG8UI);
+ PY_DICT_ADD_INT(GL_RGB16F);
+ PY_DICT_ADD_INT(GL_RGB16I);
+ PY_DICT_ADD_INT(GL_RGB16UI);
+ PY_DICT_ADD_INT(GL_RGB32F);
+ PY_DICT_ADD_INT(GL_RGB32I);
+ PY_DICT_ADD_INT(GL_RGB32UI);
+ PY_DICT_ADD_INT(GL_RGB8I);
+ PY_DICT_ADD_INT(GL_RGB8UI);
+ PY_DICT_ADD_INT(GL_RGB9_E5);
+ PY_DICT_ADD_INT(GL_RGBA16F);
+ PY_DICT_ADD_INT(GL_RGBA16I);
+ PY_DICT_ADD_INT(GL_RGBA16UI);
+ PY_DICT_ADD_INT(GL_RGBA32F);
+ PY_DICT_ADD_INT(GL_RGBA32I);
+ PY_DICT_ADD_INT(GL_RGBA32UI);
+ PY_DICT_ADD_INT(GL_RGBA8I);
+ PY_DICT_ADD_INT(GL_RGBA8UI);
+ PY_DICT_ADD_INT(GL_RGBA_INTEGER);
+ PY_DICT_ADD_INT(GL_RGB_INTEGER);
+ PY_DICT_ADD_INT(GL_RG_INTEGER);
+ PY_DICT_ADD_INT(GL_SAMPLER_1D_ARRAY);
+ PY_DICT_ADD_INT(GL_SAMPLER_1D_ARRAY_SHADOW);
+ PY_DICT_ADD_INT(GL_SAMPLER_2D_ARRAY);
+ PY_DICT_ADD_INT(GL_SAMPLER_2D_ARRAY_SHADOW);
+ PY_DICT_ADD_INT(GL_SAMPLER_CUBE_SHADOW);
+ PY_DICT_ADD_INT(GL_SEPARATE_ATTRIBS);
+ PY_DICT_ADD_INT(GL_STENCIL_ATTACHMENT);
+ PY_DICT_ADD_INT(GL_STENCIL_INDEX1);
+ PY_DICT_ADD_INT(GL_STENCIL_INDEX16);
+ PY_DICT_ADD_INT(GL_STENCIL_INDEX4);
+ PY_DICT_ADD_INT(GL_STENCIL_INDEX8);
+ PY_DICT_ADD_INT(GL_TEXTURE_1D_ARRAY);
+ PY_DICT_ADD_INT(GL_TEXTURE_2D_ARRAY);
+ PY_DICT_ADD_INT(GL_TEXTURE_ALPHA_TYPE);
+ PY_DICT_ADD_INT(GL_TEXTURE_BINDING_1D_ARRAY);
+ PY_DICT_ADD_INT(GL_TEXTURE_BINDING_2D_ARRAY);
+ PY_DICT_ADD_INT(GL_TEXTURE_BLUE_TYPE);
+ PY_DICT_ADD_INT(GL_TEXTURE_DEPTH_TYPE);
+ PY_DICT_ADD_INT(GL_TEXTURE_GREEN_TYPE);
+ PY_DICT_ADD_INT(GL_TEXTURE_RED_TYPE);
+ PY_DICT_ADD_INT(GL_TEXTURE_SHARED_SIZE);
+ PY_DICT_ADD_INT(GL_TEXTURE_STENCIL_SIZE);
+ PY_DICT_ADD_INT(GL_TRANSFORM_FEEDBACK_BUFFER);
+ PY_DICT_ADD_INT(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING);
+ PY_DICT_ADD_INT(GL_TRANSFORM_FEEDBACK_BUFFER_MODE);
+ PY_DICT_ADD_INT(GL_TRANSFORM_FEEDBACK_BUFFER_SIZE);
+ PY_DICT_ADD_INT(GL_TRANSFORM_FEEDBACK_BUFFER_START);
+ PY_DICT_ADD_INT(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
+ PY_DICT_ADD_INT(GL_TRANSFORM_FEEDBACK_VARYINGS);
+ PY_DICT_ADD_INT(GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH);
+ PY_DICT_ADD_INT(GL_UNSIGNED_INT_10F_11F_11F_REV);
+ PY_DICT_ADD_INT(GL_UNSIGNED_INT_24_8);
+ PY_DICT_ADD_INT(GL_UNSIGNED_INT_5_9_9_9_REV);
+ PY_DICT_ADD_INT(GL_UNSIGNED_INT_SAMPLER_1D);
+ PY_DICT_ADD_INT(GL_UNSIGNED_INT_SAMPLER_1D_ARRAY);
+ PY_DICT_ADD_INT(GL_UNSIGNED_INT_SAMPLER_2D);
+ PY_DICT_ADD_INT(GL_UNSIGNED_INT_SAMPLER_2D_ARRAY);
+ PY_DICT_ADD_INT(GL_UNSIGNED_INT_SAMPLER_3D);
+ PY_DICT_ADD_INT(GL_UNSIGNED_INT_SAMPLER_CUBE);
+ PY_DICT_ADD_INT(GL_UNSIGNED_INT_VEC2);
+ PY_DICT_ADD_INT(GL_UNSIGNED_INT_VEC3);
+ PY_DICT_ADD_INT(GL_UNSIGNED_INT_VEC4);
+ PY_DICT_ADD_INT(GL_UNSIGNED_NORMALIZED);
PY_DICT_ADD_INT(GL_VERTEX_ARRAY_BINDING);
+ PY_DICT_ADD_INT(GL_VERTEX_ATTRIB_ARRAY_INTEGER);
}
/* adding in GL_VERSION_3_0 removed from core profile */
if (use_deprecated == true) {
PY_DICT_ADD_INT(GL_ALPHA_INTEGER);
PY_DICT_ADD_INT(GL_CLAMP_FRAGMENT_COLOR);
PY_DICT_ADD_INT(GL_CLAMP_VERTEX_COLOR);
+ PY_DICT_ADD_INT(GL_TEXTURE_INTENSITY_TYPE);
+ PY_DICT_ADD_INT(GL_TEXTURE_LUMINANCE_TYPE);
}
-
/* GL_VERSION_3_1 */
{
PY_DICT_ADD_INT(GL_ACTIVE_UNIFORM_BLOCKS);
PY_DICT_ADD_INT(GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH);
+ PY_DICT_ADD_INT(GL_COPY_READ_BUFFER);
+ PY_DICT_ADD_INT(GL_COPY_WRITE_BUFFER);
+ PY_DICT_ADD_INT(GL_INT_SAMPLER_2D_RECT);
+ PY_DICT_ADD_INT(GL_INT_SAMPLER_BUFFER);
PY_DICT_ADD_INT(GL_INVALID_INDEX);
PY_DICT_ADD_INT(GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS);
PY_DICT_ADD_INT(GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS);
@@ -3240,9 +3529,31 @@ PyObject *BPyInit_bgl(void)
PY_DICT_ADD_INT(GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS);
PY_DICT_ADD_INT(GL_MAX_FRAGMENT_UNIFORM_BLOCKS);
PY_DICT_ADD_INT(GL_MAX_GEOMETRY_UNIFORM_BLOCKS);
+ PY_DICT_ADD_INT(GL_MAX_RECTANGLE_TEXTURE_SIZE);
+ PY_DICT_ADD_INT(GL_MAX_TEXTURE_BUFFER_SIZE);
PY_DICT_ADD_INT(GL_MAX_UNIFORM_BLOCK_SIZE);
PY_DICT_ADD_INT(GL_MAX_UNIFORM_BUFFER_BINDINGS);
PY_DICT_ADD_INT(GL_MAX_VERTEX_UNIFORM_BLOCKS);
+ PY_DICT_ADD_INT(GL_PRIMITIVE_RESTART);
+ PY_DICT_ADD_INT(GL_PRIMITIVE_RESTART_INDEX);
+ PY_DICT_ADD_INT(GL_PROXY_TEXTURE_RECTANGLE);
+ PY_DICT_ADD_INT(GL_R16_SNORM);
+ PY_DICT_ADD_INT(GL_R8_SNORM);
+ PY_DICT_ADD_INT(GL_RG16_SNORM);
+ PY_DICT_ADD_INT(GL_RG8_SNORM);
+ PY_DICT_ADD_INT(GL_RGB16_SNORM);
+ PY_DICT_ADD_INT(GL_RGB8_SNORM);
+ PY_DICT_ADD_INT(GL_RGBA16_SNORM);
+ PY_DICT_ADD_INT(GL_RGBA8_SNORM);
+ PY_DICT_ADD_INT(GL_SAMPLER_2D_RECT);
+ PY_DICT_ADD_INT(GL_SAMPLER_2D_RECT_SHADOW);
+ PY_DICT_ADD_INT(GL_SAMPLER_BUFFER);
+ PY_DICT_ADD_INT(GL_SIGNED_NORMALIZED);
+ PY_DICT_ADD_INT(GL_TEXTURE_BINDING_BUFFER);
+ PY_DICT_ADD_INT(GL_TEXTURE_BINDING_RECTANGLE);
+ PY_DICT_ADD_INT(GL_TEXTURE_BUFFER);
+ PY_DICT_ADD_INT(GL_TEXTURE_BUFFER_DATA_STORE_BINDING);
+ PY_DICT_ADD_INT(GL_TEXTURE_RECTANGLE);
PY_DICT_ADD_INT(GL_UNIFORM_ARRAY_STRIDE);
PY_DICT_ADD_INT(GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS);
PY_DICT_ADD_INT(GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES);
@@ -3264,34 +3575,98 @@ PyObject *BPyInit_bgl(void)
PY_DICT_ADD_INT(GL_UNIFORM_OFFSET);
PY_DICT_ADD_INT(GL_UNIFORM_SIZE);
PY_DICT_ADD_INT(GL_UNIFORM_TYPE);
+ PY_DICT_ADD_INT(GL_UNSIGNED_INT_SAMPLER_2D_RECT);
+ PY_DICT_ADD_INT(GL_UNSIGNED_INT_SAMPLER_BUFFER);
}
/* GL_VERSION_3_2 */
{
+ PY_DICT_ADD_INT(GL_ALREADY_SIGNALED);
+ PY_DICT_ADD_INT(GL_CONDITION_SATISFIED);
+ PY_DICT_ADD_INT(GL_CONTEXT_COMPATIBILITY_PROFILE_BIT);
+ PY_DICT_ADD_INT(GL_CONTEXT_CORE_PROFILE_BIT);
+ PY_DICT_ADD_INT(GL_CONTEXT_PROFILE_MASK);
+ PY_DICT_ADD_INT(GL_DEPTH_CLAMP);
+ PY_DICT_ADD_INT(GL_FIRST_VERTEX_CONVENTION);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_ATTACHMENT_LAYERED);
+ PY_DICT_ADD_INT(GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS);
+ PY_DICT_ADD_INT(GL_GEOMETRY_INPUT_TYPE);
+ PY_DICT_ADD_INT(GL_GEOMETRY_OUTPUT_TYPE);
+ PY_DICT_ADD_INT(GL_GEOMETRY_SHADER);
+ PY_DICT_ADD_INT(GL_GEOMETRY_VERTICES_OUT);
PY_DICT_ADD_INT(GL_INT_SAMPLER_2D_MULTISAMPLE);
PY_DICT_ADD_INT(GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY);
+ PY_DICT_ADD_INT(GL_LAST_VERTEX_CONVENTION);
+ PY_DICT_ADD_INT(GL_LINES_ADJACENCY);
+ PY_DICT_ADD_INT(GL_LINE_STRIP_ADJACENCY);
PY_DICT_ADD_INT(GL_MAX_COLOR_TEXTURE_SAMPLES);
PY_DICT_ADD_INT(GL_MAX_DEPTH_TEXTURE_SAMPLES);
+ PY_DICT_ADD_INT(GL_MAX_FRAGMENT_INPUT_COMPONENTS);
+ PY_DICT_ADD_INT(GL_MAX_GEOMETRY_INPUT_COMPONENTS);
+ PY_DICT_ADD_INT(GL_MAX_GEOMETRY_OUTPUT_COMPONENTS);
+ PY_DICT_ADD_INT(GL_MAX_GEOMETRY_OUTPUT_VERTICES);
+ PY_DICT_ADD_INT(GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS);
+ PY_DICT_ADD_INT(GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS);
+ PY_DICT_ADD_INT(GL_MAX_GEOMETRY_UNIFORM_COMPONENTS);
PY_DICT_ADD_INT(GL_MAX_INTEGER_SAMPLES);
PY_DICT_ADD_INT(GL_MAX_SAMPLE_MASK_WORDS);
+ PY_DICT_ADD_INT(GL_MAX_SERVER_WAIT_TIMEOUT);
+ PY_DICT_ADD_INT(GL_MAX_VERTEX_OUTPUT_COMPONENTS);
+ PY_DICT_ADD_INT(GL_OBJECT_TYPE);
+ PY_DICT_ADD_INT(GL_PROGRAM_POINT_SIZE);
+ PY_DICT_ADD_INT(GL_PROVOKING_VERTEX);
PY_DICT_ADD_INT(GL_PROXY_TEXTURE_2D_MULTISAMPLE);
PY_DICT_ADD_INT(GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY);
+ PY_DICT_ADD_INT(GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION);
PY_DICT_ADD_INT(GL_SAMPLER_2D_MULTISAMPLE);
PY_DICT_ADD_INT(GL_SAMPLER_2D_MULTISAMPLE_ARRAY);
PY_DICT_ADD_INT(GL_SAMPLE_MASK);
PY_DICT_ADD_INT(GL_SAMPLE_MASK_VALUE);
PY_DICT_ADD_INT(GL_SAMPLE_POSITION);
+ PY_DICT_ADD_INT(GL_SIGNALED);
+ PY_DICT_ADD_INT(GL_SYNC_CONDITION);
+ PY_DICT_ADD_INT(GL_SYNC_FENCE);
+ PY_DICT_ADD_INT(GL_SYNC_FLAGS);
+ PY_DICT_ADD_INT(GL_SYNC_FLUSH_COMMANDS_BIT);
+ PY_DICT_ADD_INT(GL_SYNC_GPU_COMMANDS_COMPLETE);
+ PY_DICT_ADD_INT(GL_SYNC_STATUS);
PY_DICT_ADD_INT(GL_TEXTURE_2D_MULTISAMPLE);
PY_DICT_ADD_INT(GL_TEXTURE_2D_MULTISAMPLE_ARRAY);
PY_DICT_ADD_INT(GL_TEXTURE_BINDING_2D_MULTISAMPLE);
PY_DICT_ADD_INT(GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY);
+ PY_DICT_ADD_INT(GL_TEXTURE_CUBE_MAP_SEAMLESS);
PY_DICT_ADD_INT(GL_TEXTURE_FIXED_SAMPLE_LOCATIONS);
PY_DICT_ADD_INT(GL_TEXTURE_SAMPLES);
+ PY_DICT_ADD_INT(GL_TIMEOUT_EXPIRED);
+ PY_DICT_ADD_INT64(GL_TIMEOUT_IGNORED);
+ PY_DICT_ADD_INT(GL_TRIANGLES_ADJACENCY);
+ PY_DICT_ADD_INT(GL_TRIANGLE_STRIP_ADJACENCY);
+ PY_DICT_ADD_INT(GL_UNSIGNALED);
PY_DICT_ADD_INT(GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE);
PY_DICT_ADD_INT(GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY);
+ PY_DICT_ADD_INT(GL_WAIT_FAILED);
}
+ /* GL_VERSION_3_3 */
+ {
+ PY_DICT_ADD_INT(GL_ANY_SAMPLES_PASSED);
+ PY_DICT_ADD_INT(GL_INT_2_10_10_10_REV);
+ PY_DICT_ADD_INT(GL_MAX_DUAL_SOURCE_DRAW_BUFFERS);
+ PY_DICT_ADD_INT(GL_ONE_MINUS_SRC1_ALPHA);
+ PY_DICT_ADD_INT(GL_ONE_MINUS_SRC1_COLOR);
+ PY_DICT_ADD_INT(GL_RGB10_A2UI);
+ PY_DICT_ADD_INT(GL_SAMPLER_BINDING);
+ PY_DICT_ADD_INT(GL_SRC1_COLOR);
+ PY_DICT_ADD_INT(GL_TEXTURE_SWIZZLE_A);
+ PY_DICT_ADD_INT(GL_TEXTURE_SWIZZLE_B);
+ PY_DICT_ADD_INT(GL_TEXTURE_SWIZZLE_G);
+ PY_DICT_ADD_INT(GL_TEXTURE_SWIZZLE_R);
+ PY_DICT_ADD_INT(GL_TEXTURE_SWIZZLE_RGBA);
+ PY_DICT_ADD_INT(GL_TIMESTAMP);
+ PY_DICT_ADD_INT(GL_TIME_ELAPSED);
+ PY_DICT_ADD_INT(GL_VERTEX_ATTRIB_ARRAY_DIVISOR);
+ }
return submodule;
}
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index bd07c7370a4..5414c4e4204 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -988,15 +988,16 @@ static PyObject *pyrna_prop_repr(BPy_PropertyRNA *self)
path = RNA_path_from_ID_to_property(&self->ptr, self->prop);
if (path) {
+ const char *data_delim = (path[0] == '[') ? "" : ".";
if (GS(id->name) == ID_NT) { /* nodetree paths are not accurate */
ret = PyUnicode_FromFormat("bpy.data...%s",
path);
}
else {
- ret = PyUnicode_FromFormat("bpy.data.%s[%R].%s",
+ ret = PyUnicode_FromFormat("bpy.data.%s[%R]%s%s",
BKE_idcode_to_name_plural(GS(id->name)),
tmp_str,
- path);
+ data_delim, path);
}
MEM_freeN((void *)path);
@@ -3388,6 +3389,21 @@ static PyObject *pyrna_prop_as_bytes(BPy_PropertyRNA *self)
}
}
+PyDoc_STRVAR(pyrna_prop_update_doc,
+".. method:: update()\n"
+"\n"
+" Execute the properties update callback.\n"
+"\n"
+" .. note::\n"
+" This is called when assigning a property,\n"
+" however in rare cases its useful to call explicitly.\n"
+);
+static PyObject *pyrna_prop_update(BPy_PropertyRNA *self)
+{
+ RNA_property_update(BPy_GetContext(), &self->ptr, self->prop);
+ Py_RETURN_NONE;
+}
+
PyDoc_STRVAR(pyrna_struct_type_recast_doc,
".. method:: type_recast()\n"
"\n"
@@ -4721,6 +4737,7 @@ static struct PyMethodDef pyrna_struct_methods[] = {
static struct PyMethodDef pyrna_prop_methods[] = {
{"path_from_id", (PyCFunction)pyrna_prop_path_from_id, METH_NOARGS, pyrna_prop_path_from_id_doc},
{"as_bytes", (PyCFunction)pyrna_prop_as_bytes, METH_NOARGS, pyrna_prop_as_bytes_doc},
+ {"update", (PyCFunction)pyrna_prop_update, METH_NOARGS, pyrna_prop_update_doc},
{"__dir__", (PyCFunction)pyrna_prop_dir, METH_NOARGS, NULL},
{NULL, NULL, 0, NULL}
};
diff --git a/source/blender/python/intern/gpu.c b/source/blender/python/intern/gpu.c
index f933c02390c..a7ece10f06c 100644
--- a/source/blender/python/intern/gpu.c
+++ b/source/blender/python/intern/gpu.c
@@ -79,6 +79,13 @@ static PyObject *PyInit_gpu(void)
if (m == NULL)
return NULL;
+
+ /* Take care to update docs when editing: 'doc/python_api/rst/gpu.rst' */
+
+
+ /* -------------------------------------------------------------------- */
+ /* GPUDynamicType */
+
/* device constant groups */
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_GROUP_MISC);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_GROUP_LAMP);
@@ -90,12 +97,14 @@ static PyObject *PyInit_gpu(void)
/* device constants */
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_NONE);
+ /* GPU_DYNAMIC_GROUP_OBJECT */
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_VIEWMAT);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_MAT);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_VIEWIMAT);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_IMAT);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_COLOR);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE);
+ /* GPU_DYNAMIC_GROUP_LAMP */
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNVEC);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNCO);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DYNIMAT);
@@ -105,27 +114,35 @@ static PyObject *PyInit_gpu(void)
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_ATT1);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_ATT2);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_DISTANCE);
- PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_SPOTBLEND);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_SPOTSIZE);
+ PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_LAMP_SPOTBLEND);
+ /* GPU_DYNAMIC_GROUP_SAMPLER */
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_SAMPLER_2DBUFFER);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_SAMPLER_2DIMAGE);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_SAMPLER_2DSHADOW);
+ /* GPU_DYNAMIC_GROUP_MIST */
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MIST_ENABLE);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MIST_START);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MIST_DISTANCE);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MIST_INTENSITY);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MIST_TYPE);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MIST_COLOR);
+ /* GPU_DYNAMIC_GROUP_WORLD */
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_HORIZON_COLOR);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_AMBIENT_COLOR);
- PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_ALPHA);
- PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_AMB);
+ /* GPU_DYNAMIC_GROUP_MAT */
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_DIFFRGB);
- PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_EMIT);
- PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_HARD);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_REF);
- PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_SPEC);
PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_SPECRGB);
+ PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_SPEC);
+ PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_HARD);
+ PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_EMIT);
+ PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_AMB);
+ PY_MODULE_ADD_CONSTANT(m, GPU_DYNAMIC_MAT_ALPHA);
+
+
+ /* -------------------------------------------------------------------- */
+ /* GPUDataType */
PY_MODULE_ADD_CONSTANT(m, GPU_DATA_1I);
PY_MODULE_ADD_CONSTANT(m, GPU_DATA_1F);
@@ -136,6 +153,12 @@ static PyObject *PyInit_gpu(void)
PY_MODULE_ADD_CONSTANT(m, GPU_DATA_16F);
PY_MODULE_ADD_CONSTANT(m, GPU_DATA_4UB);
+
+ /* -------------------------------------------------------------------- */
+ /* CustomDataType
+ *
+ * Intentionally only include the subset used by the GPU API.
+ */
PY_MODULE_ADD_CONSTANT(m, CD_MTFACE);
PY_MODULE_ADD_CONSTANT(m, CD_ORCO);
PY_MODULE_ADD_CONSTANT(m, CD_TANGENT);
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 96039b7116c..46fb0603038 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -1270,8 +1270,11 @@ static void main_render_result_new(Render *re)
BLI_rw_mutex_unlock(&re->resultmutex);
- if (re->result->do_exr_tile)
- render_result_exr_file_begin(re);
+ if (re->result) {
+ if (re->result->do_exr_tile) {
+ render_result_exr_file_begin(re);
+ }
+ }
}
static void threaded_tile_processor(Render *re)
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 2c7f3537222..919e7ceb3a4 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -138,6 +138,7 @@ void WM_paint_cursor_end(struct wmWindowManager *wm, void *handle);
void WM_paint_cursor_tag_redraw(struct wmWindow *win, struct ARegion *ar);
void WM_cursor_warp (struct wmWindow *win, int x, int y);
+void WM_cursor_compatible_xy(wmWindow *win, int *x, int *y);
float WM_cursor_pressure (const struct wmWindow *win);
/* event map */
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index f81fed0021f..510df63efa0 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1804,7 +1804,13 @@ static int wm_handler_fileselect_do(bContext *C, ListBase *handlers, wmEventHand
const SpaceLink *sl = sa->spacedata.first;
const bool was_prev_temp = (sl->next && sl->next->spacetype == SPACE_IMAGE);
- ED_screen_full_prevspace(C, sa, was_prev_temp);
+ if (sa->full) {
+ ED_screen_full_prevspace(C, sa, was_prev_temp);
+ }
+ /* user may have left fullscreen */
+ else {
+ ED_area_prevspace(C, sa);
+ }
}
wm_handler_op_context(C, handler, CTX_wm_window(C)->eventstate);
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index af7e9c8ca33..8b7780bebdb 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -1557,6 +1557,18 @@ void WM_cursor_warp(wmWindow *win, int x, int y)
}
/**
+ * Set x, y to values we can actually position the cursor to.
+ */
+void WM_cursor_compatible_xy(wmWindow *win, int *x, int *y)
+{
+ float f = GHOST_GetNativePixelSize(win->ghostwin);
+ if (f != 1.0f) {
+ *x = (int)(*x / f) * f;
+ *y = (int)(*y / f) * f;
+ }
+}
+
+/**
* Get the cursor pressure, in most cases you'll want to use wmTabletData from the event
*/
float WM_cursor_pressure(const struct wmWindow *win)
diff --git a/source/gameengine/Ketsji/KX_WorldInfo.h b/source/gameengine/Ketsji/KX_WorldInfo.h
index f2b37ec5587..b155faf2837 100644
--- a/source/gameengine/Ketsji/KX_WorldInfo.h
+++ b/source/gameengine/Ketsji/KX_WorldInfo.h
@@ -36,10 +36,6 @@
#include "KX_KetsjiEngine.h"
#include "EXP_PyObjectPlus.h"
-#ifdef WITH_CXX_GUARDEDALLOC
-#include "MEM_guardedalloc.h"
-#endif
-
#ifdef USE_MATHUTILS
void KX_WorldInfo_Mathutils_Callback_Init(void);
#endif
@@ -104,10 +100,6 @@ public:
static int pyattr_set_ambient_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
virtual PyObject *py_repr(void);
#endif
-
-#ifdef WITH_CXX_GUARDEDALLOC
- MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_WorldInfo")
-#endif
};
#endif /* __KX_WORLDINFO_H__ */
diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
index f1ce8356e20..cedc27c3b92 100644
--- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
@@ -75,6 +75,12 @@ texturewidth(-1), textureheight(-1),
RAS_2DFilterManager::~RAS_2DFilterManager()
{
FreeTextures();
+
+ for (int passindex = 0; passindex < MAX_RENDER_PASS; passindex++) {
+ if (m_filters[passindex]) {
+ glDeleteObjectARB(m_filters[passindex]);
+ }
+ }
}
void RAS_2DFilterManager::PrintShaderErrors(unsigned int shader, const char *task, const char *code)
@@ -119,11 +125,10 @@ unsigned int RAS_2DFilterManager::CreateShaderProgram(const char* shadersource)
glGetObjectParameterivARB(fShader, GL_COMPILE_STATUS, &success);
- if (!success)
- {
+ if (!success) {
/*Shader Comile Error*/
PrintShaderErrors(fShader, "compile", shadersource);
- return 0;
+ goto fail;
}
program = glCreateProgramObjectARB();
@@ -131,23 +136,37 @@ unsigned int RAS_2DFilterManager::CreateShaderProgram(const char* shadersource)
glLinkProgramARB(program);
glGetObjectParameterivARB(program, GL_LINK_STATUS, &success);
- if (!success)
- {
+ if (!success) {
/*Program Link Error*/
PrintShaderErrors(fShader, "link", shadersource);
- return 0;
+ goto fail;
}
glValidateProgramARB(program);
glGetObjectParameterivARB(program, GL_VALIDATE_STATUS, &success);
- if (!success)
- {
+ if (!success) {
/*Program Validation Error*/
PrintShaderErrors(fShader, "validate", shadersource);
- return 0;
+ goto fail;
+ }
+
+ /* owned by 'program' */
+ if (fShader) {
+ glDeleteObjectARB(fShader);
}
return program;
+
+
+fail:
+ if (fShader) {
+ glDeleteObjectARB(fShader);
+ }
+
+ if (program) {
+ glDeleteObjectARB(program);
+ }
+ return 0;
}
unsigned int RAS_2DFilterManager::CreateShaderProgram(int filtermode)
diff --git a/source/gameengine/VideoTexture/FilterBase.h b/source/gameengine/VideoTexture/FilterBase.h
index 25a6d5ff31c..498917e2375 100644
--- a/source/gameengine/VideoTexture/FilterBase.h
+++ b/source/gameengine/VideoTexture/FilterBase.h
@@ -116,6 +116,10 @@ protected:
// otherwise return converted pixel
return m_previous->m_filter->convert(src, x, y, size, pixSize);
}
+
+#ifdef WITH_CXX_GUARDEDALLOC
+ MEM_CXX_CLASS_ALLOC_FUNCS("GE:FilterBase")
+#endif
};