1
1

Compare commits

...

369 Commits

Author SHA1 Message Date
c79c0c3c9a initial working tree evaluation 2020-10-21 17:29:31 +02:00
f7af5f9933 initial evaluation code 2020-10-21 15:42:19 +02:00
a7dba81aab Nodes: add initial UI for Triangulate node 2020-10-21 14:14:09 +02:00
4606e83a75 Merge branch 'master' into geometry-nodes 2020-10-21 14:00:32 +02:00
8738a668d8 Preferences: separate feature flags for geometry nodes and point cloud type
Those two features are not directly related and one might be activated
in master earlier than the other.

WITH_PARTICLE_NODES was removed, because we continue the project
under the name "Geometry Nodes".
2020-10-21 13:47:50 +02:00
1d28de57a4 Nodes: improve dependency between modifier and node group 2020-10-21 13:16:19 +02:00
3cfcfb938d Nodes: support creating geometry node groups 2020-10-21 12:32:02 +02:00
bcdc6910a0 Nodes: show header in geometry node editor 2020-10-21 12:16:57 +02:00
7793e8c884 Modifiers: add node_tree to NodesModifierData 2020-10-21 12:13:13 +02:00
05d9bd7c4a Modifiers: rename Simulation to Nodes modifier 2020-10-21 12:03:06 +02:00
9255ce9247 Nodes: rename Simulation to Geometry node tree 2020-10-21 11:39:42 +02:00
819b1a7f9d Cleanup: Move scenes' foreach_id handling of toolsettings into own func. 2020-10-21 11:38:32 +02:00
a0ce0154e7 Merge branch 'master' into geometry-nodes 2020-10-21 11:11:16 +02:00
22ceb4a752 Fluid: Fix in addition to new obstacle distance parameter
The obstacle distance value should only be used when using second order boundaries.
2020-10-21 10:52:30 +02:00
fc2a83d95b Cleanup: rename some functions with more relevant prefix. 2020-10-21 10:23:48 +02:00
afd13710b8 Cleanup: Clang-tidy readability-named-parameter
No functional change.
2020-10-21 13:21:00 +05:30
7ac6f4d26c Cleanup: Clang-tidy readability-redundant-string-init
No functional change.
2020-10-21 13:15:17 +05:30
Ankit Meel
ee90effd3a Clang-tidy: disable new warnings.
Until it is decided whether to work on, or ignore these
warning, disable them. See T78535 

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9281
2020-10-21 12:58:39 +05:30
a8f44a4799 Cleanup: early return from animation step, reduce indentation level 2020-10-21 18:07:24 +11:00
Jeroen Bakker
e60bc528f0 DrawManager: Adding Custom Render Passes
Currently render passes in the draw manager (eevee) must be predefined
in the render result. This patch would ask the render engine for the
render passes it needs, and create these as a preparation step during
rendering. This allows any draw engine to define more complex render
passes setup.

Render passes can only be added before the call to `RE_engine_begin_result`.
`RE_engine_begin_result` makes a full copy of the render passes. During
rendering the render engines renders to the duplicated passes.
`RE_engine_end_result` syncs the data back to the original render passes,
but only if the passes existed in the original render result.
Currently we work-around this issue by registering the passes in
`render_result_new`. This is legacy blender internal structure and should
be avoided.

With upcoming projects (AOV/Cryptomatte) it becomes a bit of a mess as we
are extending legacy code to support new features. This patch allows us to
let each draw engine register their own render passes at render time
(similar to cycles and other render engines). In the future we could get
rid of legacy render passes registration in render_result_new.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9088
2020-10-21 08:14:21 +02:00
1ad100d556 Fix T81079: Switch object ignoring visibility settings
Replace ED_transform_snap_object_context_create with
ED_view3d_give_base_under_cursor & ED_view3d_autodist_simple so object
visibility is respected and non-geometry objects can be supported.

Ref D9255
2020-10-21 13:53:03 +11:00
4bf6ffc022 Fix for T81757: Incorrect Overlay Line Height
Fixes error in determining 3DView Overlay Line Height. Do not base on current default font height.

Differential Revision: https://developer.blender.org/D9288

Reviewed by Campbell Barton
2020-10-20 19:11:36 -07:00
a80c1fc011 Cleanup: simplify lasso transform from 17cb2a6da0
Access as 2D array, loop forwards over the pointer since it's
more common and simpler to read.
2020-10-21 13:03:53 +11:00
4e90dff60f Cleanup: avoid error prone nested switch statements (missing break)
17cb2a6da0 missed a break statement after a nested switch,
while it didn't cause a bug nesting switch doesn't read well
and is prone to errors like this.

Split modal-keymap checks into their own branch to avoid this happening,
also use matching event checks for all gesture operators.
2020-10-21 12:54:35 +11:00
7167a57197 Fluid: Added obstacle fluid distance parameter
Being able to adjust the distance between fluid and obstacles comes in handy when trying to achieve a fluid motion over inclined obstacles.

Depending on the slope of such obstacles, already small adjustments of this value can help when particles stick to obstacle surfaces (i.e. make particles not stick to obstacles).
2020-10-20 23:07:53 +02:00
14d56b4217 UI: Add angle snapping to line gesture tools
This adds support for snapping for line gesture tool. It is implemented
in the modal keymap as Snap, which is a toggle (similar to how snapping
in the transform operator works).

Right now it snaps the angle of the line to 15 degree increments, which
is defined in code. This should be easy to expose in the UI in the future
if we need to.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D9115
2020-10-20 22:52:12 +02:00
cf8aa20967 Fix error in the last commit
I accidentally commited a file without saving it
2020-10-20 22:33:26 +02:00
17cb2a6da0 UI: Move gesture selection with spacebar
This patch adds a modal key to move the selection box/lasso/line while
drawing it. It also sets "repeat": False on the animation playback key
to prevent accidental playback if the spacebar is released after the
mouse button.

Reviewed By: #user_interface, pablovazquez, Severin

Differential Revision: https://developer.blender.org/D9227
2020-10-20 22:18:01 +02:00
b55c44e3ed EEVEE: Screen Space Reflection: Improve self intersection cases.
This patch fix most self intersection comming from reflection rays.
We regenerate the ray if it goes below the shading normal (should be the
geometric normal but we have no access to it here).

Also add the same precision based bias we use for contact shadows.

This fix T81105 Eevee SSR quality regression in 2.91 alpha
2020-10-20 22:06:43 +02:00
65a3195781 EEVEE: Screen Space Reflection: Fix undefined behavior with invalid LOD
Some issues happened because the lod can become negative in some cases.
Also avoid sampling LOD with interpolation (floor).
2020-10-20 22:06:43 +02:00
3e5a354333 Fix sculpt pen tilt support changing the brush strength
SCULPT_tilt_apply_to_normal expects a normal, and offset was already
scaled by radius. The funcion returns a normalized vector, so the
strength of the brush was changed.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9275
2020-10-20 21:41:32 +02:00
98540511b1 Cleanup: Clang-tidy -readability-inconsistent-declaration-parameter-name
Changes in source/blender/makesrna only.

No functional change.
2020-10-21 01:09:31 +05:30
f76d9de7ed Cleanup: Clang-tidy bugprone-redundant-branch-condition
No functional change.
2020-10-21 01:08:26 +05:30
10e2b77121 Cleanup: makesrna, Clang-tidy else-after-return-fixes.
It got left out of {rBc04088fed1b8faea6b2928bb5e09ab3}.

No functional change.
2020-10-21 01:08:26 +05:30
6c2bea6492 Cleanup: Clang-tidy silence readability-non-const-parameter
This is a false alarm, `getFileSystemRepresentation` changes the
return value argument.
So used `NOLINTNEXTLINE`.
2020-10-21 01:02:16 +05:30
43e4d6e5b1 CMake/Windows: Compile GMP library as fat library 2020-10-20 13:04:53 -06:00
Rahul Chaudhary
0c1c6e7ecf UI:Add icon for Displacement Eraser brush
This patch adds icons for the multires displacement
eraser tool in sculpt mode

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D9286
2020-10-20 20:59:29 +02:00
Rahul Chaudhary
e74b7e1615 UI: Add icons for line genture tools
This patch adds icons for line gesture tools
Line mask and line project

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D9285
2020-10-20 20:55:48 +02:00
Rahul Chaudhary
a264b1f710 UI: Add icon for boundary brush
This patch adds icon for the boundary brush in sculpt mode

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D9284
2020-10-20 20:52:36 +02:00
3d78e98d52 Ocean Modifier: allow spray maps to be baked
In comments made by a tester on rB17b89f6dacba007bf, it seems that baking
of the spray maps would be useful. This commit adds that capability. Both
the spray map and its inverse are baked out in this change, for maximum
convenience and to avoid assuming what the user wants.

Differential Revision: https://developer.blender.org/D8470
2020-10-20 12:47:58 -05:00
de77aa337c Cleanup: warning on windows 2020-10-20 17:50:22 +02:00
c0a0789af5 UI: Sculpt 'Inverse Cursor Color' Label
Shorten name of 'Inverse Cursor Color' to 'Inverse Color' so that it does not overflow its popover.

Differential Revision: https://developer.blender.org/D9274

Reviewed by Brecht Van Lommel
2020-10-20 08:25:28 -07:00
Jeroen Bakker
e05ce1ea20 UV/Image: Remove Legacy Drawing
With D8234 a new drawing method for UV/Image editor was introduced. For debugging
reasons we left the old drawing method in the code base. This patch will remove
the old drawing method.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9011
2020-10-20 17:06:13 +02:00
239eb95ef8 Fix T81865, T81860: CustomData Correction can fail on non standard names
Caused by rBaafd71a8a160.

In the process of CustomData Correction, we need to make sure we also
have matching layer names [as was done before above commit], otherwise
this will create layers with default names, applying
(mesh_customdatacorrect_apply and friends) will fail then.

Maniphest Tasks: T81865

Differential Revision: https://developer.blender.org/D9278
2020-10-20 16:22:36 +02:00
1c08ab4535 CMake: Compile GMP library as fat library
The idea behind this is to compile all versions of functions,
and let the library to pick the best at runtime.

Attempting to fix T81835
2020-10-20 16:18:59 +02:00
0cd7f7ddd1 Nodes: add geometry socket type
We still have to pick a color for this socket.

Ref T81848.
2020-10-20 15:31:59 +02:00
8319279fdb Cleanup: remove dead code 2020-10-20 15:23:15 +02:00
Jeroen Bakker
7320ecee9b EEVEE: ShaderToRGB alpha inversed
The alpha out socket output the average transmittance, not the alpha.
This patch will convert the transmittance to alpha.

Found during research of T80919; Issue introduced when `Closure.opacity` was migrated to `Closure.transmittance`.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9010
2020-10-20 15:17:03 +02:00
257fe5a6e7 Volumes: Fix compilation when building without openVDB
And remove a warning.
2020-10-20 15:08:25 +02:00
360282cf1f Libmv: Refactor camera intrinsics parameter block
Use the newly introduced packed intrinsics, which allows to remove
code which was initializing parameters block based on distortion
model type.

Now such initialization is done by a particular implementation of
a distortion model.

Differential Revision: https://developer.blender.org/D9192
2020-10-20 15:02:50 +02:00
549841bbc0 Libmv: Add generic class for packed intrinsics
This is a common class which can be used in all sort of minimization
problems which needs camera intrinsics as a parameter block.

Currently unused, but will replace a lot of hard-coded logic in the
bundle adjustment code.
2020-10-20 15:02:50 +02:00
151173fefe Libmv: Add array<type, size> to libmv namespace 2020-10-20 15:02:50 +02:00
abc017ae0b GLTexture: Fix Anisotropic filtering affecting the standard mipmap samplers
Everything's in the title...
2020-10-20 14:55:18 +02:00
45400b32d0 DRW: Disable anisotropic filtering on utility textures
Anisotropic filter may result in incorrect algorithm. This only
affects util textures (not Image datablocks gpu textures).
2020-10-20 14:55:18 +02:00
711b55b527 Fix libmv test on windows
There is no point in testing std::vector capacity as it can differ
between std implementations.
2020-10-20 14:46:48 +02:00
b3d469e78d Fix compile error
Haven't tested on windows, hope that works.
2020-10-20 14:16:42 +02:00
5bd7eda093 Fluid: Add missing versioning for new options in 'Viewport Display' panel
Files created before D8705 was merged need to get initial values for the new viewport display fields.
2020-10-20 14:06:43 +02:00
14c0897671 Fix T81076: Crash on switch object operator undo
This fixes the crash and the assert, but undo is done in multiple steps

Reviewed By: campbellbarton

Maniphest Tasks: T81076

Differential Revision: https://developer.blender.org/D9256
2020-10-20 13:22:43 +02:00
0105f146bb Cleanup: General comment style clean up of graph_edit.c and fcurve.c
No functional changes.

Reviewed By: Sybren A. Stüvel

Differential Revision: http://developer.blender.org/D7850
2020-10-20 13:04:02 +02:00
580fe9f5f8 Fix (unreported) install_deps: wrong version number for llvm in some cases.
Version reported by package manager is not always satisfying (on Debian
testing currently e.g. `llvm-dev` is reported as `9.0`, when exact one
is actually `9.0.1`, this break CMake build of Blender then).

Just use version reported by `llvm-config` instead, when using
distribution packages.
2020-10-20 12:52:17 +02:00
89eef19171 Fix T81776: Sculpt line gestures not working with transformed objects
The line gesture plane should be in object space, not in world space.
2020-10-20 12:14:28 +02:00
6ced026ae1 Simulation: remove particle nodes with outdated design
The design for how we approach the "Everything Nodes" project
has changed. We will focus on a different part of the project initially.

While future me will likely refer back to some of the code I remove here,
there is no point in keeping this code around in master currently.
It would just confuse other developers working on the project.

This does not remove the simulation modifier and data block. Those are
just cleaned up, so that the boilerplate code can be reused in the future.
2020-10-20 12:07:42 +02:00
63a9f24b55 Volumes: simplify volumes in modifiers or on load
This changes how the simplify volumes setting works. Before, it only
affeted viewport rendering. This was an issue, because all internal
computations would still have to happen on the high resolution volumes.
With this patch, the simplify setting already affects file loading and
procedural generation of volumes.

Rendering does not have to care about the simplify option anymore,
it just gets the correct simplified version from the depsgraph.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9176
2020-10-20 11:00:16 +02:00
f3ecb4c91e Fix T81684: node location not handled correctly
Reviewers: ISS

Differential Revision: https://developer.blender.org/D9236
2020-10-20 10:51:19 +02:00
efc2edc47f Fix T81190: Merge by Distance marks edges sharp
Make calculating edges sharp optional since it marks nearly all edges
sharp when the normals have been manually rotated.
2020-10-20 14:39:15 +11:00
c4668b72e0 Cleanup: use BLI_listbase_is_single instead of counting 2020-10-20 14:16:47 +11:00
74d1fba1de Fix Boundary brush not working when the whole mesh is inside the brush radius
When creating the boundary edit data, the loop can stop because a new
vertex was found further from the boundary than the brush radius or
because all vertices of the mesh were already processed. In this second
case, the max_propagation_step was not set, so the code that laters
calculates the falloff was not working, preventing the mesh from
deforming.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9215
2020-10-20 01:59:53 +02:00
2b2f3da721 Sculpt: Smooth deform type for Boundary Brush
This adds a smooth deformation type to the boundary brush, which smooths
the boundary and has a regular falloff towards the inside of the mesh.
For smoothing, only vertices parallel to the boundary are taken into
account, creating this effect.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9204
2020-10-20 01:52:53 +02:00
f780bfafcf Fix missing Sculpt Overlays updates when using modifiers
Now that sculpt mask and face sets can also be drawn without using the
PBVH, these operators need these extra updates when the data changes.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8956
2020-10-20 01:32:02 +02:00
48fd10a77d Sculpt: Reduce the displacement step in the cloth solver
Previously the base displacement for solving the constraints was always
using 0.5, which may introduce artifacts when multiple constraints of
different types are computed for the same vertex. This introduces a
factor that reduces the base displacement of the solver, reducing the
artifacts.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9202
2020-10-20 01:27:44 +02:00
ea4d28aea0 UI: In-line layout for Empty Image Transparency
No need for a sub-panel with a single property (same as mesh
normals auto-smooth, camera passepartout, etc).
2020-10-20 00:48:11 +02:00
31108f9359 UI: Sort "Volume to Mesh" and "Mesh to Volume" in alphabetical order 2020-10-20 00:12:45 +02:00
c6c4925771 Fluid: Added domain check for new OpenVDB precision 'Mini' type
Precision 'Mini' should only be available for liquids domains.
2020-10-19 21:40:17 +02:00
aa244a7a68 UI: Simplified Categorized Menus
Menus with categories gain a dividing line and omit the title.

Differential Revision: https://developer.blender.org/D5135

Reviewed by Brecht Van Lommel
2020-10-19 11:28:38 -07:00
1e3742749e UI: 3DView Popover Adjustments
Slight adjustments to widths, and adds gaps below titles, of 'Viewport Gizmos' and 'Object Types Visibility' popovers.

Differential Revision: https://developer.blender.org/D9257

Reviewed by Pablo Vazquez
2020-10-19 10:55:05 -07:00
3d26cd01b9 Spelling: Apart Versus A Part
Corrects incorrect usages of the fragment 'apart of' when 'a part of' was required.

Differential Revision: https://developer.blender.org/D9245

Reviewed by Campbell Barton
2020-10-19 09:47:19 -07:00
4fb67ae809 CMake/macOS: use system OpenAL for the time being.
Revert part of {rB83124856d05ee4da605ab247e6}
2020-10-19 22:05:56 +05:30
c0a6bc1979 Spelling: Loose Versus Lose
Corrects incorrect usages of the word 'loose' when 'lose' was required.

Differential Revision: https://developer.blender.org/D9243

Reviewed by Campbell Barton
2020-10-19 09:15:34 -07:00
84ef3b80de Spelling: Miscellaneous
Corrects 34 miscellaneous misspelled words.

Differential Revision: https://developer.blender.org/D9248

Reviewed by Campbell Barton
2020-10-19 09:11:00 -07:00
a9f2641cb6 Fix build error with WITH_CYCLES_NATIVE_ONLY and AVX tests on macOS
Only build avx/avx2 unit tests if supported by the compiler and
WITH_CYCLES_NATIVE_ONLY is off, otherwise the appropriate compiler flags
are not available.
2020-10-19 17:55:00 +02:00
d1eefc4215 Spelling: Then Versus Than
Corrects incorrect usages of the words 'then' and 'than'.

Differential Revision: https://developer.blender.org/D9246

Reviewed by Campbell Barton
2020-10-19 08:43:08 -07:00
3a7fd309fc Spelling: It's Versus Its
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required.

Differential Revision: https://developer.blender.org/D9250

Reviewed by Campbell Barton
2020-10-19 08:12:33 -07:00
d2bf71b412 Fix use of uninitialized variable 2020-10-19 09:19:13 -05:00
7ef3a63480 Cleanup: Use BLI string functions
It's better not to assume that strings passed as arguments
will have the proper size.
2020-10-19 09:17:41 -05:00
9bf1bf599b Cleanup: Missing parentheses around macro in versioning
Although the `ELEM` macro wraps logic into parentheses, it's not intended to be
used that way. Unexpanded macros should still follow regular coding style for
readability and for tools parsing the code (it confused clang-format for
example).
2020-10-19 15:38:55 +02:00
Ankit Meel
83124856d0 Cmake/macOS: strictly disallow searching in frameworks
This is a stricter version of the change made in
{rBbb872b25f219d1a9bc2446228b6dc}

Cmake must never look into Frameworks when the system
library guards (`without_system_libs_begin`/`without_system_libs_end`)
are present.

OpenAL didn't follow this and OpenAL.framework in Xcode would be used.
The Cmake's `FindOpenAL.cmake` looks for both library (in this case,
the .framework file), and include dir.
Precompiled libraries don't contain the former. So `find_package`
cannot be used, or it becomes the hack that {rBb2c707747da9} removed.
So hardcode the include dir path, and other variables.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9267
2020-10-19 18:47:35 +05:30
4d9f357bf6 Fix T81806: Cycles error when GPU device_type is NONE
Own regression in 4bea4702d5
2020-10-20 00:09:51 +11:00
29dbe00719 Fix T81484: Weight/Vertex paint with mirror and viewport clipping does not update stroke on initial side
Issue introduced in rB4f616c93f7cb.

Issue here is that the the `StrokeCache` `mirror_symmetry_pass` is still
in its previous state when entering
`wpaint_do_symmetrical_brush_actions`.
For the initial stroke this means that the (wrong) cache
`mirror_symmetry_pass` ends up in SculptBrushTest `mirror_symmetry_pass`
as well and thus the clipping test in `sculpt_brush_test_clipping` will
fail.
[ This one flips the coords to test against clipping according to (now
wrong) `mirror_symmetry_pass` ]

Solution seems simple: just ensure we start of with a
`mirror_symmetry_pass` of zero in `wpaint_do_symmetrical_brush_actions`
for the initial stroke.
Same thing is done for vertex paint as well.

Maniphest Tasks: T81484

Differential Revision: https://developer.blender.org/D9268
2020-10-19 15:01:38 +02:00
477d983c2e Animation: Improve labels on Snap menu in graph editor
Add "Selection to" as prefix for those menu items that move the selected
keyframes to something, for both the Key → Snap menu and the Shift+S pie
menu.

No functional changes.
2020-10-19 14:02:53 +02:00
e3c76f7937 Fix libmv eigen alignment issues when compiling with AVX support
There would be eigen alignment issues with the custom libmv vector
class when compiling with AVX optimizations. This would lead to
segfaults.

Simply use the std::vector base class as suggested by the old TODO in
the class header.

Reviewed By: Sergey

Differential Revision: http://developer.blender.org/D8968
2020-10-19 13:06:38 +02:00
b17ad27adc Silence an unused variable warning in bmesh_bevel.c. 2020-10-19 06:54:24 -04:00
e49ee5a808 Fix (unreported) crash when unlinking a brush from a tool.
Cursor drawing code was not checking for potential NULL pointers.
2020-10-19 12:50:01 +02:00
93887d1096 Fix: skip drawing input sockets that do not have a draw method
Contributed by @povmaniaco with minor changes by me.

Differential Revision: https://developer.blender.org/D9263
2020-10-19 12:28:44 +02:00
f7832b1583 Volumes: new Volume to Mesh modifier
This modifier is the opposite of the recently added Mesh to Volume modifier.
It converts the "surface" of a volume into a mesh. The "surface" is defined
by a threshold value. All voxels with a density higher than the threshold
are considered to be inside the volume, while all others will be outside.

By default, the resolution of the generated mesh depends on the voxel
size of the volume grid. The resolution can be customized. It should be
noted that a lower resolution might not make this modifier faster. This
is because we have to downsample the openvdb grid, which isn't a cheap
operation.

Converting a mesh to a volume and then back to a mesh is possible,
but it does require two separate mesh objects for now.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9141
2020-10-19 12:12:44 +02:00
bd15efefd2 Cleanup: clang tidy 2020-10-19 11:35:23 +02:00
850944e6cd Image: Export emissive colors in 3 channel PNG images
Related to T81199. When saving a rendered image with transparency (RGBA)
to a 3 channel PNG image the emissive colors were not exported. This
change adds the emissive colors to the written file.

NOTE: this does not fix the limitation of writing emissive colors to a 4
channel PNG file as the file format does not support this.
2020-10-19 11:29:47 +02:00
Alistair Sealy
f52f51aef2 Cleanup: spelling in comments
Fixed a couple of typos in comments in CMakeLists.txt and GNUmakefile

Reviewed By: #platforms_builds_tests, mont29

Differential Revision: https://developer.blender.org/D9261
2020-10-19 09:27:32 +02:00
Jeroen Bakker
1ceb91d1b3 Fix T81167: Texture Painting with Paint mask enabled, (de)selecting faces causes a mess with texture slots
Issue caused by {9582797d4b50} in b2.90. The surface per material used
an index buffer owned by the batch. These index buffers are created at
the same time the surface tris index buffer was created. When a material
per batch buffer was invalidated it used the surface tris index buffer
rendering all materials on all surfaces making the last draw command
render succeed.

This patch stores the surface tris per material in the cache so they can
be reused. There is also no need to use the `saved_elem_ranges` anymore as they are
now part of the cache.

The ugly bit of the implementation is that in `extract_tris_finish` the
MeshBufferCache is retrieved. But as this part was already documented as
a hack and it is something that is only used for final meshes. Other
solutions would impact performance or made the fix not condensed
(passing parameters that shouldn't be used).

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9136
2020-10-19 08:14:07 +02:00
b2e067d98c Fix T68343: Rendered video plays at 600fps
Field time_base of video stream must be set for some containers,
otherwise avformat_write_header() will set it to default values.
Rendered file in such case won't be played at desired frame rate.

See init_muxer() in mux.c in ffpmeg sources.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9213
2020-10-19 07:17:13 +02:00
94364be80a Fix ASAN warning after recent cleanup
rB78a5895c96 introduced a "use after scope" warning, where a buffer
from a lower scope was used later. The solution is to only use one
variable and store whether to use it more explicitely with a bool.
2020-10-18 22:18:31 -05:00
48c484a22e Fix Bevel percent mode, and clamping for it too (T79898).
The code for Bevel's percent (and absolute) modes were pretty bogus.
It assumed, like the rest of the modes, that the offset lines are
parallel to the beveled edge. Which is not true for these modes,
though it accidentally works sometimes if the legs are equilength.
Also the clamping code for those modes was completey wrong.
It is too hard to really fix the clamping code for absolute mode,
but it is a little better now. Percent mode clamping is fixed.
2020-10-18 16:27:07 -04:00
663e047102 Fluid: Fix for issues with external forces
A general refactor / fix commit that should clear out the issues that have been reported on external forces and moving effectors (e.g. T79537, T81660, T80088).
2020-10-18 20:35:02 +02:00
1f046e05b6 Fluid: Add versioning for fluid particle physics type
Setting this type is required to prevent fluid particles from being treated like physics particles. The actual fix for this was made in rB11a8a6d0e6b5.
2020-10-18 20:35:02 +02:00
bdad412fa7 Fix for T81400: Block Width Corrections
Scale widths of popovers and dialogs with Text Style font point changes.

Differential Revision: https://developer.blender.org/D9132

Reviewed by Hans Goudey
2020-10-18 10:31:55 -07:00
78a5895c96 Fix T81800: Datablock pin not working for bones in pose mode
The "active_pose_bone" context variable isn't accessed from
`buttons_context`, it uses `screen_context` instead. This means
it can't account for pinning in the property editor.

Using "pose_bone" context variable first means the property
editor context will be used and the pinning will work.

Differential Revision: https://developer.blender.org/D9242
2020-10-18 10:57:14 -05:00
806a561e23 Sculpt: Fix (unreported) assert getting trimming cursor depth option
It is a boolean, not an enum.
2020-10-18 15:06:27 +02:00
e1cd6fae34 Avoid Assert in BKE_mesh_calc_loop_tangent_ex
Code could call CustomData_get_layer_index_n with a negative index (if
no active and/or render UV layers are found). This would assert since
rBe86785c51445.

Spotted while looking into T81398.

Differential Revision: https://developer.blender.org/D9212
2020-10-18 10:56:39 +02:00
9c7fda6de3 Fix T81729: Cycles object color not updating for instancers
Caused by rBe65c78cd43aa.

Since above commit, only geometry and lights received the update,
previous to this check an instancer would receive that is well (in case
of 'is_updated_shading').

Now check for an instancer (checking OB_DUPLI via ob.is_instancer()) and
do an update then as well.

Reviewers: brecht

Maniphest Tasks: T81729

Differential Revision: https://developer.blender.org/D9222
2020-10-18 10:42:17 +02:00
f425f40c4e Cleanup: More miscellaneous code quality changes in wm directory
- Declare variables where initialized.
  - Use LISTBASE_FOREACH macro.
  - Reduce variable scope.
  - Return early or reduce indentation in some cases.
2020-10-17 16:36:02 -05:00
85e78fa17c Cleanup: Declare variables where initialized in context.c 2020-10-17 16:30:56 -05:00
d48d8b3456 Fix T81761: EEVEE enabled AO pass affects render result
This was a regression introduced on 68651534c2.
2020-10-17 13:10:13 +02:00
7447eb7e74 Cleanup: Miscellaneous improvements in wm directory
- Reduce variable scope.
  - Use LISTBASE_FOREACH macros.
  - Return early in some cases to reduce to reduce indentation.
2020-10-17 01:28:34 -05:00
2c14a950a7 Fix T81594: Unable to reassign effect inputs
This was caused by canceling operator if strip has more than 0 inputs.
Logic should be reversed - cancel only if strip has 0 inputs.

BKE_sequencer_render_loop_check() arguments had to be sanitized because
seq_effect_find_selected() can set seq1,2,3 to NULL

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9197
2020-10-17 07:01:12 +02:00
e2c5439cb4 Cleanup: Reduce variable scope in screen directory
Also return early and use LISTBASE_FOREACH in a few places
2020-10-16 21:56:58 -05:00
20276e4b00 Cleanup: Reduce variable scope in area.c 2020-10-16 20:49:47 -05:00
3bc808ebcb UI: Tweak decimate modifier layout
- Expand the "Type" toggle at the top. This is consistent with other
  modifiers where there is a "Type" option at the top. It conveys the
  property's importance and makes it faster to switch it.
- Expand the "Delimit" option vertically so the text isn't squashed.
  There isn't enough space on one line for this, and is has to be
  expanded because more than one option can be selected. This is also
  consistent with how "multi-select" enums are often displayed, like
  the 3D view snapping settings.

|   Before   |   After    |
| {F9000996} | {F9000985} |
2020-10-16 16:03:45 -05:00
c275a00a72 UI: Align related properties
The start and end frame properties are generally aligned in one block.
2020-10-16 15:50:15 -05:00
54da72d3cd Property Search: Reset panel expansion when exiting search
This patch implements panel expansion saving and resetting for property
search. While search is active, the panel expansion is based on whether
or not it has a search result. When the search finishes, the panel
expansion returns to its state before the search started. However, any
panels interacted with during the search won't reset their expansion.

This requires adding a new runtime flag for panels to store whether to
use search result status as expansion. It also requires better handling
for animation when panel expansion changes with another new runtime flag.
`UI_panel_is_closed` gets the search-dependent expansion, but it is
intentionally not used to access expansion in every case-- sometimes it's
necessary to use `PNL_CLOSED` directly.

Differential Revision: https://developer.blender.org/D8984
2020-10-16 15:16:44 -05:00
77aef03d8a Cleanup: reduce variable scopes 2020-10-16 18:06:30 +02:00
00ee3960e0 Cleanup: reduce variable scopes 2020-10-16 17:30:12 +02:00
89ffdad0f3 Fix misuse of alloc inside a loop
Alloc will only free its memory when the function is returned.

Issue introduced in c866075dfb. Thanks Sergey for spotting this.
2020-10-16 17:18:23 +02:00
5ebdbcafcb Animation: Snap Cursor Value operator
Add operator to snap the 2D Cursor value to selected keyframes. This is
doing almost the same as the "Cursor to Selected" operator, except that
it doesn't affect the current frame, just the Y-coordinate (the value)
of the 2D cursor.

The "snap cursor" operators are added to the Key → Snap menu and to the
Snap pie menu. This means that these menus are now extended in meaning,
to not only mean "snap the selected keyframes to the cursor", but also
for some options "snap the cursor to selected keyframes".

This fixes T76596.
2020-10-16 16:44:06 +02:00
df4a93aca0 Cleanup: Animation, split up frame jump operator
Split up `GRAPH_OT_frame_jump` exec function and added some local variables
to give names to the cryptic `ked.f1`, `ked.f2`, and `ked.i1`.

No functional changes.
2020-10-16 16:09:20 +02:00
342be27daa Cleanup: clang-tidy 2020-10-16 15:33:00 +02:00
5b9296f0d6 Fix (reported by studio team) crash in relocate lib code.
We do not always find a matching ID in new library.
2020-10-16 15:22:20 +02:00
6430849366 Fix T81027: Multires objects in sculpt mode can't be linked via collections.
Just clear all non-object mode flags from linked objects at read time.

Reviewers: brecht

Subscribers:
2020-10-16 14:04:17 +02:00
4475c49e2f Fix T81591: Align view to active is not working in sculpt mode
Remove sculpt/paint checks in getTransformOrientation_ex
This code goes back a long time (early 2.5x). I couldn't find any
reason why sculpt/paint checks were being made.

This makes the following changes:

- When in object mode, the object must be selected.
  Since this function typically operates on the selected items.

- When in paint/particle modes, the objects matrix is always
  used regardless of selection, since object selection can't be
  controlled in these modes.

- When there is no active object, the first selected object is no
  longer used as it's quite an arbitrary decision & not something
  done elsewhere with objects in Blender.
2020-10-16 22:16:53 +11:00
3b84dce969 Fix T54526: Data Transfer modifier's Max Distance field working strangely.
Based on investigation by Philipp Oeser (@lichtwerk) and solution by
Alexander Gavrilov (@angavrilov) in D5206, thanks!
2020-10-16 13:00:40 +02:00
14f490b932 EEVEE: SSR: Fix unreported smoothstep instability when border factor is 0
From the GLSL documentation: `Results are undefined if edge0 ≥ edge1.`
This is the case without this patch.
2020-10-16 12:56:57 +02:00
eb55ca72f4 UI: Make node theme settings to conform to UI rules
Basically first letter of (most) words is to be capitalized.

These settings (Noodle curving and Grid levels) had this wrong since
their first commit (2011 and 2020 respectively).
2020-10-16 12:10:18 +02:00
5d92fd8a90 Correct last commit 2020-10-16 20:51:58 +11:00
b002fdc4bf PyDoc: update to account for new context member 2020-10-16 20:29:55 +11:00
491d777efc Cleanup: remove debug printf()
No functional changes.
2020-10-16 10:59:43 +02:00
c5bdbc340a Fix T62463: unable to select anim channel for unselected node
Remove the code that synchronises selection state of shader node animation
channels. This code is only used in a few cases where selection of these
animation channels is changed, and then potentially does the wrong thing
and disallows selection of animation channels altogether.

This removal is meant to be a temporary situation, to unblock animation
channel selection. See T74159 for the overall effort to improve selection
sync.
2020-10-16 10:21:36 +02:00
5722de6098 Cleanup: Animation, remove unused parameters
No functional changes.
2020-10-16 10:17:10 +02:00
bb872b25f2 CMake/macOS: Search for headers in Frameworks last.
https://devtalk.blender.org/t/libpng-version-mismatch/15799/

By default, `CMAKE_FIND_FRAMEWORK` is `FIRST`.

CMake searches headers and libraries separately. So library is found
in LIBDIR, and headers like those in Mono are detected before the
headers in LIBDIR, and we get a version mismatch.

So set the priority of Frameworks to `LAST`.

https://gitlab.kitware.com/cmake/cmake/-/issues/18921
https://gitlab.kitware.com/cmake/cmake/-/issues/16427

{rBbac91956ae97} tried to fix the same issue, but it didn't work.
It's fine to keep the changes made there, just removing the comment
that may give false sense of security.
2020-10-16 13:41:29 +05:30
3ffe65a7fb CMake/macOS: Restore TIFF's optional status.
{rB1f6b7387ad01}
2020-10-16 13:41:26 +05:30
fa566157a5 PyAPI: unregister add-ons when exiting
This lets add-on authors avoid false positive leaks when exiting.
In particular GPUShaders's although it applies to any PyObject that
stores memory allocated by guarded-alloc.

While this does add overhead on exit, on my system it's
under 1/100th of a second with all addons enabled.

See: T71362
2020-10-16 16:34:29 +11:00
f40294b2d6 Fix syntax error in IC-Keymap
Regression in e936f04258
2020-10-16 16:20:44 +11:00
0a2ae7f220 RNA: support building WITH_PYTHON=OFF 2020-10-16 15:56:26 +11:00
9fb2ce70d6 Cleanup: remove f-string use 2020-10-16 14:06:47 +11:00
507e7bcbdb Cleanup: assign variables for re-used context members 2020-10-16 14:00:15 +11:00
fa0ceb4959 Cleanup: spelling 2020-10-16 11:46:48 +11:00
00f7b572d9 Windows: Fix build issue on windows
TBB includes Windows.h which defines a min/max macro
leading to issues when you want to use std::min and
std::max.

This change prevents Windows.h from defining them
sidestepping the issue.
2020-10-15 17:14:57 -06:00
ba8233174c Fix build error with clean builds
Needed after d1b3439b80. Think the error only happened with fresh builds,
where dna_type_offsets.h didn't already exist.

We have to do the same in other places too, see 8594cdb456.
2020-10-15 23:02:16 +02:00
e936f04258 Outliner: Use operator option to decide which item to rename
The `outliner.item_rename` operator needs to decide if it should rename the
active or the hovered item. Previously it checked if the event is a press
event, which is a hacky way of doing this and limit how the operator can be
used in the keymap.
Now use a operator option to let this be controlled on the keymap level.

Doesn't change any default behavior.
2020-10-15 21:31:43 +02:00
0a66436fe5 Fix T76597: Support Keyframe: Copy To Selected
Reviewed By: Sybren, Luciano Muñoz Sessarego

Differential Revision: https://developer.blender.org/D7783
2020-10-15 14:55:09 -04:00
a88076e948 Fix error in previous commit
Missing null-check, could lead to null-pointer dereference.
2020-10-15 20:40:03 +02:00
d4f94d8a31 Cleanup: Refactor lookup for hovered Outliner element for renaming
* Use existing and optimized lookup function, rather than own duplicated logic.
* Move low-level coordinate check into general function, alongside similar
  ones.
2020-10-15 20:31:36 +02:00
5129e2e042 Fix T81675: Renaming collapsed collection in Outliner renames nested items
* `do_outliner_item_rename()` enables the rename mode for the item under the
  cursor. Issue is, collapsed children end up having stored the same coordinate
  as their parent, so they too would get the rename mode enabled (there is no
  early-exit that would hide this).
* The items displayed as inline icons do get the proper coordinates of the
  icons, so they are not mistaken as being under the cursor.

After rBb077de086e14, the Outliner tree is rebuilt less often, so the
coordinates are cleared less often too.

As far as I can see we can always clear coordinates of invisible items now. No
code seems to depend on keeping the old coordinates anymore.
2020-10-15 20:31:36 +02:00
5efb104003 Silence warning 2020-10-15 20:03:26 +02:00
c866075dfb Fix T81580: No doversion for Emission Strength
The new parameter made so that previously keyed Alpha values were lost
and instead the new "Emission Strength" was keyed.

Issue introduced with the original commit of Emission Strength: b248ec9776

Note: Files created since the issue (September 17) that keyframed the
Emission Strength will have to fix their files manually.

Differential Revision: https://developer.blender.org/D9221
2020-10-15 19:59:58 +02:00
ca55a1b564 Fix Cloth brush grab artifacts in the affected area
The cloth brush grab mode was creating constraints at 1.0 strength in
the area of the brush where the fade was evaluated to 1. This was causing
stability issues in the simulation and not producing ideal results.
Now the constraint strength is scaled with an empirically found factor.

The values in this patch may require further tweaking after experimenting
a little bit more with them.

Reviewed By: sergey, zeddb

Differential Revision: https://developer.blender.org/D9201
2020-10-15 19:54:41 +02:00
91af828e8b Fix T81743: Changed behaviour in RGB Curves node interpolation
Restore the old `correct_bezpart()` (pre-rBda95d1d851b4) function as
`BKE_curve_correct_bezpart()`, and use that where the old behaviour was
desired (that is, curve maps like used by the RGB Curves shader node).

The new (post-rBda95d1d851b4) function is also renamed to
`BKE_fcurve_correct_bezpart()` to avoid confusion.
2020-10-15 19:48:14 +02:00
229b9f1299 Fix brush tip delta orientation with anchored strokes
When using anchored stroke, the stroke operator was modifying the
coordinates on the "mouse" rna property by setting them to the original
position. Because of this, all the sculpt delta calculation was failing
and the delta for these brushes was set randomly (with a 0 vector) at
the beginning of the stroke.
There is now an extra property that uses the unmodified coordinates of
the mouse to calculate the delta. Now delta orientation works as expected
in all brushes and features that require brush tip orientation.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9183
2020-10-15 19:45:43 +02:00
6991b13e41 Fix T81649: Cloth simulation dynamic area mode tearing the mesh
Dynamic area should use the radius instead of the initial radius to get
the nodes as the radius can now change during the stroke. In case of
anchored strokes, the current radius can be bigger than the initial
radius, simulating vertices outside the falloff area and breaking the
mesh.

Reviewed By: sergey

Maniphest Tasks: T81649

Differential Revision: https://developer.blender.org/D9181
2020-10-15 19:40:27 +02:00
ef5f307031 Sculpt: Use mpoly flags to sync Face Sets visibility
Previously, all Face Set visibility logic was using mvert flags directly
to store the visibility state on the vertices while sculpting. As Face
Sets are a poly attribute, it is much simpler to use mpoly flags and let
BKE_mesh_flush_hidden_from_polys handle the vertex visibility, even for
Multires.

Now all operators that update the Face Set visibility state will always
copy the visibility to the mesh (using poly flags) and the grids, all
using the same code.

This should fix a lot of visibility glitches and bugs like the following:
 - Sculpt visibility reset when changing multires levels.
 - Multires visibility not updating in edit mode.
 - Single face visibible when surrounded by visibile face set, even when
the face set was hidden.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9175
2020-10-15 19:39:11 +02:00
750e4e1158 Fix Multires edge adjacency info returning wrong vertex indices
ME_POLY_LOOP_NEXT and ME_POLY_LOOP_PREV expect the offset of
the loop in the poly as an argument, in other words, corner index of the poly.
This was violated in some places. It didn't cause issues when base mesh consists
of only quads due to the way how modulus worked inside of the macro. However,
if mesh had non-quad faces adjacency information was returning wrong vertex
 indices. This was causing multiple brushes to work erratically, including brushes
like Face Set, Boundary automasking, mesh relax, and others.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9173
2020-10-15 19:37:56 +02:00
6fe3521481 Sculpt: Add global automasking settings support in filters
When using the sculpt filters, global automasking settings that affect
all brushes were ignored because the automasking system was not
implemented for filters, making filters and brushes react differently
to the global sculpt settings which creates confusion.

This makes all filter tools (mesh, cloth, color) use the same general
automasking settings and features as the brush tools. Filters will now
use the settings in the options panel to limit their effect.

This also removes the "use Face Sets" option from the Mesh filter code,
as it was duplicated from the automasking code just to have that
funcitonality. This is now handled by the regular automasking system.

The "Use Face Sets" option is still available in the cloth filter as that
option limits the action of the forces, not the displacement.

After this, it is possible to initialize the automasking system
independently from the StrokeCache and Brush settings, so it can also be
added to more tools and features in the future.

Fixes T81619

Reviewed By: dbystedt, sergey

Maniphest Tasks: T81619

Differential Revision: https://developer.blender.org/D9171
2020-10-15 19:35:37 +02:00
da7ace00d5 Sculpt: Use cursor depth in trimming gestures
This adds an operator property to use the paint cursor radius and
position for the depth of the trimming shape created by the trimming
tools.
When enabled, the shape is located in the surface point when the gesture
started and it will have the depth of the cursor radius. When the cursor
is not over the mesh, the shape will be positioned at the center of the
depth of the whole object from the viewport camera.

Reviewed By: dbystedt, sergey

Differential Revision: https://developer.blender.org/D9129
2020-10-15 19:15:04 +02:00
b9e4696641 Sculpt: Show paint brush cursor in all tools
This patch enables the paint brush cursor with all tools in sculpt mode,
even with the ones that are not brushes. The motivations for this change
are:
- The filters are using the position of the active vertex for certain
features without any visualization of what the active vertex is.

- You can call operators like mask expand (which depends on the brush
cursor position and active vertex) with a non brush tool enabled.

- Having the cursor in the rest of the tools allows to have a scene
scale representation of the radius and a direct control of radius and
strength (using the current brush shortcuts), which will allow to make
features more intuitive without relying on modifying values in the
topbar. For example, the brush radius can be used to control the depth
of the cut in the trimming tools or the size of the sphere in the
sphere mesh filter

Reviewed By: #user_interface, dbystedt, pablovazquez

Differential Revision: https://developer.blender.org/D9071
2020-10-15 19:03:35 +02:00
4b99ea17fb Fix mask expand creating wrong masks when the cursor is not over the mesh
This forces the mask expand modal operator to use the maximum
iteration when the cursor is not over the mesh, masking the entire
connected component.

This fixes the issue for both expanding masks and face sets.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9105
2020-10-15 19:02:02 +02:00
Pablo Dobarro
0d5ec990a9 Sculpt: Experimental Pen Tilt Support
This adds support for pen tilt in sculpt mode. For now, pen tilt is used
by tweaking the tilt strength property, which controls how much the pen
angle affects the sculpt normal. This is available in Draw, Draw Sharp,
Flatten, Fill, Scrape and Clay Strips brushes, but it can be enabled in
more tools later.

The purpose of this patch is to have a usable implementation of pen tilt
in a painting mode, so users can test and see in which hardware and
platforms this feature is supported and how well it works. If it works
ok, more tools and features that rely on pen tilt can be implemented,
like brushes that blend between two deformations depending on the angle.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8893
2020-10-15 19:00:51 +02:00
6dda0779fc Fix T80625: Trimming tools not working with transformed objects
The code to handle object transforms was wrong. Now the trimming mesh
and depts is calculated in world space, using the real view origin and
normal and then stored in object space in the mesh and in the original
coordinates array. As now both meshes for the boolean operation are in
the same object space, the space conversion code can also be removed
from the boolean function.

Reviewed By: sergey

Maniphest Tasks: T80625

Differential Revision: https://developer.blender.org/D8852
2020-10-15 18:55:26 +02:00
Leha
0fed1bea65 Improve Voxel Remesher volume projection artifacts on sharp edges
The voxel remesher was using the voxel size to limit the shrink-wrap
projection distance. Now that distance is increased to help preserving
more detail on hard surface edges.

Reviewed By: pablodp606

Differential Revision: https://developer.blender.org/D6204
2020-10-15 18:51:26 +02:00
e7ab802ab0 Fix T81697: Property search crash with python handlers
Previously I used `CTX_copy` to create a mutable copy of the context in
order to set its area and region fields to temporary variables. This was
a tradeoff to avoid casting away `const` for `bContext`.

However, `bpy.context` is set to this new temporary value, which is fine
for a single `wm_draw_update` pass, but in the next main loop,
`bpy.context` is still set to this value, which was freed at the
end of `property_search_all_tabs`. It would be possible to reset the
`bpy.context` variable ath the end of the function, but this patch
contains an alternate solution: just don't copy the context. It looks
like this was the only use of `CTX_copy` anyway, maybe for good reason.

Differential Revision: https://developer.blender.org/D9216
2020-10-15 10:08:39 -05:00
15d78ea85b UI: Add reset to default value to keymap
With all the work on DNA defaults for 2.91, it's nice to expose this
convenient operator. This was already hardcoded in the UI code to the
backspace key, adding it to the keymap instead will make the shortcut
automatically show in the button right click menu.

Differential Revision: https://developer.blender.org/D9219
2020-10-15 10:02:44 -05:00
d1b3439b80 Cleanup: Use DNA defaults for grease pencil modifiers
This will make "Reset to Default Value" work properly for grease
pencil modifiers. See T80164 for more information.
2020-10-15 09:44:39 -05:00
bac91956ae CMake/macOS: set package_ROOT for PNG, JPEG, TIFF
https://devtalk.blender.org/t/libpng-version-mismatch/15799/

In this case, CMake finds libraries in `LIBDIR`, but picks headers from
`/Library/Frameworks/` (Mono framework).

CMP0074 is already enabled, so use it.
2020-10-15 18:49:45 +05:30
78d1aa4d52 Cleanup: Animation, simplify channel selection code
Split up `ANIM_deselect_anim_channels()` into
`ANIM_anim_channels_select_set()` and
`ANIM_anim_channels_select_toggle()`.

`ANIM_anim_channels_select_set()` is equivalent to the old
`ANIM_deselect_anim_channels(..., false, ACHANNEL_SETFLAG_xxx)`.

`ANIM_anim_channels_select_toggle()` is equivalent to the old
`ANIM_deselect_anim_channels(..., true, ACHANNEL_SETFLAG_ADD)`.

`ANIM_deselect_anim_channels(..., true, ACHANNEL_SETFLAG_CLEAR)` was
also called once. The `true` parameter suggested the "toggle" behaviour
was intended, but the `ACHANNEL_SETFLAG_CLEAR` argument prevented any
toggling. This is now replaced with `ANIM_anim_channels_select_set(ac,
ACHANNEL_SETFLAG_CLEAR)` to make this explicit.

No functional changes, just a cleanup in order to better understand how
the selection works.
2020-10-15 14:04:14 +02:00
1ec1e36ac1 Cleanup: Animation, rename function to match operator
Rename `animchannels_deselectall_exec` → `animchannels_selectall_exec` so
that it matches the operator `ANIM_OT_channels_select_all`.

No functional changes.
2020-10-15 14:04:14 +02:00
d6fd03616e Fix part of T74918: 3D Viewport: Jump, when mouse crosses a window corner.
We need a separate time stamp for each axis, and we have to add a few
milliseconds of padding to those, to ensure wrapping on both axes get
properly performed when it happens almost simultaneously, and avoid
extra wrapping caused by very close events sometimes.

This only addresses the Linux (X11 backend) case.

Differential Revision: https://developer.blender.org/D9209
2020-10-15 13:55:09 +02:00
f1aa55b6e9 Cleanup: rename BPy_GetContext -> BPY_context_get
Matching BPY_context_set.
2020-10-15 19:00:17 +11:00
5531697f6d Cleanup: remove duplicate context variable (__py_context)
The context was stored both in __py_context & bpy_context_module.

This avoids duplicate functions to update them too.
2020-10-15 19:00:16 +11:00
Janusch Patas
1cc3abca70 Fix T80768: Subdivision Surface modifier uses viewport subdivision settings when rendering in edit mode
Being in render 'context'was not taken into account in code evaluating
modifiers for meshes in Edit mode.

Reviewed By: #modeling, mont29

Differential Revision: https://developer.blender.org/D9217
2020-10-15 09:46:22 +02:00
7b951ba5c3 Cleanup: Do not compare bool value to 0. 2020-10-15 09:31:40 +02:00
1001adb500 Fix T81520: Crash setting the Cycles device from Python 2020-10-15 16:53:38 +11:00
4bea4702d5 PyAPI: throw exception when cycles is given an invalid device name 2020-10-15 16:35:41 +11:00
c0dde8be84 Cleanup: defer importing '_cycles' in properties.py
This was imported already in nearly all usage.

Also use static-set for string comparison.
2020-10-15 16:25:26 +11:00
aca8640b12 Cleanup: use defined sizes when accessing file date/time
Also add static assert for struct size assumption.
2020-10-15 10:54:06 +11:00
a509e79a4c Cleanup: Comment formatting, grammar 2020-10-14 15:04:49 -05:00
11a8a6d0e6 Fluid: Add phystype to fluid particle settings
When creating a particle system to display simulated particles, the phystype needs to be set to 'no physics' so that particle positions are just copied and not integrated.
2020-10-14 21:58:58 +02:00
Juanfran Matheu
53792e32e7 UI: Show more information in open file tooltip
This shows the file's full path, its modification date, and its size in
the tooltips for the open recent fiels menu. When no file path is set,
the original operator description is used.

Differential Revision: https://developer.blender.org/D9028
2020-10-14 13:57:31 -05:00
adc0291061 Fix T81633 Workbench: TAA never resolve when enabling both X-Ray and cavity
This was caused by a wrong flag equality check when in xray mode because
the xray mode was masking the effect option flags that are not supported
in this mode. This means the never passed and the TAA was reset before
every redraw, leading to infinite rendering.
2020-10-14 19:26:44 +02:00
57de568604 Fix T81004 Python: Images drawn in the Sequence Editor have wrong colors
This was caused by the sequencer using a sRGB buffer without using
the sRGB transform.

This patch make it so that the framebuffer is rebound using the
sRGB transform before the python draw callbacks.
2020-10-14 18:53:41 +02:00
3271074120 GL: FrameBuffer: Set GL_FRAMEBUFFER_SRGB if needed
This makes possible to rebind the same GPUFrameBuffer to enable or
disable sRGB encoding transform.
2020-10-14 18:53:41 +02:00
4fa4245464 PyDocs: GPU Module: Examples: convert all gl_FragColor variables to FragColor
Based on D6425 by @robbott

Differential Revision: https://developer.blender.org/D6425
2020-10-14 11:18:36 -04:00
50d78116cd Fix warning for duplicate field in DNA defaults
Caused by a typo in rBd3b59d1358424371. Thanks to @ankitm for reporting.
2020-10-14 10:09:28 -05:00
1cf8a4e5ea Fix Asan warning in property editor texture tab
When there is no active texture, a NULL pointer was dereferenced.
It didn't crash because the dereference was for the first item at the
pointer, the ID. To fix this, return with no data when `texture is NULL.
2020-10-14 10:00:24 -05:00
fecb276ef7 UI: New option to invert search filter in Dopesheet
A lot of animator request an option to invert the filter of the dopesheet channels. This patch adds that invert filter option. This is not for Grease Pencil only, affect to all modes.

{F8983328}

Note: I have seen the new button has a rounded borders on the left. It would be better get rectangle shape, but not sure how to do it.

Reviewed By: campbellbarton, pepeland

Maniphest Tasks: T81676

Differential Revision: https://developer.blender.org/D9182
c68a2a
2020-10-14 15:24:52 +02:00
459618d860 UI: Change Invert Filter icon for UIList
This makes the icon equals to the invert icon used in all modifiers.

{F8986444}

Reviewed By: #user_interface, Severin, Blendify

Differential Revision: https://developer.blender.org/D9194
3bb3b2
2020-10-14 15:24:52 +02:00
9d2222b7d1 Cleanup: Use enum for return type
This just follows up rB90a27d5aa91a1 with a few changes where
changes were missed.
2020-10-14 07:42:42 -05:00
3e25f70ddd Fix compile error in lite build after recent commit
Mistake in my own commit rBd3b59d1358.
2020-10-14 07:39:59 -05:00
0d52504dff BLI_ghash_performance_test: Fix memory leaks
Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9210
2020-10-14 18:05:47 +05:30
d3b59d1358 Cleanup: Use DNA defaults for fluid modifier
This will make the "Reset to Default Value" operator in button right
click menus work for the fluid modifier. Before they always reset
the values to 0.

Differential Revision: https://developer.blender.org/D9206
2020-10-14 07:14:51 -05:00
a181b15639 Tests: use environment variable for leak sanitizer
Don't override other `LSAN_OPTIONS` like suppression file set in
the environment variable.

Old code added in {rB38ff5064b33ccb8} and {rB5f4e99b7a2b8376}

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9207
2020-10-14 16:53:49 +05:30
5edba9b42f Fix T81688: BPY_thread_save crashes with Python 3.9
Calling PyEval_ReleaseLock() was crashing with Python 3.9
because it accessed the NULL pointer set by PyThreadState_Swap().

This happened when calling ViewLayer.update() for example.

While the existing logic could be fixed by swapping the thread-state
back before calling PyEval_ReleaseLock(), this depends on functions
which are tagged to be removed by v4.0.

Replace use of deprecated functions by calling PyEval_SaveThread(),
instead of inlining the logic, using _PyThreadState_UncheckedGet()
to prevent Python aborting.

The call to PyEval_ThreadsInitialized has been removed
as threads are now initialized with Python.
This could be replaced with Py_IsInitialized() however it doesn't look
like this is necessary.

This is compatible with Python 3.7 & 3.9.
2020-10-14 18:52:02 +11:00
2d4f1afece Cleanup: reduce indentation level in bpy_class_validate_recursive 2020-10-14 16:21:13 +11:00
0133bcaf38 Fix crash starting Blender with Python 3.9
In 3.8 and older the class held a reference to methods,
this is no longer the case in 3.9.
2020-10-14 16:15:44 +11:00
cb40edf63a Fix T81686: Confusing add menu in pose mode 2020-10-14 15:39:56 +11:00
c7cd74fac3 Cleanup: multi-line comment blocks 2020-10-14 15:24:42 +11:00
863b38d708 Cleanup: commented includes 2020-10-14 15:12:40 +11:00
862b5b1842 Fix T81511: Loop-cut overlay doesn't follow deformed cage
With constructive + deform modifiers, loop-cut visualization
wasn't following the displayed mesh.

This now gets the coordinates from the cage when available.
2020-10-14 14:49:22 +11:00
deca7c7954 Cleanup: spelling 2020-10-14 14:43:54 +11:00
2cc7be3e49 Fluid: Removed fluid levelset argument from pressure solve
It seems that this was causing the instabilities at slanted obstacles (with secondary boundary (fractional) collisions enabled) ...
2020-10-14 00:29:43 +02:00
3d1b5e35bd Fluid: Enabled OpenVDB precision argument
This way particles can be saved with the custom OpenVDB precision options that were introduced in the latest Mantaflow update.
2020-10-14 00:29:43 +02:00
2ec07dfa18 Fluid: Update Mantaflow source files
Updated files includes:
- Fix for smoke / fire emission from particles
- Custom precision for liquid particles when saving in OpenVDB format
2020-10-14 00:29:43 +02:00
5f49f818d6 Fixes T81670: Sculpt paint vertex colors brush does not switch to secondary color using CTRL
This was just not implemented. Now make this consistent with
vertexpainting / texturepainting.

Maniphest Tasks: T81670

Differential Revision: https://developer.blender.org/D9195
2020-10-13 22:01:58 +02:00
ec9edd36ca Sculpt: Use plasticity for softbody influence
Previously the softbody strength property was controlling the strength
of the constraints that pin all vertices to the original location. This
was causing problems when the forces were trying to deform the vertices
too much, like when using gravity or grab brushes.

Now softbody is implemented with plasticity, which creates constraints to
a separate coordinates array. These coordinates are deformed with the
simulation, and the plasticity parameter controls how much the
simulation moves the coordinates (plasticity 0), or the coordinates move
the simulation back to its previous position (plasticity 1).

This creates much better and predictable results and adding softbody
plasticity to the brushes can increase its control and the stability of
the simulation.

Reviewed By: sergey, zeddb

Differential Revision: https://developer.blender.org/D9187
2020-10-13 21:53:07 +02:00
9722e369cd UI: Motion Tracking: Make Lens a subpanel of Camera
The camera presets control lens settings too so these setting should be 
part of the camera panel.
2020-10-13 15:47:36 -04:00
a36f02f9ba Fix (unreported) LibOverride: possible uninitialized return variable. 2020-10-13 20:38:04 +02:00
72cfeb2c4e Fix T81674: LibOverride: 'Define Override' UI operation can crash.
Case where RNA is not able to generate a proper path for a property was
not taken into account properly.
2020-10-13 20:38:04 +02:00
be3841b1bf Cleanup: Use doxygen sections in space_buttons.c 2020-10-13 13:23:57 -05:00
7c633686e9 Property Search: Find results in all tabs
This patch enables property search for all tabs in the property editor.
To make interaction faster, if the editor's current tab doesn't have a
result, the current tab changes to the next tab that has a match.

This patch implements basic code that only searches panels.
While we could run the existing "single tab" property search for every
tab, that would also do everything else related to the layout pass,
which would be less efficient, and maybe more complicated to maintain.

The search match status for every current tab of the property editor is
stored in a runtime bitfield and them displayed later by dimming icons
in the tab selector panel to the left. Using `BLI_bitmap` properly in
the runtime struct required moving it to `buttons_intern.h` and
adding a small API to access the search filter instead.

To make sure the editor isn't influenced by anything that happens while
building the layout for other tabs, most of the context is duplicated
and the new search is run in the duplicated editor.

Note that the tool settings tab works slightly different than the other
tabs, so I've disabled searching it for this commit. That would be a
relatively simple improvement, but would just require a bit of
refactoring of existing code.

Differential Revision: https://developer.blender.org/D8859
2020-10-13 13:10:41 -05:00
96dd299055 UI: Add highlight arguments to tab buttons
This adds arguments to `uiLayout.prop_tabs_enum` and the C equivalent
(`uiItemTabsEnumR_prop`) to gray out tabs based on a boolean array.

For property search in multiple tabs, we need a way to show which tabs
have a search result, but we still need to show which tab is active.

Differential Revision: https://developer.blender.org/D8858
2020-10-13 12:43:28 -05:00
9fe5817588 UI: Monochrome Alert Icons not changing color until theme refresh
Changing the color of monochrome alert icons would not change until the theme was reloaded.

Differential Revision: https://developer.blender.org/D9062

Reviewed by Harley Acheson
2020-10-13 09:35:46 -07:00
b7afcdff7b EEVEE: Motion Blur: Add shutter position option
This makes it easier to generate motion trail effect with EEVEE.

This just mimics the cycles option as described here:
https://docs.blender.org/manual/en/latest/render/cycles/render_settings/motion_blur.html

This fix T80070
2020-10-13 18:09:07 +02:00
ed96c59c20 Fix T80086 EEVEE: Motion Blur: Subframe not taken into account
This is a simple fix that just make it work like cycles. The initial time
was missing the subframe offset.
2020-10-13 18:09:07 +02:00
Eric Cosky
dd3b047f8b Windows/CMake:Support BLENDER_USER_SCRIPTS in IDE
This diff adds support for respecting the `BLENDER_USER_SCRIPTS`
environment variable when setting up the IDE environment.

Previously the scripts from the users profile folder were always
used even when this variable was set, leading to the possibility
of the wrong scripts being visible in the IDE.

Differential Revision: https://developer.blender.org/D9189
Reviewed By: Ray Molenkamp
2020-10-13 08:45:22 -06:00
48b52e06b0 Cleanup: Remove unused properties from node Viewer Region operator
The operator would define the `deselect` and `extend` properties,
without actually using them. It's confusing to have them in the keymap
item UI.
2020-10-13 15:53:27 +02:00
c82d167d81 Cycles: fix missing ShaderNode ownership in render_graph_finalize_test 2020-10-13 15:38:57 +02:00
3bb3b26c8f Cycles: Add CUDA 11 build support
With this patch the build system checks whether the "CUDA10_NVCC_EXECUTABLE" CMake
variable is set and if so will use that to build sm_30 kernels. Similarily for sm_8x kernels it
checks "CUDA11_NVCC_EXECUTABLE". All other kernels are built using the default CUDA
toolkit. This makes it possible to use either the CUDA 10 or CUDA 11 toolkit by default and
only selectively use the other for the kernels where its a hard requirement.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9179
2020-10-13 15:15:44 +02:00
ae609346ee Fix T81672: Array modifier default merge distance is 0.1m (typo)
Seems to be an oversight/typo in rB83980506957c.
Now set back to 0.01m (as it was before).

Maniphest Tasks: T81672

Differential Revision: https://developer.blender.org/D9193
2020-10-13 14:46:39 +02:00
16289274ed Fix T81656: Crash relocating a linked library into the current .blend
A .blend file cannot use itself as a library.
This is prevented when linking manually, but was still possible when
relocating, which is now prevented.

Maniphest Tasks: T81656

Differential Revision: https://developer.blender.org/D9191
2020-10-13 14:37:17 +02:00
79875e37fe Cleanup: remove redundant assignment in SCULPT_brush_test_init
As discussed in D9120, this was an oversight in rBe0c792135adf, the same
assignment already happens a couple of lines above.
2020-10-13 13:17:01 +02:00
c11ae5cd21 Fix sculpting/painting with viewport clipping and radial symmetry
This was reported for sculpting, the same is true for weightpaint or
vertexpaint though.

When viewport clipping and radial symmetry are enabled, the
'sculpt_brush_test_clipping()' function was not considering radial
symmetry at all, so if the coordinate was outside the clipping planes,
no action would take place. Now the coordinte is brought back to where
the stroke actually happens and that is checked against clipping.

Since other mirroring options while painting/sculpting (as well as
editmode operations with mirroring) usually still take place even if the
mirrored coord is outside the clipping planes, this should also be the
case for radial symmetry.

This grows the 'SculptBrushTest' struct a bit, but should be acceptable?

Fixes T81466

Maniphest Tasks: T81466

Differential Revision: https://developer.blender.org/D9120
2020-10-13 13:17:01 +02:00
3f78569c3e Fix (unreported) liboverride of an object hiding its dependencies.
When we override a whole collection, we want to add non-instantiated
objects to a hidden sub-collection at the end of the process.

However, this makes no sense when instantiating an object, if other
dependencies objects get also overridden on the process, we should just
add them to the same collection owning the root object.
2020-10-13 13:08:41 +02:00
666485f38c CMake/macOS: find ZLib before setting CMAKE_PREFIX_PATH
https://devtalk.blender.org/t/building-blender-on-macos-fails/15756/

In some cases, CMake finds the Zlib supplied with OpenCollada
pre-compiled libraries, and not the system one.
2020-10-13 16:34:43 +05:30
6b21b82704 Fix (unreported) broken 'make override' of objects in master collection.
Master collections are not in Main list of collections, so we also need
to check the scenes.
2020-10-13 12:26:44 +02:00
7d5d567dba Cleanup: Fix typo in function name. 2020-10-13 12:17:50 +02:00
344c001eae Fix T81669: Vertex size in UV Editor changes using Face Dot Size in themes
Probably copy-paste error in rBd6525e8d133b.

Maniphest Tasks: T81669

Differential Revision: https://developer.blender.org/D9190
2020-10-13 11:51:18 +02:00
211d7ff3cf Fix T81288:Select Linked fails with multi-object edit mode
Changing options after using select-linked didn't work
when the object being selected wasn't the active object.
2020-10-13 16:59:38 +11:00
65965a892f Cleanup: use BKE_fcurve_ prefix for keyframing bezier functions
- BKE_bezt_subdivide_handles -> BKE_fcurve_bezt_subdivide_handles
- binarysearch_bezt_index -> BKE_fcurve_bezt_binarysearch_index

These functions are specific to F-Curves and don't make sense for other
uses of BezTriple (curve-object data for e.g.)

Also:

- Move detailed doxygen comment above code, following code-style.
- Mark bezt_add_to_cfra_elem unused.
2020-10-13 16:46:41 +11:00
8335c26119 Fix T81467: Crash with KD-Tree Weld Modifier
The problem is related to the `use_index_order` option of `BLI_kdtree_3d_calc_duplicates_fast`.
With this option, the higher index is expected to be less than `tree->nodes_len`.
2020-10-12 20:29:15 -03:00
8427e02abc Fix T81589: Correct drag type handling in outliner
Blender crashed when dragging and dropping color into the outliner.
This issue was cause by a missing check for the correct drag type
in `datastack_drop_poll`. The check is added in this commit.
Additionally, a new drag type is introduced for the "data stack"
drag option, that was introduced in commit 1572da858d, to
differentiate it from the existing WM_DRAG_ID type.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D9169
2020-10-13 01:17:36 +02:00
Yevgeny Makarov
dc71ad0624 UI: Monochrome Alert Icons and use the Question icon in the Quit dialog
Change to monochrome version of the large alert icons and use 'Question' for the the Quit Confirm dialog box.

Differential Revision: https://developer.blender.org/D9062

Reviewed by Pablo Vazquez
2020-10-12 15:51:00 -07:00
1d84881ac1 Cleanup: remove duplicate code
This code segment is exactly the same as above.
Looks like it was copied accidentally.
2020-10-12 21:14:14 +02:00
19dcd32ee5 UI: Remove Hard-coded Default Font Size
Default text output routines (which do not specify a size) will now use Text Style point size.

Differential Revision: https://developer.blender.org/D9107

Reviewed by Brecht Van Lommel
2020-10-12 09:53:00 -07:00
1b7458f85a Cleanup: Rename outliner helper function
This name makes more sense and is consistent with related functions
(e.g. `outliner_requires_rebuild_on_select_or_active_change()`).
2020-10-12 18:21:12 +02:00
c1cee363cd Fix T81555: Outliner object state filter not updating correctly
When changing the selected, active or visible object(s), the Outliner
has to be rebuilt while using the corresponding object state filters.

The object hiding operators also have to send the proper notifiers (they
changed visibility without notifying about that).
2020-10-12 18:21:12 +02:00
6f0b082378 Animation: fix assertion failure on unsetting active keyframe
Avoid NULL pointer dereference when checking keyframe selection state in
`BLI_assert()` call.
2020-10-12 17:27:27 +02:00
058a69974a Cleanup: split animchan_sync_fcurve() into smaller functions
Split `animchan_sync_fcurve()` into functions for handling Scenes and
Node Trees.

No functional changes.
2020-10-12 17:00:11 +02:00
5e6c7de3e9 Animation: enforce that the active keyframe is always selected
Check selection state in `BKE_fcurve_active_keyframe_index()`, and only
return the active keyframe index when that keyframe is actually selected.
This is now also asserted in the `BKE_fcurve_active_keyframe_set()` function,
which is now also used when inserting a keyframe.
2020-10-12 17:00:11 +02:00
0d3e192660 Fix T81551: Cycles crash updating volume with modifiers
The volume bounds mesh was being rebuilt too often, it should only be done
when rebuilding the BVH as well, otherwise they can go out of sync.
2020-10-12 16:56:41 +02:00
c68a2a722d Fix T80599 Blender Cloud folder text on the screen very small
This was caused by BLF conflicting with BGL api change.
2020-10-12 15:33:01 +02:00
f56c5245d2 Cleanup: CMake: Remove arguments from endif(..)
No functional change. Added in {rB1f6b7387ad01}
2020-10-12 18:51:48 +05:30
370ed6025f File Browser/macOS: Don't treat .app as directory
While there are other bundles which show up as directories,
`.app` are the most common ones.

*Users should not be saving anything inside .app bundles, nor using
Blender to edit any of the files.
*This declutters the File Browser for say ~/Applications folder
or recursive search on a path with apps.
*Matches Finder's behavior of showing apps as files. (We don't have a
"right click > show package contents" button like Finder though)

This change shows `.app` files like incompatible files, or `.exe`s
on Windows.
{F8970986}

Reviewed By: #platform_macos, brecht, mont29

Differential Revision: https://developer.blender.org/D9162
2020-10-12 18:45:39 +05:30
c4c8d855c6 Libmv: Remove array access from camera intrinsics
That was a suboptimal decision from back in the days, which ended up
being problematic. It is no longer used, so remove it from API making
it so new code does not depend on this weak concept.
2020-10-12 15:12:17 +02:00
ff5e3d6834 Libmv: Fix wrong packing order of intrinsics for BA step
The order got broken when Brown distortion model has been added.
Made it so the indexing of parameters is strictly defined in the
parameter block, matching how parameters are used in the cost
function.

There is some duplication going on accessing parameters. This can
be refactored in the future, by either moving common parts packing
and cost function to an utility function in bundle.cc.
Alternatively, can introduce a public PackedIntrinsics class which
will contain a continuous block of parameters, and each of the
camera models will have API to be initialized from packed form and
to create this packed form.

The benefit of this approach over alternative solutions previously
made in the master branch or suggested in D9116 is that the specific
implementation of BA does not dictate the way how public classes need
to be organized. It is API which needs to define how implementation
goes, not the other way around.

Thanks Bastien and Ivan for the investigation!
2020-10-12 15:12:17 +02:00
86138d88f6 Revert "Fix critical lens distortion bug in libmv after rB3a7d62cd1f5e."
This reverts commit 7e836bde11.

Reverting the incomplete workaround, due to the following reasoning:

- There should be no dependency between CameraIntrinsics and the bundler
  code. This violates intended abstraction of the intrinsics class.

- The fix was not complete, or wrong. Even in the world where there is
  a requirement to the parameters storage size this should have applied
  to all distortion models, including Divisions, Nuke.

Proper fix will be committed next.
2020-10-12 15:12:17 +02:00
df5b65811e Libmv: Fix memory leak in modal solver
The leak was happening when problem did not have any parameters blocks
defined. This happens, for example, if there are no 3D points at all,
or when all markers are set to 0 weight.

Was noticeable in libmv_modal_solver_test when building with LSAN
enabled.
2020-10-12 15:12:17 +02:00
590220e451 Libmv: Cleanup, spelling in function name
Is a local function, not affecting API.
2020-10-12 15:12:17 +02:00
db8a856a74 BLI: support looking up a key from a set or adding it when not existant 2020-10-12 15:10:08 +02:00
662c0ac970 Overlay: Fix Line antialiasing broken for some objects
Fix regression introduced in rBe12767a0352a9e113892b4a07c6c8446d3ff361f

The volumes are not a line type and should not be render into the line
framebuffer nor it should change the framebuffer.
2020-10-12 15:04:28 +02:00
60ba69ffb5 Cleanup: use openvdb matrices properly
Before I was double confused about how openvdb stores its
transformation matrices. Now, I know they have the same layout
physically in memory, but are logically transposed (i.e. the translation
is in the last row instead of in the last column).
2020-10-12 14:24:30 +02:00
e3ad392b98 Animation: always try to match the existing curve when inserting keys
Previously Blender would only match the existing curve slope when the
to-be-inserted key value was already very close to the curve. This check
is now removed, allowing for sliders in the graph editor to subtly
change the curve, and for keyframes added with ctrl+click to follow the
curve better.
2020-10-12 14:02:18 +02:00
aafd71a8a1 Fix T81060: CustomData Correction sometimes breaks UVs and Vertex Colors
`CustomData_bmesh_interp` use the same CustomData decryptor (in this case, `bm->ldata`) in both blocks.

So make sure that all CustomData layers match.

This commit also removes redundant `BM_elem_attrs_copy_ex` calls.

Maniphest Tasks: T81060

Differential Revision: https://developer.blender.org/D9159
2020-10-12 08:57:43 -03:00
ab65fe5a2d Fluid: Use hidden symbol visibility
This resolves a long list of linker warnings that is currently only showing up on macOS arm builds.
The warnings themselves are of this shape (one example):

```
ld: warning: direct access in function 'Manta::MeshDataImpl<Manta::Vector3D<float> >::_W_39(_object, object, object*)' from file '../../lib/libextern_mantaflow.a(mesh.h.reg.cpp.o)' to global weak symbol 'typeinfo for Manta::MeshDataImpl<Manta::Vector3D<float> >' from file '../../lib/libextern_mantaflow.a(mesh.cpp.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
```

Just would like to get your opinion to make sure this is an acceptable way to handle this on all platforms.

Reviewed By: LazyDodo

Differential Revision: https://developer.blender.org/D9002
2020-10-12 12:45:11 +02:00
e8d02359cf Volumes: reduce step and default of strength in Volume Displace modifier
The strength has a high impact on performance. With the previous
step and default one could easily and accidentally make Blender unusably
slow, because of a too high displacement strength.
2020-10-12 12:38:03 +02:00
fc5c5f0636 Animation: avoid WM notification when nothing changed
Avoid WM notification when a dummy channel is clicked in the animation
channel list (dopesheet, graph editor) if that channel has no animation
data.
2020-10-12 12:36:46 +02:00
1db26e1698 Cleanup: Animation, small cleanups on anim channel selection code
Clean up some code by using early returns.

No functional changes.
2020-10-12 12:36:46 +02:00
bfd7840358 Cleanup: Animation, split mouse_anim_channels() into separate functions
Clean up the code that handles mouse clicks on animation channels in the
non-NLA animation editors, by splitting into separate functions.

No functional changes.
2020-10-12 12:36:46 +02:00
7ae78733ef Volumes: use bounding box diagonal to compute adaptive voxel size
Using the diagonal has the benefit, that the adaptive voxel size changes
when the bounding box changes its shape in any way. Having a changing
voxel size looks bad when rendering an animation, therefore one should
usually use a fixed voxel size when rendering an animated volume.
This becomes apparent earlier, when the adaptive voxel size changes
when the bounding box changes in any way.
Otherwise this can easily go unnoticed when rendering only a few frames
of an animated volume.
2020-10-12 12:13:09 +02:00
cf778a9e42 Pydoc: BGL: update links 2020-10-11 20:14:16 -04:00
df3d124e91 Pydoc: Fix bpy.utils submodule showing in main toctree 2020-10-11 18:38:55 -04:00
72335d5e89 Pydoc: Move builtin GPU shader information to code
This fixes a compile warning for sphinx.
This commit includes some reformating of the information.
2020-10-11 18:21:28 -04:00
1b575cbb75 Cleanup: Pydoc strings 2020-10-11 18:19:42 -04:00
e8a2931299 Pydoc: Cleanup: Rename function
The new name makes more sense as the file is called index and we are not 
writing the contents of all rst files
2020-10-11 17:02:41 -04:00
a38c2dcfe6 Pydoc: Add index and genindex to main index 2020-10-11 16:54:52 -04:00
c95ab2c6f0 Pydoc: Remove old note about new module in 2.65 2020-10-11 16:46:21 -04:00
fbcb26fb33 Pydoc: Add submodule heading to submodule lists 2020-10-11 16:09:42 -04:00
c9a9b03204 Pydoc: Fix duplicate totree for freestyle 2020-10-11 15:50:24 -04:00
a0886d1b6e Cleanup: make format 2020-10-11 13:00:49 -04:00
1b04eb6c44 Exact Boolean: let Collection be empty.
With an empty collection, Exact Boolean performs the useful function
of removing self-intersections.
2020-10-10 12:05:09 -04:00
c68338ee89 CMake/macOS/OpenMP: copy the library near tests.
For multi-config generators, tests are in `bin/tests/<config>` folder.
and OpenMP cannot be found at `@executable_path/../Resources/lib`.
So create that folder and put the library there to be used by tests.

It is not ideal to copy the library around. When minimum CMake version
is changed to 3.12, FindOpenMP by CMake can be used for this whole
block of code. Then a nice rpath based solution can be used.
2020-10-10 19:31:03 +05:30
4427a67c86 Cleanup: use macro for comparing file versions
Already done in most of the versioning code.
2020-10-10 22:43:11 +11:00
5336555c31 Cleanup: spelling 2020-10-10 22:04:51 +11:00
d9a43a107f Cleanup: remove unused Modifier stackindex struct member 2020-10-10 22:04:51 +11:00
3fe98a473c Cleanup: remove unnecessary comments 2020-10-10 22:04:51 +11:00
2abfcebb0e Cleanup: use C comments for descriptive text
Follow our code style guide by using C-comments for text descriptions.
2020-10-10 22:04:51 +11:00
c735aca42e CMake/macOS/OpenMP: allow use of LLVM-Clang with OpenMP.
The "Apple" part is guaranteed by the platform file.
"Clang" is enough to differentiate it from other compilers.

Came across this due to the custom built LLVM toolchain I'm using.
2020-10-10 16:28:42 +05:30
7ab8d7c939 Cleanup: Declare variables where initialized 2020-10-09 16:39:39 -05:00
c1394c89a7 UI: Fix incorrect inactive status for curve properties
The "Geometry start & End" panel was grayed when using an object
to create the curve bevel. It should only be grayed out in this case
when no object is chosen in the "Bevel" subpanel.
2020-10-09 16:26:28 -05:00
89491d67d9 Fix T81545: Moving nested collections changes view layer flags
The code that restored collection flags after they are rebuilt when
moving a collection didn't take into account collection children. The
flag for the active collection was properly restored, but all of its
children would take on the exclude flag of the collection the active
collection was dragged into.

This commit builds a temporary tree structure to store the flags for
the moving collection and its children. Then it reapplies these flags
after `BKE_main_collection_sync`.

Differential Revision: https://developer.blender.org/D9158
2020-10-09 16:00:12 -05:00
4173877e87 Cleanup: Declare variables where initialized
Also use LISTBASE_FOREACH macro in a few places.
2020-10-09 15:08:01 -05:00
e6d1c8272e Cleanup: Use LISTBASE_FOREACH macro 2020-10-09 13:51:13 -05:00
32d4623f44 Cleanup: alias: use const, remove unused variable.
`targetIsDirectory` slipped through the code review of
{D6679}/{rBafb1a64ccb81}.
`BLI_is_dir` exists to check for directory status of a file.

Remove some `else-after-return`s.

Use `r_` prefix for return value arguments, and move it to the end
in the list of arguments.
2020-10-09 22:46:39 +05:30
62f5232f37 Fix T81573: Users refcount not incremented when creating a proxy.
Proxies are refcounting usages of objects, historical code was
apparently missing that.
2020-10-09 17:52:49 +02:00
50ffcf12b2 Cleanup: CMake/macOS: remove boost from OIIO libs.
Introduced by me in {rB1f6b7387ad0177c1dec9bb83b7}.
2020-10-09 20:39:58 +05:30
e340f943f5 Fix (unreported) install_deps: broken compilation of OIDN.
When OIDN version was bumped recently the required dependency to build
it (ISPC) was not updated accordingly.
2020-10-09 17:07:16 +02:00
Andreas Bergmeier
9aef0283a0 install_deps: Do not request elevated rights when creating directory in owned directory.
This only creates elevated directory when necessary.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D1596
2020-10-09 17:05:03 +02:00
2d94b0d6b0 GPU: Add more safeguard for BGL calls
This makes sure no BGL call before window drawing locks the GPUState.
2020-10-09 17:00:10 +02:00
16ca295278 Fix New Boolean bug that left some stray vertices.
The routine to find dissolvable vertices had a check to ensure
that the vertex was exactly in line with the two neighbors.
I have convinced myself that this check is unneccesary (it was
failing with only a 1e-9 difference from 0 on a cross check),
so have removed it.
2020-10-09 10:43:07 -04:00
14c53c5018 BGL: fix issues with addons using BGL at startup
This was an issue for Cycles.

This also makes the `GPU_bgl*` functions less fragile by checking for
null pointers.
2020-10-09 16:33:59 +02:00
d39043b5ae Revert "Revert "BGL: Workaround broken bgl usage caused by GPU refactor""
This reverts commit f23bf4cb10.
2020-10-09 16:33:59 +02:00
1f6b7387ad CMake/macOS: Remove _LIBPATH, avoid link_directories.
After tests were bundled in a single executable and cycles and libmv
created their own tests, the warnings on macOS have gone over 800.
The reason is setting `*_LIBRARIES` to names of the libraries
and later using `link_directories` to link them properly.

https://cmake.org/cmake/help/latest/command/link_directories.html

> Note This command is rarely necessary and should be avoided where
> there are other choices. Prefer to pass full absolute paths to
> libraries where possible, since this ensures the correct library
> will always be linked. The find_library() command provides the
> full path, which can generally be used directly in calls to
> target_link_libraries().

Warnings like the following popup for every target/executable,
for every library it links to.
```
ld: warning: directory not found for option
'-L/Users/me/blender-build/blender/../lib/darwin/jpeg/lib/Debug'
```

The patch completes a step towards removing `link_directories` as
mentioned in TODO at several places.
The patch uses absolute paths to link libraries and removes
all `*_LIBPATH`s except `PYTHON_LIBPATH` from
`platform_apple.cmake` file. (The corner case where it's used seems
like dead code. Python is no longer shipped with that file structure.)

Also, unused code for LLVM-3.4 has been removed.
Also, guards to avoid searching libraries in system directories have
been added.

`APPLE` platform now no longer needs `setup_libdirs`,
`cycles_link_directories`, and `link_directories`.
The number of warnings now is less than 100, most of them being
deprecation ones in dependencies.

This patch depended on {rBb746179d0add}, {rB2fdbe4d05011},
{rB402a4cadba49} and {rBd7f482f88ecb}.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8855
2020-10-09 19:41:58 +05:30
83e91485d0 GPU: Fix NOT ~ operator for eGPUSamplerState
The real maximum was `GPU_SAMPLER_ICON`, not `GPU_SAMPLER_REPEAT`, my
bad. {rBa31a87f8943aa40}

Move `GPU_SAMPLER_MAX` out of the enum since it's used as an `int`
at many places.
Also, the macro `ENUM_OPERATORS` needs a maximum, and this enumerator
cannot be used as the argument of that macro. It creates wrong values
in the `~` NOT operator.

Thanks @deadpin for catching this.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D9157
2020-10-09 17:35:23 +05:30
701fc52cc6 Volumes: lower minimal voxel size in Mesh to Volume modifier
The 0.1 limit was too large. The issue with making it smaller is that
one can easily crash blender by making it to small. To counteract this,
the step has been reduced as well.

A voxel size/amount of 0 disables the modifier.
2020-10-09 12:55:13 +02:00
2f339eb745 BKE: improve calculating edges
This is a follow up commit for rB309c919ee9.
Clearing hash tables is now parallelized as well. Surprisingly, most of
the time is actually spent in `free` (a couple of milliseconds per call
in my test).

Benchmark of individual functions:
reserve_hash_maps: 17%
add_polygon_edges_to_hash_maps: 49%
serialize_and_initialize_deduplicated_edges: 12%
update_edge_indices_in_poly_loops: 14%
clear_hash_tables: 5%
2020-10-09 12:37:42 +02:00
309c919ee9 BKE: parallelize BKE_mesh_calc_edges
`BKE_mesh_calc_edges` was the main performance bottleneck in D9141.
While openvdb only needed ~115ms, calculating the edges afterwards
took ~960ms. Now with some parallelization this is reduced to ~210ms.

Parallelizing `BKE_mesh_calc_edges` is not entirely trivial, because it
has to perform deduplication and some other things that have to happen
in a certain order. Even though the multithreading improves performance
with more threads, there are diminishing returns when too many threads
are used in this function.

The speedup is mainly achieved by having multiple hash tables that are
filled in parallel. The distribution of the edges to hash tables is based on
a hash (that is different from the hash used in the actual hash tables).

I moved the function to C++, because that made it easier for me to
optimize it. Furthermore, I added `BLI_task.hh` which contains some
light tbb wrappers for parallelization.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D9151
2020-10-09 11:56:12 +02:00
963b45f574 Fix T81468: Missing NULL check for F-curve rna_path in versionning code. 2020-10-09 09:47:40 +02:00
Yevgeny Makarov
07bd16de5b UI: Fix node label overflow on high-DPI
Ref D9099
2020-10-09 18:20:50 +11:00
Andreas Bergmeier
2a39b6d4d1 Cleanup: spelling
Ref D9138
2020-10-09 18:08:38 +11:00
774905f7e8 CleanUp: Introduce eMeshBatchDirtyMode enum
It used to be an int mode.
2020-10-09 07:27:18 +02:00
048c5580c2 Revert "CleanUp: Introduce eMeshBatchDirtyMode enum"
This reverts commit 0796807720.
2020-10-09 07:25:43 +02:00
Yevgeny Makarov
b96f1f8091 UI: use Ctrl-TrackPad to cycle values
Minor change missing from 9bfea67751

Ref D8530
2020-10-09 14:04:34 +11:00
f735491b9f PyDoc: Set max width to 1000px
While not full width this gives a nice trade off between improved screen 
use space and readibility.
The old value was 80 so this gives 25% more screen space.

See T73223
2020-10-08 21:37:28 -04:00
decb3b10aa Cleanup: operator execution types didn't read well on one line 2020-10-09 12:14:22 +11:00
afc090f339 Cleanup: spelling 2020-10-09 12:12:29 +11:00
05710171cb PyDoc: resolve duplicate module warnings
Remove submodule listings from the module docstring,
as this information already exists in the generator.
2020-10-09 12:11:00 +11:00
c69df6728a Cleanup: use real-module for 'bmesh.ops'
Replace module-like object with Python module,
this simplifies checks for generating API docs and is more correct.
2020-10-09 12:11:00 +11:00
2d5e38d4ec Cycles: fix incorrect default value for node array socket type 2020-10-09 00:15:24 +02:00
70634ba438 Cycles: fix incorrect asserts in node socket set functions 2020-10-09 00:15:24 +02:00
3fae33b22c Fix broken compilation after adding particles DNA defaults.
Was failing because of a mismatch between RNA and DNA defaults on
`courant_target` property, removed RNA one (DNA came from initial value
defined in BKE's particle creation code, think it's best to keep that
one).
2020-10-08 23:10:36 +02:00
Yevgeny Makarov
3d4231babf UI: Fix opacity of the popover arrow outline
Due to the old AA method, it was necessary to add transparency to the
outline of the popover arrow to match the box outline opacity. This is
no longer required after rB15dda0115c78.

See the differential for before and after screenshots.

Differential Revision: https://developer.blender.org/D9026
2020-10-08 14:25:22 -05:00
e90638b911 Fix T80974 GPU: Wide Line emulation shader does not always works
This was caused by points well behind the near clip making the
computation of the width wrong.

The fix is to clip the line to the near clip plane.
2020-10-08 21:12:29 +02:00
a31a87f894 T81340: UBSan: load of value .. not valid for GPU enum type
The underlying type of the enum cannot be fixed here due to its usage
in C code.

All the values possible in the width of the underlying type are not
valid for an enum.
Only 0 to (2*max - 1) if all enumerators are unsigned.
So the macro asks for the biggest value among the //listed// ones.
If any enumerator C is set to say `A|B`, then C would be the maximum.
(2*max-1) is used as the mask.

The warnings (for each enum modified in this commit):
GPU_vertex_buffer.h:43:1: runtime error: load of value 4294967291
which is not a valid value for type 'GPUVertBufStatus'

https://github.com/llvm/llvm-project/commit/1c2c9867

Ref T81340

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D9067
2020-10-08 23:14:25 +05:30
569510d704 Fix T81529: Can't move with constraint to a zero-size local axis
To fix the problem, it was necessary to create a fallback for the
zero-sized axis in local orientation.

This also affects the gizmos.
2020-10-08 13:39:41 -03:00
ea5f2f88b3 Cleanup: Move transform_orientations functions to separate header
Improves the organization and identification of the API.
2020-10-08 13:39:41 -03:00
dba0b84359 Cleanup: Simplify transform_orientation_matrix_get
This simplifies obtaining the parameters for internal functions.
(switch was complicating a little)

Also removes ureachable code.
2020-10-08 13:39:41 -03:00
043ddcf3ad Cleanup: Simplify use of 'Snapping Gears'
This commit removes `t->snap[0]` and `t->snap_spatial[0]`.

They were not actually being used, and could add overhead for
transformation without snap.
2020-10-08 13:39:41 -03:00
196d6166e5 Refactor CustomData interpolation code.
- Move some security checks outside of `interp` callbacks.
  Namely, that we do get interpolation weights, and have something to
  interpolate.
  Some callbacks where not checking on those anyway, safer to move that
  up into calling code.

- Cleanup usage of sub-weights, lots of interpolation callbacks wher
  actually using those completely wrong.

- Change default behavior when no weights are given to higher-level API
  functions: prevriously, each callback was responsible to handle that
  case (and one did not even do it!), they were switching to purely
  additive behavior then.
  Instead, we now default to expected simple average of source values.

Note that the only real important change here is defaulting to actual
average of source value when no inertpolation weights are given (afaik,
this only happens in Weld modifier code).

Differential Revision: https://developer.blender.org/D9114
2020-10-08 18:19:24 +02:00
cac0e78aff Cleanup/refactor: move init of ParticleSettings to proper place. 2020-10-08 18:19:09 +02:00
d6f409b862 Add DNA defaults for ParticleSettings. 2020-10-08 18:19:09 +02:00
51e43f27fa DNA: cleanup endian switching when loading file
This patch "modernizes" `DNA_struct_switch_endian` similar to
how I updated `DNA_struct_reconstruct` recently. Furthermore,
some special case handling have been moved to another place.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D9089
2020-10-08 18:17:12 +02:00
f23bf4cb10 Revert "BGL: Workaround broken bgl usage caused by GPU refactor"
This reverts commit f12b0373f3.
2020-10-08 17:58:38 +02:00
Rahul Chaudhary
479dc766b5 UI: Add icons for new sculpt trim tools
This patch adds missing icons for the new trim tools in sculpt mode.
Although these tools recently got "add geometry" modes, it's more
essential to highlight the most important feature of the tool,
trimming, than to try to portray everything they can do.

Differential Revision: https://developer.blender.org/D8963
2020-10-08 10:37:46 -05:00
8f798afbdd Cleanup/refactor: move init of MovieClip to proper place. 2020-10-08 17:19:05 +02:00
d3ba60b132 Add DNA defaults for MovieClip. 2020-10-08 17:19:05 +02:00
Rahul Chaudhary
0eb9027987 UI: Add icons for new face set tools
This patch adds missing icons for the new sculpt face set tools, and
updates the mask icons to be more consistent with the changes.

Currently draw face sets and draw mask icons are inconsistent and don't
relate to drawing/painting masks or face sets. This commit makes the
icons consistent and reusable for future tools like sculpt vertex
colors.

Differential Revision: https://developer.blender.org/D8875
2020-10-08 09:50:03 -05:00
f12b0373f3 BGL: Workaround broken bgl usage caused by GPU refactor
This directly adress the issues caused by rB536c2e0ec916.

Since the state tracking is done at a lower level, using the bgl
functions needs to be safegarded by the state manager.
The current workaround is to bypass `apply_state` when inside a
callback that used a `bgl` function.

Related to T80730.

This fix T81003.

Also this fix the default blend equation for callbacks.
Fixes T80169 T81289.
2020-10-08 16:36:17 +02:00
5f364216ac Cleanup/Refactor: Shapekey: Get rid of BKE_key_copy_nolib()
Once again, no behavioral change expected here.
2020-10-08 16:25:34 +02:00
d7f482f88e CMake/macOS: Avoid passing compiler flags to try_compile.
`APPLE` platform handles ASan compiler and linker flags using
`add_compile_options` and `add_link_options`. {rB74bcb32c9f02}

Arguments in `CMAKE_{LANG}_FLAGS{_CONFIG}` are also passed to
`try_compile` which will fail due to linker errors, since link flags
are not set. `try_compile` is used by `find_package(Boost)` for
`thread` library.

See CMP0066 [1] also.

[1] https://cmake.org/cmake/help/latest/policy/CMP0066.html

Ref D8855
2020-10-08 19:50:43 +05:30
4ee1332bdf Fix T79615: UI: icons and widget emboss look different from earlier versions
Both the default theme and Blender Light have been updated.

Blender Light also includes automatically generated colors based on the
default theme that were not set previously.
2020-10-08 16:17:31 +02:00
70a8498cec Cleanup/refactor: move init of Collection to proper place. 2020-10-08 16:11:56 +02:00
e900f6ed14 Add DNA defaults for Collection. 2020-10-08 16:11:38 +02:00
ef0ef8bcff Hair: Remove warning about undo when Delete Edit
Deleting the particle editmode is fully supported by undo now.
No need to warn the user about that anymore.
2020-10-08 15:00:35 +02:00
b46e828b0c Cleanup/refactor: move default init of armature to proper place. 2020-10-08 13:23:30 +02:00
cbbdfe24af Armature: Add minimal DNA defaults for bArmature.
Using mainly values used in `BKE_armature_add()`.
2020-10-08 13:23:30 +02:00
Andreas Bergmeier
c290e4cbe6 Cleanup: remove unnecessary includes
Differential Revision: https://developer.blender.org/D9148
2020-10-08 12:55:52 +02:00
1cf5ce5e25 Cleanup/refactor: BKE_libblock_alloc -> BKE_id_new in ID creation code.
Better use higher-level code from common ID management when possible.
Helps to de-duplicate logic, and reduces outside usages of more
'dangerous' functions.

Note that we could get rid of many of those `BKE_<id_type>_add`
functions now, but on the other hand several of those take extra
parameters and perform additional actions, so think we can keep them all
for now as 'non-standard ID specific creation functions'.
2020-10-08 12:50:04 +02:00
df5fe9718b Cleanup: Remove BKE_mask_copy_nolib() and BKE_mask_free().
Generic ID management code can now do those local temp copy handling, so
no need for duplicated own code for that.

No behavioral changes expected here.
2020-10-08 11:40:55 +02:00
fdb2240e4d Fluid: Fix particle helper grid export
Only export helper levelset and velocity (belonging to previous state) at the beginning of an (adaptive) frame.
2020-10-08 10:25:32 +02:00
e1900ddcfa Cleanup: use '_' prefix for internal bpy.ops variables
Even though these weren't included in __dir__, they are still accessible
from `vars(bpy.ops)`, use '_' to hint they are private.
2020-10-08 17:55:17 +11:00
79840abf6d PyAPI: use real modules for bpy.ops
Python 3.7x added support for module `__getattr__` & `__dir__`.

Make use of this for operator access,
previously these were module like classes.

No functional changes, this is mostly to use a type which is expected,
rather than faking the type with a class instance.
2020-10-08 17:45:50 +11:00
fb20efae59 PyDoc: fix most of the sphinx-build warnings
Use `.. currentmodule::` instead of `.. module::` for `bpy.types` and
`bpy.ops`. This change fixes most of the errors.

Ref D9139
2020-10-08 16:27:42 +11:00
d37fccab26 Cycles: fix UpdateTimeStats::clear() not resetting total times to zero 2020-10-08 06:41:33 +02:00
0b4aeffda9 PyDoc: support building without sphinx_rtd_theme
This is no longer bundled with sphinx, support building without it.
2020-10-08 12:32:50 +11:00
9c8334acc1 UI: Fix alignment in object type visibility popover
After rBeb911610d05 there are some differences in how the layout code
decides whether to add decorators (aka animation buttons). Whether or
not that logic is correct, it's nice to specify that we don't want them
turned on in this popover.
2020-10-07 19:48:45 -05:00
05d637280c Fix recent update to sphinx_doc_gen.sh
2f1a0f6f0e copied Makefile syntax into a
shell script. Use sphinx-builds 'auto' command to set the number of
jobs to run.
2020-10-08 11:08:36 +11:00
168ab643a5 Cleanup: use doxy sections for fmodifier.c 2020-10-08 10:53:05 +11:00
d8fcd8a316 Fix sculpt raycast function returning wrong value
When sampled normals were disabled SCULPT_cursor_geometry_info_update
was returning false instead of the value from the raycast data.
2020-10-07 23:43:40 +02:00
c4a281e801 PyDoc: Use explicit class names to refence class
This fixes the link and makes it more clear which class the note is 
talking about
2020-10-07 17:25:19 -04:00
d88da4db67 PyDoc: Render in text class name using class link syntax 2020-10-07 17:00:57 -04:00
b8f25dd698 PyDoc: Fix typo in extern audaspace documentation
A PR has also been sent upstream:
https://github.com/neXyon/audaspace/pull/33
2020-10-07 16:17:22 -04:00
021b94f27c PyDoc: Fix sphinx warnign from missing newline 2020-10-07 15:51:29 -04:00
3c045923a2 Cleanup: Remove redundant if-condition 2020-10-07 15:38:20 -03:00
833066088e Fix T81480: Input 0 to scale in redo panel resets to 1
Checking if `t->values[i] != 0.0f;` is not the best solution for all
transform cases.
2020-10-07 14:31:25 -03:00
fec5c12ac8 Cleanup: inconsistent parameter name
Found by clang-tidy.
2020-10-07 18:13:14 +02:00
253dbe71dc Refactor: remove BKE_<id_type>_copy functions.
Those were only shallow wrappers around `BKE_id_copy`, barely used (even
fully unused in some cases), and we want to get rid of those ID-specific
helpers for the common ID management tasks. Also prevents weird custom
behaviors (like `BKE_object_copy`, who was the only basic ID copy
function to reset user count of the new copy to zero).

Part of 71219.
2020-10-07 18:05:06 +02:00
03ef0cfe3c Refactor BKE_id_copy to return the new ID pointer.
No reasons to keep the new ID pointer as parameter here.

Part of T71219.
2020-10-07 18:05:06 +02:00
7c9131d11e Refactor BKE_id_copy_ex to return the new ID pointer.
Note that possibility to pass the new ID pointer as parameter was kept,
as this is needed for some rather specific cases (like in depsgraph/COW,
when copying into already allocated memory).

Part of T71219.
2020-10-07 18:05:06 +02:00
1f50beb9f2 Volumes: new Volume Displace modifier
This modifier uses a 3D texture to displace a volume.
For now, this can only use the previously existing texture system,
because we do not have a better alternative yet. Still, the results
can be quite good and interesting. See D9075 for some examples.

Reviewers: brecht, simonthommes

Differential Revision: https://developer.blender.org/D9075
2020-10-07 18:04:19 +02:00
b8638b6491 UI: Fix Incorrect Workspace Tab Sizing
Changes Workspace tabs so that the text size and tab width are both set by style.widget.points.

Differential Revision: https://developer.blender.org/D9108

Reviewed by Julian Eisel
2020-10-07 08:59:13 -07:00
5e2a60a003 Fix T81171: Show Alerts at Center in Statusbar
Move position of Alerts and Progress bar back to the center of the Statusbar.

Differential Revision: https://developer.blender.org/D9118

Reviewed by Brecht Van Lommel
2020-10-07 08:41:44 -07:00
Jeroen Bakker
7c373555fd Fix T81254: Incorrect calculation of EEVEE Transmittance Volumetrics
Regular rendering uses a custom blend mode, but render passes renders to
2 separate textures. This wasn't configured correctly inside the
fragment shaders. This patch adds a switch to configure the fragment
shader with the correct attachments.

Backport to Blender 2.83.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9038
2020-10-07 17:26:37 +02:00
Jeroen Bakker
afab33e0b9 UV/Image Editor: Overlay Popover
The overlay options in the image/uv editor is hidden in side panels and menus. Sometimes this panel is even hidden, while still useful.
The goal of this task is to introduce an overlay pop-over just like the overlay-popover of the 3d viewport.

Popover has
* UV Stretching (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode)
* Display As (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode)
* Show Modified (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode)
* Show UV Edges (including opacity slider; available UV, View, Paint, when active object mode is a mesh and in OB_EDIT mode)
* Udim tiles when no image is available.

Like the 3d viewport, there will be a editor toggle to enable/disable the overlays

For compatibility reasons the RNA properties are added to both the `SpaceImage.uv_editor` amd `SpaceImage.overlay`. On DNA level they are still stored in the SpaceImage. only new properties are added to the SpaceImageOverlay struct. During the next major release we could remove these options from `SpaceImage.uv_editor`. This should be noted in the Python section of release notes.

Reviewed By: Julian Eisel, Pablo Vazquez

Differential Revision: https://developer.blender.org/D8890
2020-10-07 17:15:17 +02:00
fc767502dc Python API: add volume.grids.save(filepath) to save grids and metadata to disk
Particularly useful now that we can dynamically generate volume using
modifiers. Not exposed in the user interface currently, but it can be used
by add-ons that need to export an entire scene including volumes.
2020-10-07 17:11:09 +02:00
0ea4aab55e Fix T81490: GPencil merge layer duplicated all strokes
There was a wrong duplication of all strokes and this accumulated all previous data for each frame.

Also a cleanup has been done in order to clarify what means each variable.
2020-10-07 17:09:53 +02:00
1027 changed files with 15698 additions and 16859 deletions

View File

@@ -18,6 +18,8 @@ Checks: >
-readability-redundant-member-init,
-readability-use-anyofallof,
-readability-function-cognitive-complexity,
bugprone-*,
-bugprone-narrowing-conversions,
-bugprone-unhandled-self-assignment,
@@ -28,4 +30,7 @@ Checks: >
-bugprone-sizeof-expression,
-bugprone-integer-division,
-bugprone-exception-escape,
-bugprone-redundant-branch-condition,
WarningsAsErrors: '*'

View File

@@ -43,8 +43,8 @@ endif()
cmake_minimum_required(VERSION 3.10)
# Prever LEGACY OpenGL to eb compatible with all the existing releases and
# platforms which don't hare GLVND yet. Only do it if preference was not set
# Prefer LEGACY OpenGL to be compatible with all the existing releases and
# platforms which don't have GLVND yet. Only do it if preference was not set
# externally.
if(NOT DEFINED OpenGL_GL_PREFERENCE)
set(OpenGL_GL_PREFERENCE "LEGACY")
@@ -377,7 +377,7 @@ option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF)
option(WITH_CYCLES_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF)
mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL)
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 compute_75 CACHE STRING "CUDA architectures to build binaries for")
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 sm_86 compute_75 CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
unset(PLATFORM_DEFAULT)
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
@@ -853,11 +853,17 @@ set(PLATFORM_LINKFLAGS_DEBUG "")
if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
if(WITH_COMPILER_ASAN)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}")
if(NOT APPLE)
# Avoid passing address sanitizer compiler flags to `try_compile`.
# Since linker flags are not set, all compiler checks and `find_package`
# calls that rely on `try_compile` will fail.
# See CMP0066 also.
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
endif()
if(MSVC)
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
endif()

View File

@@ -89,7 +89,7 @@ Spell Checkers
* check_spelling_osl: Check for spelling errors (OSL only).
* check_spelling_py: Check for spelling errors (Python only).
Note that spell checkers can tak a 'CHECK_SPELLING_CACHE' filepath argument,
Note that spell checkers can take a 'CHECK_SPELLING_CACHE' filepath argument,
so re-running does not need to re-check unchanged files.
Example:

View File

@@ -20,7 +20,7 @@ set(GMP_EXTRA_ARGS -enable-cxx)
if(WIN32)
# Shared for windows because static libs will drag in a libgcc dependency.
set(GMP_OPTIONS --disable-static --enable-shared --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32)
set(GMP_OPTIONS --disable-static --enable-shared --enable-fat --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32)
else()
set(GMP_OPTIONS --enable-static --disable-shared )
endif()
@@ -41,6 +41,7 @@ elseif(UNIX)
set(GMP_OPTIONS
${GMP_OPTIONS}
--with-pic
--enable-fat
)
endif()

View File

@@ -520,7 +520,7 @@ OIDN_FORCE_BUILD=false
OIDN_FORCE_REBUILD=false
OIDN_SKIP=false
ISPC_VERSION="1.14.0"
ISPC_VERSION="1.14.1"
FFMPEG_VERSION="4.2.3"
FFMPEG_VERSION_SHORT="4.2"
@@ -1259,13 +1259,16 @@ version_match() {
# ----------------------------------------------------------------------------
# Generic compile helpers
prepare_opt() {
prepare_inst() {
INFO "Ensuring $INST exists and is writable by us"
if [ ! $SUDO ]; then
WARNING "--no-sudo enabled, might be impossible to create install dir..."
fi
if [ ! -d $INST ]; then
$SUDO mkdir -p $INST
# Try to create normal user directory first to possibly avoid excessive
# system operations
mkdir -p $INST || $SUDO mkdir -p $INST
fi
if [ ! -w $INST ]; then
@@ -1366,7 +1369,7 @@ compile_Python() {
# Rebuild dependencies as well!
_update_deps_python
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
mkdir -p $SRC
@@ -1452,7 +1455,7 @@ compile_Numpy() {
# Rebuild dependencies as well!
_update_deps_numpy
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
mkdir -p $SRC
@@ -1541,7 +1544,7 @@ compile_Boost() {
# Rebuild dependencies as well!
_update_deps_boost
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
INFO "Downloading Boost-$BOOST_VERSION"
@@ -1635,7 +1638,7 @@ compile_TBB() {
# Rebuild dependencies as well!
_update_deps_tbb
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
INFO "Downloading TBB-$TBB_VERSION$TBB_VERSION_UPDATE"
@@ -1752,7 +1755,7 @@ compile_OCIO() {
# Rebuild dependencies as well!
_update_deps_ocio
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
INFO "Downloading OpenColorIO-$OCIO_VERSION"
@@ -1884,7 +1887,7 @@ compile_OPENEXR() {
# Rebuild dependencies as well!
_update_deps_openexr
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
INFO "Downloading OpenEXR-$OPENEXR_VERSION"
@@ -2010,7 +2013,7 @@ compile_OIIO() {
# Rebuild dependencies as well!
_update_deps_oiio
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
mkdir -p $SRC
@@ -2165,7 +2168,7 @@ compile_LLVM() {
# Rebuild dependencies as well!
_update_deps_llvm
prepare_opt
prepare_inst
if [ ! -d $_src -o true ]; then
mkdir -p $SRC
@@ -2275,7 +2278,7 @@ compile_OSL() {
# Rebuild dependencies as well!
_update_deps_osl
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
mkdir -p $SRC
@@ -2419,7 +2422,7 @@ compile_OSD() {
# Rebuild dependencies as well!
_update_deps_osd
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
mkdir -p $SRC
@@ -2537,7 +2540,7 @@ compile_BLOSC() {
# Rebuild dependencies as well!
_update_deps_blosc
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
INFO "Downloading Blosc-$OPENVDB_BLOSC_VERSION"
@@ -2636,7 +2639,7 @@ compile_OPENVDB() {
# Rebuild dependencies as well!
_update_deps_openvdb
prepare_opt
prepare_inst
if [ ! -d $_src -o true ]; then
mkdir -p $SRC
@@ -2751,7 +2754,7 @@ compile_ALEMBIC() {
# Rebuild dependencies as well!
_update_deps_alembic
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
mkdir -p $SRC
@@ -2856,7 +2859,7 @@ compile_USD() {
# Rebuild dependencies as well!
_update_deps_usd
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
mkdir -p $SRC
@@ -2955,7 +2958,7 @@ compile_OpenCOLLADA() {
# Rebuild dependencies as well!
_update_deps_collada
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
mkdir -p $SRC
@@ -3061,7 +3064,7 @@ compile_Embree() {
# Rebuild dependencies as well!
_update_deps_embree
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
mkdir -p $SRC
@@ -3171,7 +3174,7 @@ install_ISPC() {
# Rebuild dependencies as well!
_update_deps_ispc
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
mkdir -p $SRC
@@ -3250,7 +3253,7 @@ compile_OIDN() {
# Rebuild dependencies as well!
_update_deps_oidn
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
mkdir -p $SRC
@@ -3360,7 +3363,7 @@ compile_FFmpeg() {
# Rebuild dependencies as well!
_update_deps_ffmpeg
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
INFO "Downloading ffmpeg-$FFMPEG_VERSION"
@@ -3489,7 +3492,7 @@ compile_XR_OpenXR_SDK() {
# Rebuild dependencies as well!
_update_deps_xr_openxr_sdk
prepare_opt
prepare_inst
if [ ! -d $_src ]; then
mkdir -p $SRC
@@ -3955,7 +3958,7 @@ install_DEB() {
if [ $? -eq 0 ]; then
install_packages_DEB llvm-dev clang
have_llvm=true
LLVM_VERSION=`get_package_version_DEB llvm-dev`
LLVM_VERSION=`llvm-config --version`
LLVM_VERSION_FOUND=$LLVM_VERSION
clean_LLVM
else
@@ -4604,7 +4607,7 @@ install_RPM() {
if [ $? -eq 0 ]; then
install_packages_RPM llvm-devel $CLANG_DEV
have_llvm=true
LLVM_VERSION=`get_package_version_RPM llvm-devel`
LLVM_VERSION=`llvm-config --version`
LLVM_VERSION_FOUND=$LLVM_VERSION
clean_LLVM
else
@@ -5126,7 +5129,7 @@ install_ARCH() {
if [ $? -eq 0 ]; then
install_packages_ARCH llvm clang
have_llvm=true
LLVM_VERSION=`get_package_version_ARCH llvm`
LLVM_VERSION=`llvm-config --version`
LLVM_VERSION_FOUND=$LLVM_VERSION
clean_LLVM
else

View File

@@ -45,6 +45,18 @@ def get_cmake_options(builder):
optix_sdk_dir = os.path.join(builder.blender_dir, '..', '..', 'NVIDIA-Optix-SDK')
options.append('-DOPTIX_ROOT_DIR:PATH=' + optix_sdk_dir)
# Workaround to build sm_30 kernels with CUDA 10, since CUDA 11 no longer supports that architecture
if builder.platform == 'win':
options.append('-DCUDA10_TOOLKIT_ROOT_DIR:PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1')
options.append('-DCUDA10_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/nvcc.exe')
options.append('-DCUDA11_TOOLKIT_ROOT_DIR:PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1')
options.append('-DCUDA11_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/bin/nvcc.exe')
elif builder.platform == 'linux':
options.append('-DCUDA10_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-10.1')
options.append('-DCUDA10_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-10.1/bin/nvcc')
options.append('-DCUDA11_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-11.1')
options.append('-DCUDA11_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-11.1/bin/nvcc')
options.append("-C" + os.path.join(builder.blender_dir, config_file))
options.append("-DCMAKE_INSTALL_PREFIX=%s" % (builder.install_dir))

View File

@@ -55,7 +55,7 @@ set(WITH_USD ON CACHE BOOL "" FORCE)
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE)
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75;compute_75 CACHE STRING "" FORCE)
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75;sm_86;compute_75 CACHE STRING "" FORCE)
set(WITH_CYCLES_DEVICE_OPTIX ON CACHE BOOL "" FORCE)
# platform dependent options

View File

@@ -302,14 +302,14 @@ function(blender_add_lib__impl
#
# What this code does it traverses library_deps and extracts information about whether
# library is to provided as general, debug or optimized. This is a little state machine which
# keeps track of whiuch build type library is to provided for:
# keeps track of which build type library is to provided for:
#
# - If "debug" or "optimized" word is found, the next element in the list is expected to be
# a library which will be passed to target_link_libraries() under corresponding build type.
#
# - If there is no "debug" or "optimized" used library is specified for all build types.
#
# NOTE: If separated libraries for debug and release ar eneeded every library is the list are
# NOTE: If separated libraries for debug and release are needed every library is the list are
# to be prefixed explicitly.
#
# Use: "optimized libfoo optimized libbar debug libfoo_d debug libbar_d"
@@ -477,8 +477,8 @@ function(SETUP_LIBDIRS)
# NOTE: For all new libraries, use absolute library paths.
# This should eventually be phased out.
if(NOT MSVC)
# APPLE plaform uses full paths for linking libraries, and avoids link_directories.
if(NOT MSVC AND NOT APPLE)
link_directories(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH})
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
@@ -1241,8 +1241,16 @@ endmacro()
macro(without_system_libs_begin)
set(CMAKE_IGNORE_PATH "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES};${CMAKE_SYSTEM_INCLUDE_PATH};${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES};${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}")
if(APPLE)
# Avoid searching for headers in frameworks (like Mono), and libraries in LIBDIR.
set(CMAKE_FIND_FRAMEWORK NEVER)
endif()
endmacro()
macro(without_system_libs_end)
unset(CMAKE_IGNORE_PATH)
if(APPLE)
# FIRST is the default.
set(CMAKE_FIND_FRAMEWORK FIRST)
endif()
endmacro()

View File

@@ -30,6 +30,36 @@ macro(find_package_wrapper)
# do nothing, just satisfy the macro
endmacro()
function(print_found_status
lib_name
lib_path
)
if(FIRST_RUN)
if(lib_path)
message(STATUS "Found ${lib_name}: ${lib_path}")
else()
message(WARNING "Could NOT find ${lib_name}")
endif()
endif()
endfunction()
# ------------------------------------------------------------------------
# Find system provided libraries.
# Find system ZLIB, not the pre-compiled one supplied with OpenCollada.
set(ZLIB_ROOT /usr)
find_package(ZLIB REQUIRED)
find_package(BZip2 REQUIRED)
list(APPEND ZLIB_LIBRARIES ${BZIP2_LIBRARIES})
if(WITH_OPENAL)
find_package(OpenAL)
if(NOT OPENAL_FOUND)
set(WITH_OPENAL OFF)
endif()
endif()
if(NOT DEFINED LIBDIR)
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin)
# Prefer lib directory paths
@@ -42,22 +72,15 @@ if(NOT EXISTS "${LIBDIR}/")
message(FATAL_ERROR "Mac OSX requires pre-compiled libs at: '${LIBDIR}'")
endif()
if(WITH_OPENAL)
find_package(OpenAL)
if(OPENAL_FOUND)
set(WITH_OPENAL ON)
else()
set(WITH_OPENAL OFF)
endif()
# -------------------------------------------------------------------------
# Find precompiled libraries, and avoid system or user-installed ones.
if(EXISTS ${LIBDIR})
without_system_libs_begin()
endif()
if(WITH_ALEMBIC)
set(ALEMBIC ${LIBDIR}/alembic)
set(ALEMBIC_INCLUDE_DIR ${ALEMBIC}/include)
set(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
set(ALEMBIC_LIBPATH ${ALEMBIC}/lib)
set(ALEMBIC_LIBRARIES Alembic)
set(ALEMBIC_FOUND ON)
find_package(Alembic)
endif()
if(WITH_USD)
@@ -68,30 +91,38 @@ if(WITH_USD)
endif()
if(WITH_OPENSUBDIV)
set(OPENSUBDIV ${LIBDIR}/opensubdiv)
set(OPENSUBDIV_LIBPATH ${OPENSUBDIV}/lib)
find_library(OSD_LIB_CPU NAMES osdCPU PATHS ${OPENSUBDIV_LIBPATH})
find_library(OSD_LIB_GPU NAMES osdGPU PATHS ${OPENSUBDIV_LIBPATH})
set(OPENSUBDIV_INCLUDE_DIR ${OPENSUBDIV}/include)
set(OPENSUBDIV_INCLUDE_DIRS ${OPENSUBDIV_INCLUDE_DIR})
list(APPEND OPENSUBDIV_LIBRARIES ${OSD_LIB_CPU} ${OSD_LIB_GPU})
find_package(OpenSubdiv)
endif()
if(WITH_JACK)
find_library(JACK_FRAMEWORK
NAMES jackmp
)
set(JACK_INCLUDE_DIRS ${JACK_FRAMEWORK}/headers)
if(NOT JACK_FRAMEWORK)
set(WITH_JACK OFF)
else()
set(JACK_INCLUDE_DIRS ${JACK_FRAMEWORK}/headers)
endif()
endif()
if(WITH_CODEC_SNDFILE)
set(LIBSNDFILE ${LIBDIR}/sndfile)
set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE}/include)
set(LIBSNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
set(LIBSNDFILE_LIBPATH ${LIBSNDFILE}/lib ${LIBDIR}/ffmpeg/lib) # TODO, deprecate
find_package(SndFile)
find_library(_sndfile_FLAC_LIBRARY NAMES flac HINTS ${LIBDIR}/sndfile/lib)
find_library(_sndfile_OGG_LIBRARY NAMES ogg HINTS ${LIBDIR}/ffmpeg/lib)
find_library(_sndfile_VORBIS_LIBRARY NAMES vorbis HINTS ${LIBDIR}/ffmpeg/lib)
find_library(_sndfile_VORBISENC_LIBRARY NAMES vorbisenc HINTS ${LIBDIR}/ffmpeg/lib)
list(APPEND LIBSNDFILE_LIBRARIES
${_sndfile_FLAC_LIBRARY}
${_sndfile_OGG_LIBRARY}
${_sndfile_VORBIS_LIBRARY}
${_sndfile_VORBISENC_LIBRARY}
)
print_found_status("SndFile libraries" "${LIBSNDFILE_LIBRARIES}")
unset(_sndfile_FLAC_LIBRARY)
unset(_sndfile_OGG_LIBRARY)
unset(_sndfile_VORBIS_LIBRARY)
unset(_sndfile_VORBISENC_LIBRARY)
endif()
if(WITH_PYTHON)
@@ -130,54 +161,27 @@ if(WITH_PYTHON)
endif()
if(WITH_FFTW3)
set(FFTW3 ${LIBDIR}/fftw3)
set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
set(FFTW3_LIBRARIES fftw3)
set(FFTW3_LIBPATH ${FFTW3}/lib)
find_package(Fftw3)
endif()
set(ZLIB /usr)
set(ZLIB_INCLUDE_DIRS "${ZLIB}/include")
set(ZLIB_LIBRARIES z bz2)
set(PNG_LIBRARIES png ${ZLIB_LIBRARIES})
set(JPEG_LIBRARIES jpeg)
set(FREETYPE ${LIBDIR}/freetype)
set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
set(FREETYPE_LIBPATH ${FREETYPE}/lib)
set(FREETYPE_LIBRARY freetype)
find_package(Freetype REQUIRED)
if(WITH_IMAGE_OPENEXR)
set(OPENEXR ${LIBDIR}/openexr)
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR}/include/OpenEXR)
set(OPENEXR_LIBRARIES
Iex
Half
IlmImf
Imath
IlmThread)
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
find_package(OpenEXR)
endif()
if(WITH_CODEC_FFMPEG)
set(FFMPEG ${LIBDIR}/ffmpeg)
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
set(FFMPEG_LIBRARIES
set(FFMPEG_FIND_COMPONENTS
avcodec avdevice avformat avutil
mp3lame swscale x264 xvidcore
theora theoradec theoraenc
vorbis vorbisenc vorbisfile ogg opus
vpx swresample)
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
mp3lame ogg opus swresample swscale
theora theoradec theoraenc vorbis vorbisenc
vorbisfile vpx x264 xvidcore)
find_package(FFmpeg)
endif()
if(WITH_IMAGE_OPENJPEG OR WITH_CODEC_FFMPEG)
# use openjpeg from libdir that is linked into ffmpeg
set(OPENJPEG ${LIBDIR}/openjpeg)
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include)
set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/libopenjp2.a)
find_package(OpenJPEG)
endif()
find_library(SYSTEMSTUBS_LIBRARY
@@ -207,77 +211,58 @@ if(WITH_PYTHON_MODULE OR WITH_PYTHON_FRAMEWORK)
endif()
if(WITH_OPENCOLLADA)
set(OPENCOLLADA ${LIBDIR}/opencollada)
set(OPENCOLLADA_INCLUDE_DIRS
${LIBDIR}/opencollada/include/COLLADAStreamWriter
${LIBDIR}/opencollada/include/COLLADABaseUtils
${LIBDIR}/opencollada/include/COLLADAFramework
${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader
${LIBDIR}/opencollada/include/GeneratedSaxParser
)
set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
set(OPENCOLLADA_LIBRARIES
OpenCOLLADASaxFrameworkLoader
-lOpenCOLLADAFramework
-lOpenCOLLADABaseUtils
-lOpenCOLLADAStreamWriter
-lMathMLSolver
-lGeneratedSaxParser
-lbuffer -lftoa -lUTF
)
# PCRE and XML2 are bundled with OpenCollada.
set(PCRE_LIBRARIES pcre)
set(XML2_LIBRARIES xml2)
find_package(OpenCOLLADA)
find_library(PCRE_LIBRARIES NAMES pcre HINTS ${LIBDIR}/opencollada/lib)
find_library(XML2_LIBRARIES NAMES xml2 HINTS ${LIBDIR}/opencollada/lib)
print_found_status("PCRE" "${PCRE_LIBRARIES}")
print_found_status("XML2" "${XML2_LIBRARIES}")
endif()
if(WITH_SDL)
set(SDL ${LIBDIR}/sdl)
set(SDL_INCLUDE_DIR ${SDL}/include)
set(SDL_LIBRARY SDL2)
set(SDL_LIBPATH ${SDL}/lib)
find_package(SDL2)
set(SDL_INCLUDE_DIR ${SDL2_INCLUDE_DIRS})
set(SDL_LIBRARY ${SDL2_LIBRARIES})
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework ForceFeedback")
endif()
set(PNG "${LIBDIR}/png")
set(PNG_INCLUDE_DIRS "${PNG}/include")
set(PNG_LIBPATH ${PNG}/lib)
set(PNG_ROOT ${LIBDIR}/png)
find_package(PNG REQUIRED)
set(JPEG "${LIBDIR}/jpeg")
set(JPEG_INCLUDE_DIR "${JPEG}/include")
set(JPEG_LIBPATH ${JPEG}/lib)
set(JPEG_ROOT ${LIBDIR}/jpeg)
find_package(JPEG REQUIRED)
if(WITH_IMAGE_TIFF)
set(TIFF ${LIBDIR}/tiff)
set(TIFF_INCLUDE_DIR ${TIFF}/include)
set(TIFF_LIBRARY tiff)
set(TIFF_LIBPATH ${TIFF}/lib)
set(TIFF_ROOT ${LIBDIR}/tiff)
find_package(TIFF)
if(NOT TIFF_FOUND)
message(WARNING "TIFF not found, disabling WITH_IMAGE_TIFF")
set(WITH_IMAGE_TIFF OFF)
endif()
endif()
if(WITH_BOOST)
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
set(BOOST_POSTFIX)
set(BOOST_LIBRARIES
boost_date_time${BOOST_POSTFIX}
boost_filesystem${BOOST_POSTFIX}
boost_regex${BOOST_POSTFIX}
boost_system${BOOST_POSTFIX}
boost_thread${BOOST_POSTFIX}
boost_wave${BOOST_POSTFIX}
)
set(Boost_NO_BOOST_CMAKE ON)
set(BOOST_ROOT ${LIBDIR}/boost)
set(Boost_NO_SYSTEM_PATHS ON)
set(_boost_FIND_COMPONENTS date_time filesystem regex system thread wave)
if(WITH_INTERNATIONAL)
list(APPEND BOOST_LIBRARIES boost_locale${BOOST_POSTFIX})
list(APPEND _boost_FIND_COMPONENTS locale)
endif()
if(WITH_CYCLES_NETWORK)
list(APPEND BOOST_LIBRARIES boost_serialization${BOOST_POSTFIX})
list(APPEND _boost_FIND_COMPONENTS serialization)
endif()
if(WITH_OPENVDB)
list(APPEND BOOST_LIBRARIES boost_iostreams${BOOST_POSTFIX})
list(APPEND _boost_FIND_COMPONENTS iostreams)
endif()
set(BOOST_LIBPATH ${BOOST}/lib)
find_package(Boost COMPONENTS ${_boost_FIND_COMPONENTS})
set(BOOST_LIBRARIES ${Boost_LIBRARIES})
set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
set(BOOST_DEFINITIONS)
mark_as_advanced(Boost_LIBRARIES)
mark_as_advanced(Boost_INCLUDE_DIRS)
unset(_boost_FIND_COMPONENTS)
endif()
if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG)
@@ -285,10 +270,8 @@ if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG)
endif()
if(WITH_OPENIMAGEIO)
set(OPENIMAGEIO ${LIBDIR}/openimageio)
set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
set(OPENIMAGEIO_LIBRARIES
${OPENIMAGEIO}/lib/libOpenImageIO.a
find_package(OpenImageIO)
list(APPEND OPENIMAGEIO_LIBRARIES
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
${TIFF_LIBRARY}
@@ -296,30 +279,19 @@ if(WITH_OPENIMAGEIO)
${OPENJPEG_LIBRARIES}
${ZLIB_LIBRARIES}
)
set(OPENIMAGEIO_LIBPATH
${OPENIMAGEIO}/lib
${JPEG_LIBPATH}
${PNG_LIBPATH}
${TIFF_LIBPATH}
${OPENEXR_LIBPATH}
${ZLIB_LIBPATH}
)
set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
set(OPENIMAGEIO_IDIFF "${LIBDIR}/openimageio/bin/idiff")
endif()
if(WITH_OPENCOLORIO)
set(OPENCOLORIO ${LIBDIR}/opencolorio)
set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
set(OPENCOLORIO_LIBRARIES OpenColorIO tinyxml yaml-cpp)
set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
find_package(OpenColorIO)
endif()
if(WITH_OPENVDB)
set(OPENVDB ${LIBDIR}/openvdb)
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include)
set(OPENVDB_LIBRARIES openvdb blosc)
set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
find_package(OpenVDB)
find_library(BLOSC_LIBRARIES NAMES blosc HINTS ${LIBDIR}/openvdb/lib)
print_found_status("Blosc" "${BLOSC_LIBRARIES}")
list(APPEND OPENVDB_LIBRARIES ${BLOSC_LIBRARIES})
set(OPENVDB_DEFINITIONS)
endif()
@@ -329,41 +301,8 @@ if(WITH_NANOVDB)
endif()
if(WITH_LLVM)
set(LLVM_ROOT_DIR ${LIBDIR}/llvm)
if(EXISTS "${LLVM_ROOT_DIR}/bin/llvm-config")
set(LLVM_CONFIG "${LLVM_ROOT_DIR}/bin/llvm-config")
else()
set(LLVM_CONFIG llvm-config)
endif()
execute_process(COMMAND ${LLVM_CONFIG} --version
OUTPUT_VARIABLE LLVM_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${LLVM_CONFIG} --prefix
OUTPUT_VARIABLE LLVM_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${LLVM_CONFIG} --includedir
OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${LLVM_CONFIG} --libdir
OUTPUT_VARIABLE LLVM_LIBPATH
OUTPUT_STRIP_TRAILING_WHITESPACE)
find_library(LLVM_LIBRARY
NAMES LLVMAnalysis # first of a whole bunch of libs to get
PATHS ${LLVM_LIBPATH})
if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
if(LLVM_STATIC)
# if static LLVM libraries were requested, use llvm-config to generate
# the list of what libraries we need, and substitute that in the right
# way for LLVM_LIBRARY.
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
OUTPUT_VARIABLE LLVM_LIBRARY
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE ".a /" ".a;/" LLVM_LIBRARY ${LLVM_LIBRARY})
else()
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
endif()
else()
find_package(LLVM)
if(NOT LLVM_FOUND)
message(FATAL_ERROR "LLVM not found.")
endif()
endif()
@@ -432,7 +371,7 @@ endif()
# CMake FindOpenMP doesn't know about AppleClang before 3.12, so provide custom flags.
if(WITH_OPENMP)
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
# Use OpenMP from our precompiled libraries.
message(STATUS "Using ${LIBDIR}/openmp for OpenMP")
set(OPENMP_CUSTOM ON)
@@ -442,14 +381,22 @@ if(WITH_OPENMP)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L'${LIBDIR}/openmp/lib' -lomp")
# Copy libomp.dylib to allow executables like datatoc and tests to work.
# `@executable_path/../Resources/lib/` is a default dylib search path.
# For single config generator datatoc, tests etc.
execute_process(
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/Resources/lib
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/Resources/lib/libomp.dylib
)
# For multi-config generator datatoc, etc.
execute_process(
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/Resources/lib
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/bin/Resources/lib/libomp.dylib
)
# For multi-config generator tests.
execute_process(
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/tests/Resources/lib
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/bin/tests/Resources/lib/libomp.dylib
)
endif()
endif()
@@ -469,6 +416,13 @@ if(WITH_GMP)
endif()
endif()
if(EXISTS ${LIBDIR})
without_system_libs_end()
endif()
# ---------------------------------------------------------------------
# Set compiler and linker flags.
set(EXETYPE MACOSX_BUNDLE)
set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")

View File

@@ -720,14 +720,24 @@ if(WINDOWS_PYTHON_DEBUG)
string(REPLACE "/" "\\" _group_path "${_source_path}")
source_group("${_group_path}" FILES "${_source}")
endforeach()
# Include the user scripts from the profile folder in the blender_python_user_scripts project.
set(USER_SCRIPTS_ROOT "$ENV{appdata}/blender foundation/blender/${BLENDER_VERSION}")
# If the user scripts env var is set, include scripts from there otherwise
# include user scripts in the profile folder.
if(DEFINED ENV{BLENDER_USER_SCRIPTS})
message(STATUS "Including user scripts from environment BLENDER_USER_SCRIPTS=$ENV{BLENDER_USER_SCRIPTS}")
set(USER_SCRIPTS_ROOT "$ENV{BLENDER_USER_SCRIPTS}")
else()
message(STATUS "Including user scripts from the profile folder")
# Include the user scripts from the profile folder in the blender_python_user_scripts project.
set(USER_SCRIPTS_ROOT "$ENV{appdata}/blender foundation/blender/${BLENDER_VERSION}/scripts")
endif()
file(TO_CMAKE_PATH ${USER_SCRIPTS_ROOT} USER_SCRIPTS_ROOT)
FILE(GLOB_RECURSE inFiles "${USER_SCRIPTS_ROOT}/scripts/*.*" )
FILE(GLOB_RECURSE inFiles "${USER_SCRIPTS_ROOT}/*.*" )
ADD_CUSTOM_TARGET(blender_python_user_scripts SOURCES ${inFiles})
foreach(_source IN ITEMS ${inFiles})
get_filename_component(_source_path "${_source}" PATH)
string(REPLACE "${USER_SCRIPTS_ROOT}/scripts" "" _source_path "${_source_path}")
string(REPLACE "${USER_SCRIPTS_ROOT}" "" _source_path "${_source_path}")
string(REPLACE "/" "\\" _group_path "${_source_path}")
source_group("${_group_path}" FILES "${_source}")
endforeach()

View File

@@ -9,15 +9,24 @@ When calling an operator you may want to pass the execution context.
This determines the context that is given for the operator to run in, and whether
invoke() is called or only execute().
'EXEC_DEFAULT' is used by default, running only the execute() method, but you may
want the operator to take user interaction with 'INVOKE_DEFAULT' which will also
``EXEC_DEFAULT`` is used by default, running only the ``execute()`` method, but you may
want the operator to take user interaction with ``INVOKE_DEFAULT`` which will also
call invoke() if existing.
The execution context is one of:
('INVOKE_DEFAULT', 'INVOKE_REGION_WIN', 'INVOKE_REGION_CHANNELS',
'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN', 'EXEC_DEFAULT',
'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIEW', 'EXEC_AREA',
'EXEC_SCREEN')
- ``INVOKE_DEFAULT``
- ``INVOKE_REGION_WIN``
- ``INVOKE_REGION_CHANNELS``
- ``INVOKE_REGION_PREVIEW``
- ``INVOKE_AREA``
- ``INVOKE_SCREEN``
- ``EXEC_DEFAULT``
- ``EXEC_REGION_WIN``
- ``EXEC_REGION_CHANNELS``
- ``EXEC_REGION_PREVIEW``
- ``EXEC_AREA``
- ``EXEC_SCREEN``
"""
# collection add popup

View File

@@ -33,11 +33,12 @@ fragment_shader = '''
uniform float u_Scale;
in float v_ArcLength;
out vec4 FragColor;
void main()
{
if (step(sin(v_ArcLength * u_Scale), 0.5) == 1) discard;
gl_FragColor = vec4(1.0);
FragColor = vec4(1.0);
}
'''

View File

@@ -23,10 +23,11 @@ fragment_shader = '''
uniform float brightness;
in vec3 pos;
out vec4 FragColor;
void main()
{
gl_FragColor = vec4(pos * brightness, 1.0);
FragColor = vec4(pos * brightness, 1.0);
}
'''

View File

@@ -56,10 +56,11 @@ fragment_shader = '''
uniform sampler2D image;
in vec2 uvInterp;
out vec4 FragColor;
void main()
{
gl_FragColor = texture(image, uvInterp);
FragColor = texture(image, uvInterp);
}
'''

View File

@@ -1,36 +0,0 @@
"""
Built-in shaders
++++++++++++++++
All built-in shaders have the ``mat4 ModelViewProjectionMatrix`` uniform.
The value of it can only be modified using the :class:`gpu.matrix` module.
2D_UNIFORM_COLOR:
attributes: vec3 pos
uniforms: vec4 color
2D_FLAT_COLOR:
attributes: vec3 pos, vec4 color
uniforms: -
2D_SMOOTH_COLOR:
attributes: vec3 pos, vec4 color
uniforms: -
2D_IMAGE:
attributes: vec3 pos, vec2 texCoord
uniforms: sampler2D image
3D_UNIFORM_COLOR:
attributes: vec3 pos
uniforms: vec4 color
3D_FLAT_COLOR:
attributes: vec3 pos, vec4 color
uniforms: -
3D_SMOOTH_COLOR:
attributes: vec3 pos, vec4 color
uniforms: -
"""

View File

@@ -13,16 +13,15 @@ than enough material to teach OpenGL programming, from books to many
collections of tutorials.
Here is a comprehensive `list of books <https://www.khronos.org/developers/books/>`__ (non free).
The `arcsynthesis tutorials <https://web.archive.org/web/20150225192611/http://www.arcsynthesis.org/gltut/index.html>`__
is one of the best resources to learn modern OpenGL and
`g-truc <http://www.g-truc.net/post-opengl-samples.html#menu>`__
offers a set of extensive examples, including advanced features.
`Learn OpenGL <https://learnopengl.com/>`__ is one of the best resources to learn modern OpenGL and
`opengl-tutorial.org <http://www.opengl-tutorial.org/>`__ offers a set of extensive examples,
including advanced features.
.. note::
You can use the :class:`Image` type to load and set textures.
See :class:`Image.gl_load` and :class:`Image.gl_free`,
You can use the :class:`bpy.types.Image` type to load and set textures.
See :class:`bpy.types.Image.gl_load` and :class:`bpy.types.Image.gl_free`,
for example.
@@ -30,7 +29,7 @@ offers a set of extensive examples, including advanced features.
Bind a named texture to a texturing target
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glBindTexture.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glBindTexture.xhtml>`__
:type target: Enumerated constant
:arg target: Specifies the target to which the texture is bound.
@@ -42,7 +41,7 @@ offers a set of extensive examples, including advanced features.
Specify pixel arithmetic
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glBlendFunc.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendFunc.xhtml>`__
:type sfactor: Enumerated constant
:arg sfactor: Specifies how the red, green, blue, and alpha source blending factors are
@@ -56,7 +55,7 @@ offers a set of extensive examples, including advanced features.
Clear buffers to preset values
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClear.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClear.xhtml>`__
:type mask: Enumerated constant(s)
:arg mask: Bitwise OR of masks that indicate the buffers to be cleared.
@@ -66,7 +65,7 @@ offers a set of extensive examples, including advanced features.
Specify clear values for the color buffers
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClearColor.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClearColor.xhtml>`__
:type red, green, blue, alpha: float
:arg red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the
@@ -77,7 +76,7 @@ offers a set of extensive examples, including advanced features.
Specify the clear value for the depth buffer
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClearDepth.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClearDepth.xhtml>`__
:type depth: int
:arg depth: Specifies the depth value used when the depth buffer is cleared.
@@ -88,7 +87,7 @@ offers a set of extensive examples, including advanced features.
Specify the clear value for the stencil buffer
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClearStencil.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClearStencil.xhtml>`__
:type s: int
:arg s: Specifies the index used when the stencil buffer is cleared. The initial value is 0.
@@ -98,7 +97,7 @@ offers a set of extensive examples, including advanced features.
Specify a plane against which all geometry is clipped
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClipPlane.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClipPlane.xhtml>`__
:type plane: Enumerated constant
:arg plane: Specifies which clipping plane is being positioned.
@@ -117,7 +116,7 @@ offers a set of extensive examples, including advanced features.
Set a new color.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glColor.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glColor.xhtml>`__
:type red, green, blue, alpha: Depends on function prototype.
:arg red, green, blue: Specify new red, green, and blue values for the current color.
@@ -129,7 +128,7 @@ offers a set of extensive examples, including advanced features.
Enable and disable writing of frame buffer color components
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glColorMask.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glColorMask.xhtml>`__
:type red, green, blue, alpha: int (boolean)
:arg red, green, blue, alpha: Specify whether red, green, blue, and alpha can or cannot be
@@ -141,7 +140,7 @@ offers a set of extensive examples, including advanced features.
Copy pixels into a 2D texture image
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCopyTexImage2D.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCopyTexImage2D.xhtml>`__
:type target: Enumerated constant
:arg target: Specifies the target texture.
@@ -170,7 +169,7 @@ offers a set of extensive examples, including advanced features.
Specify whether front- or back-facing facets can be culled
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCullFace.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCullFace.xhtml>`__
:type mode: Enumerated constant
:arg mode: Specifies whether front- or back-facing facets are candidates for culling.
@@ -180,7 +179,7 @@ offers a set of extensive examples, including advanced features.
Delete named textures
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDeleteTextures.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteTextures.xhtml>`__
:type n: int
:arg n: Specifies the number of textures to be deleted
@@ -192,7 +191,7 @@ offers a set of extensive examples, including advanced features.
Specify the value used for depth buffer comparisons
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDepthFunc.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDepthFunc.xhtml>`__
:type func: Enumerated constant
:arg func: Specifies the depth comparison function.
@@ -202,7 +201,7 @@ offers a set of extensive examples, including advanced features.
Enable or disable writing into the depth buffer
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDepthMask.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDepthMask.xhtml>`__
:type flag: int (boolean)
:arg flag: Specifies whether the depth buffer is enabled for writing. If flag is GL_FALSE,
@@ -214,7 +213,7 @@ offers a set of extensive examples, including advanced features.
Specify mapping of depth values from normalized device coordinates to window coordinates
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDepthRange.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDepthRange.xhtml>`__
:type zNear: int
:arg zNear: Specifies the mapping of the near clipping plane to window coordinates.
@@ -228,7 +227,7 @@ offers a set of extensive examples, including advanced features.
Disable server-side GL capabilities
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEnable.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEnable.xhtml>`__
:type cap: Enumerated constant
:arg cap: Specifies a symbolic constant indicating a GL capability.
@@ -238,7 +237,7 @@ offers a set of extensive examples, including advanced features.
Specify which color buffers are to be drawn into
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDrawBuffer.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDrawBuffer.xhtml>`__
:type mode: Enumerated constant
:arg mode: Specifies up to four color buffers to be drawn into.
@@ -250,7 +249,7 @@ offers a set of extensive examples, including advanced features.
Flag edges as either boundary or non-boundary
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEdgeFlag.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEdgeFlag.xhtml>`__
:type flag: Depends of function prototype
:arg flag: Specifies the current edge flag value.The initial value is GL_TRUE.
@@ -260,7 +259,7 @@ offers a set of extensive examples, including advanced features.
Enable server-side GL capabilities
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEnable.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEnable.xhtml>`__
:type cap: Enumerated constant
:arg cap: Specifies a symbolic constant indicating a GL capability.
@@ -273,7 +272,7 @@ offers a set of extensive examples, including advanced features.
Evaluate enabled one- and two-dimensional maps
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEvalCoord.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEvalCoord.xhtml>`__
:type u: Depends on function prototype.
:arg u: Specifies a value that is the domain coordinate u to the basis function defined
@@ -291,7 +290,7 @@ offers a set of extensive examples, including advanced features.
Compute a one- or two-dimensional grid of points or lines
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEvalMesh.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEvalMesh.xhtml>`__
:type mode: Enumerated constant
:arg mode: In glEvalMesh1, specifies whether to compute a one-dimensional
@@ -306,7 +305,7 @@ offers a set of extensive examples, including advanced features.
Generate and evaluate a single point in a mesh
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEvalPoint.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEvalPoint.xhtml>`__
:type i: int
:arg i: Specifies the integer value for grid domain variable i.
@@ -318,7 +317,7 @@ offers a set of extensive examples, including advanced features.
Controls feedback mode
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFeedbackBuffer.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFeedbackBuffer.xhtml>`__
:type size: int
:arg size: Specifies the maximum number of values that can be written into buffer.
@@ -333,14 +332,14 @@ offers a set of extensive examples, including advanced features.
Block until all GL execution is complete
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFinish.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFinish.xhtml>`__
.. function:: glFlush():
Force Execution of GL commands in finite time
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFlush.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFlush.xhtml>`__
.. function:: glFog (pname, param):
@@ -349,7 +348,7 @@ offers a set of extensive examples, including advanced features.
Specify fog parameters
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFog.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFog.xhtml>`__
:type pname: Enumerated constant
:arg pname: Specifies a single-valued fog parameter. If the function prototype
@@ -364,7 +363,7 @@ offers a set of extensive examples, including advanced features.
Define front- and back-facing polygons
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFrontFace.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFrontFace.xhtml>`__
:type mode: Enumerated constant
:arg mode: Specifies the orientation of front-facing polygons.
@@ -374,7 +373,7 @@ offers a set of extensive examples, including advanced features.
Generate texture names
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGenTextures.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGenTextures.xhtml>`__
:type n: int
:arg n: Specifies the number of textures name to be generated.
@@ -388,7 +387,7 @@ offers a set of extensive examples, including advanced features.
Return the value or values of a selected parameter
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGet.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGet.xhtml>`__
:type pname: Enumerated constant
:arg pname: Specifies the parameter value to be returned.
@@ -400,7 +399,7 @@ offers a set of extensive examples, including advanced features.
Return error information
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetError.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetError.xhtml>`__
.. function:: glGetLight (light, pname, params):
@@ -409,7 +408,7 @@ offers a set of extensive examples, including advanced features.
Return light source parameter values
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetLight.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetLight.xhtml>`__
:type light: Enumerated constant
:arg light: Specifies a light source. The number of possible lights depends on the
@@ -427,7 +426,7 @@ offers a set of extensive examples, including advanced features.
Return evaluator parameters
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetMap.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetMap.xhtml>`__
:type target: Enumerated constant
:arg target: Specifies the symbolic name of a map.
@@ -443,7 +442,7 @@ offers a set of extensive examples, including advanced features.
Return material parameters
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetMaterial.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetMaterial.xhtml>`__
:type face: Enumerated constant
:arg face: Specifies which of the two materials is being queried.
@@ -460,7 +459,7 @@ offers a set of extensive examples, including advanced features.
Return the specified pixel map
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetPixelMap.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetPixelMap.xhtml>`__
:type map: Enumerated constant
:arg map: Specifies the name of the pixel map to return.
@@ -472,7 +471,7 @@ offers a set of extensive examples, including advanced features.
Return a string describing the current GL connection
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetString.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetString.xhtml>`__
:type name: Enumerated constant
:arg name: Specifies a symbolic constant.
@@ -485,7 +484,7 @@ offers a set of extensive examples, including advanced features.
Return texture environment parameters
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexEnv.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexEnv.xhtml>`__
:type target: Enumerated constant
:arg target: Specifies a texture environment. Must be GL_TEXTURE_ENV.
@@ -501,7 +500,7 @@ offers a set of extensive examples, including advanced features.
Return texture coordinate generation parameters
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexGen.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexGen.xhtml>`__
:type coord: Enumerated constant
:arg coord: Specifies a texture coordinate.
@@ -515,7 +514,7 @@ offers a set of extensive examples, including advanced features.
Return a texture image
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexImage.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexImage.xhtml>`__
:type target: Enumerated constant
:arg target: Specifies which texture is to be obtained.
@@ -537,7 +536,7 @@ offers a set of extensive examples, including advanced features.
return texture parameter values for a specific level of detail
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexLevelParameter.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexLevelParameter.xhtml>`__
:type target: Enumerated constant
:arg target: Specifies the symbolic name of the target texture.
@@ -556,7 +555,7 @@ offers a set of extensive examples, including advanced features.
Return texture parameter values
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexParameter.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexParameter.xhtml>`__
:type target: Enumerated constant
:arg target: Specifies the symbolic name of the target texture.
@@ -570,7 +569,7 @@ offers a set of extensive examples, including advanced features.
Specify implementation-specific hints
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glHint.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glHint.xhtml>`__
:type target: Enumerated constant
:arg target: Specifies a symbolic constant indicating the behavior to be
@@ -583,7 +582,7 @@ offers a set of extensive examples, including advanced features.
Test whether a capability is enabled
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glIsEnabled.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glIsEnabled.xhtml>`__
:type cap: Enumerated constant
:arg cap: Specifies a constant representing a GL capability.
@@ -593,7 +592,7 @@ offers a set of extensive examples, including advanced features.
Determine if a name corresponds to a texture
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glIsTexture.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glIsTexture.xhtml>`__
:type texture: unsigned int
:arg texture: Specifies a value that may be the name of a texture.
@@ -605,7 +604,7 @@ offers a set of extensive examples, including advanced features.
Set the light source parameters
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLight.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLight.xhtml>`__
:type light: Enumerated constant
:arg light: Specifies a light. The number of lights depends on the implementation,
@@ -625,7 +624,7 @@ offers a set of extensive examples, including advanced features.
Set the lighting model parameters
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLightModel.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLightModel.xhtml>`__
:type pname: Enumerated constant
:arg pname: Specifies a single-value light model parameter.
@@ -638,7 +637,7 @@ offers a set of extensive examples, including advanced features.
Specify the width of rasterized lines.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLineWidth.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLineWidth.xhtml>`__
:type width: float
:arg width: Specifies the width of rasterized lines. The initial value is 1.
@@ -650,7 +649,7 @@ offers a set of extensive examples, including advanced features.
Replace the current matrix with the specified matrix
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLoadMatrix.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLoadMatrix.xhtml>`__
: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
@@ -661,7 +660,7 @@ offers a set of extensive examples, including advanced features.
Specify a logical pixel operation for color index rendering
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLogicOp.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLogicOp.xhtml>`__
:type opcode: Enumerated constant
:arg opcode: Specifies a symbolic constant that selects a logical operation.
@@ -673,7 +672,7 @@ offers a set of extensive examples, including advanced features.
Define a one-dimensional evaluator
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMap1.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMap1.xhtml>`__
:type target: Enumerated constant
:arg target: Specifies the kind of values that are generated by the evaluator.
@@ -698,7 +697,7 @@ offers a set of extensive examples, including advanced features.
Define a two-dimensional evaluator
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMap2.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMap2.xhtml>`__
:type target: Enumerated constant
:arg target: Specifies the kind of values that are generated by the evaluator.
@@ -739,7 +738,7 @@ offers a set of extensive examples, including advanced features.
Define a one- or two-dimensional mesh
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMapGrid.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMapGrid.xhtml>`__
:type un: int
:arg un: Specifies the number of partitions in the grid range interval
@@ -758,7 +757,7 @@ offers a set of extensive examples, including advanced features.
Specify material parameters for the lighting model.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMaterial.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMaterial.xhtml>`__
:type face: Enumerated constant
:arg face: Specifies which face or faces are being updated. Must be one of:
@@ -777,7 +776,7 @@ offers a set of extensive examples, including advanced features.
Multiply the current matrix with the specified matrix
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMultMatrix.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMultMatrix.xhtml>`__
: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
@@ -791,7 +790,7 @@ offers a set of extensive examples, including advanced features.
Set the current normal vector
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glNormal.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glNormal.xhtml>`__
: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.
@@ -807,7 +806,7 @@ offers a set of extensive examples, including advanced features.
Set up pixel transfer maps
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPixelMap.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPixelMap.xhtml>`__
:type map: Enumerated constant
:arg map: Specifies a symbolic map name.
@@ -823,7 +822,7 @@ offers a set of extensive examples, including advanced features.
Set pixel storage modes
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPixelStore.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPixelStore.xhtml>`__
:type pname: Enumerated constant
:arg pname: Specifies the symbolic name of the parameter to be set.
@@ -839,7 +838,7 @@ offers a set of extensive examples, including advanced features.
Set pixel transfer modes
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPixelTransfer.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPixelTransfer.xhtml>`__
:type pname: Enumerated constant
:arg pname: Specifies the symbolic name of the pixel transfer parameter to be set.
@@ -851,7 +850,7 @@ offers a set of extensive examples, including advanced features.
Specify the diameter of rasterized points
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPointSize.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPointSize.xhtml>`__
:type size: float
:arg size: Specifies the diameter of rasterized points. The initial value is 1.
@@ -861,7 +860,7 @@ offers a set of extensive examples, including advanced features.
Select a polygon rasterization mode
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPolygonMode.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPolygonMode.xhtml>`__
:type face: Enumerated constant
:arg face: Specifies the polygons that mode applies to.
@@ -876,7 +875,7 @@ offers a set of extensive examples, including advanced features.
Set the scale and units used to calculate depth values
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPolygonOffset.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPolygonOffset.xhtml>`__
:type factor: float
:arg factor: Specifies a scale factor that is used to create a variable depth
@@ -896,7 +895,7 @@ offers a set of extensive examples, including advanced features.
Specify the raster position for pixel operations
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glRasterPos.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glRasterPos.xhtml>`__
: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
@@ -928,7 +927,7 @@ offers a set of extensive examples, including advanced features.
Select a color buffer source for pixels.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glReadBuffer.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glReadBuffer.xhtml>`__
:type mode: Enumerated constant
:arg mode: Specifies a color buffer.
@@ -938,7 +937,7 @@ offers a set of extensive examples, including advanced features.
Read a block of pixels from the frame buffer
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glReadPixels.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glReadPixels.xhtml>`__
:type x, y: int
:arg x, y: Specify the window coordinates of the first pixel that is read
@@ -961,7 +960,7 @@ offers a set of extensive examples, including advanced features.
Draw a rectangle
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glRect.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glRect.xhtml>`__
:type x1, y1: Depends on function prototype. (for non 'v' prototypes only)
:arg x1, y1: Specify one vertex of a rectangle
@@ -978,7 +977,7 @@ offers a set of extensive examples, including advanced features.
Multiply the current matrix by a rotation matrix
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glRotate.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glRotate.xhtml>`__
:type angle: Depends on function prototype.
:arg angle: Specifies the angle of rotation in degrees.
@@ -992,7 +991,7 @@ offers a set of extensive examples, including advanced features.
Multiply the current matrix by a general scaling matrix
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glScale.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glScale.xhtml>`__
:type x, y, z: Depends on function prototype.
:arg x, y, z: Specify scale factors along the x, y, and z axes, respectively.
@@ -1002,7 +1001,7 @@ offers a set of extensive examples, including advanced features.
Define the scissor box
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glScissor.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glScissor.xhtml>`__
:type x, y: int
:arg x, y: Specify the lower left corner of the scissor box. Initially (0, 0).
@@ -1016,7 +1015,7 @@ offers a set of extensive examples, including advanced features.
Set function and reference value for stencil testing
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man/docbook4/xhtml/glStencilFunc.xml>`__
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man/docbook4/xhtml/glStencilFunc.xhtml>`__
:type func: Enumerated constant
:arg func: Specifies the test function.
@@ -1033,7 +1032,7 @@ offers a set of extensive examples, including advanced features.
Control the writing of individual bits in the stencil planes
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glStencilMask.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glStencilMask.xhtml>`__
:type mask: unsigned int
:arg mask: Specifies a bit mask to enable and disable writing of individual bits
@@ -1044,7 +1043,7 @@ offers a set of extensive examples, including advanced features.
Set stencil test actions
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glStencilOp.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glStencilOp.xhtml>`__
:type fail: Enumerated constant
:arg fail: Specifies the action to take when the stencil test fails.
@@ -1072,7 +1071,7 @@ offers a set of extensive examples, including advanced features.
Set the current texture coordinates
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexCoord.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexCoord.xhtml>`__
: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
@@ -1088,7 +1087,7 @@ offers a set of extensive examples, including advanced features.
Set texture environment parameters
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexEnv.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexEnv.xhtml>`__
:type target: Enumerated constant
:arg target: Specifies a texture environment. Must be GL_TEXTURE_ENV.
@@ -1107,7 +1106,7 @@ offers a set of extensive examples, including advanced features.
Control the generation of texture coordinates
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexGen.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexGen.xhtml>`__
:type coord: Enumerated constant
:arg coord: Specifies a texture coordinate.
@@ -1125,7 +1124,7 @@ offers a set of extensive examples, including advanced features.
Specify a one-dimensional texture image
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexImage1D.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage1D.xhtml>`__
:type target: Enumerated constant
:arg target: Specifies the target texture.
@@ -1152,7 +1151,7 @@ offers a set of extensive examples, including advanced features.
Specify a two-dimensional texture image
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexImage2D.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml>`__
:type target: Enumerated constant
:arg target: Specifies the target texture.
@@ -1185,7 +1184,7 @@ offers a set of extensive examples, including advanced features.
Set texture parameters
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexParameter.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexParameter.xhtml>`__
:type target: Enumerated constant
:arg target: Specifies the target texture.
@@ -1202,7 +1201,7 @@ offers a set of extensive examples, including advanced features.
Multiply the current matrix by a translation matrix
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTranslate.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTranslate.xhtml>`__
:type x, y, z: Depends on function prototype.
:arg x, y, z: Specify the x, y, and z coordinates of a translation vector.
@@ -1212,7 +1211,7 @@ offers a set of extensive examples, including advanced features.
Set the viewport
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glViewport.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glViewport.xhtml>`__
:type x, y: int
:arg x, y: Specify the lower left corner of the viewport rectangle,
@@ -1227,7 +1226,7 @@ offers a set of extensive examples, including advanced features.
Installs a program object as part of current rendering state
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glUseProgram.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glUseProgram.xhtml>`__
:type program: int
:arg program: Specifies the handle of the program object whose executables are to be used as part of current rendering state.
@@ -1237,7 +1236,7 @@ offers a set of extensive examples, including advanced features.
Validates a program object
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glValidateProgram.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glValidateProgram.xhtml>`__
:type program: int
:arg program: Specifies the handle of the program object to be validated.
@@ -1247,7 +1246,7 @@ offers a set of extensive examples, including advanced features.
Links a program object.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLinkProgram.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLinkProgram.xhtml>`__
:type program: int
:arg program: Specifies the handle of the program object to be linked.
@@ -1257,7 +1256,7 @@ offers a set of extensive examples, including advanced features.
Select active texture unit.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glActiveTexture.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glActiveTexture.xhtml>`__
:type texture: int
:arg texture: Constant in ``GL_TEXTURE0`` 0 - 8
@@ -1267,7 +1266,7 @@ offers a set of extensive examples, including advanced features.
Attaches a shader object to a program object.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glAttachShader.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glAttachShader.xhtml>`__
:type program: int
:arg program: Specifies the program object to which a shader object will be attached.
@@ -1279,7 +1278,7 @@ offers a set of extensive examples, including advanced features.
Compiles a shader object.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCompileShader.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCompileShader.xhtml>`__
:type shader: int
:arg shader: Specifies the shader object to be compiled.
@@ -1289,7 +1288,7 @@ offers a set of extensive examples, including advanced features.
Creates a program object
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCreateProgram.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCreateProgram.xhtml>`__
:rtype: int
:return: The new program or zero if an error occurs.
@@ -1299,7 +1298,7 @@ offers a set of extensive examples, including advanced features.
Creates a shader object.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCreateShader.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCreateShader.xhtml>`__
:type shaderType: Specifies the type of shader to be created.
Must be one of ``GL_VERTEX_SHADER``,
@@ -1316,7 +1315,7 @@ offers a set of extensive examples, including advanced features.
Deletes a program object.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDeleteProgram.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteProgram.xhtml>`__
:type program: int
:arg program: Specifies the program object to be deleted.
@@ -1326,7 +1325,7 @@ offers a set of extensive examples, including advanced features.
Deletes a shader object.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDeleteShader.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteShader.xhtml>`__
:type shader: int
:arg shader: Specifies the shader object to be deleted.
@@ -1336,7 +1335,7 @@ offers a set of extensive examples, including advanced features.
Detaches a shader object from a program object to which it is attached.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDetachShader.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDetachShader.xhtml>`__
:type program: int
:arg program: Specifies the program object from which to detach the shader object.
@@ -1348,7 +1347,7 @@ offers a set of extensive examples, including advanced features.
Returns the handles of the shader objects attached to a program object.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetAttachedShaders.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetAttachedShaders.xhtml>`__
:type program: int
:arg program: Specifies the program object to be queried.
@@ -1364,7 +1363,7 @@ offers a set of extensive examples, including advanced features.
Returns the information log for a program object.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetProgramInfoLog.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetProgramInfoLog.xhtml>`__
:type program: int
:arg program: Specifies the program object whose information log is to be queried.
@@ -1380,7 +1379,7 @@ offers a set of extensive examples, including advanced features.
Returns the information log for a shader object.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetShaderInfoLog.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetShaderInfoLog.xhtml>`__
:type shader: int
:arg shader: Specifies the shader object whose information log is to be queried.
@@ -1396,7 +1395,7 @@ offers a set of extensive examples, including advanced features.
Returns a parameter from a program object.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetProgram.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetProgram.xhtml>`__
:type program: int
:arg program: Specifies the program object to be queried.
@@ -1410,7 +1409,7 @@ offers a set of extensive examples, including advanced features.
Determines if a name corresponds to a shader object.
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glIsShader.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glIsShader.xhtml>`__
:type shader: int
:arg shader: Specifies a potential shader object.
@@ -1420,7 +1419,7 @@ offers a set of extensive examples, including advanced features.
Determines if a name corresponds to a program object
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glIsProgram.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glIsProgram.xhtml>`__
:type program: int
:arg program: Specifies a potential program object.
@@ -1430,7 +1429,7 @@ offers a set of extensive examples, including advanced features.
Returns the source code string from a shader object
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetShaderSource.xml>`__
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetShaderSource.xhtml>`__
:type shader: int
:arg shader: Specifies the shader object to be queried.

View File

@@ -5,17 +5,6 @@
--partial bmesh* ; cd doc/python_api ; sphinx-build sphinx-in sphinx-out ; cd ../../
Submodules:
.. toctree::
:maxdepth: 1
bmesh.ops.rst
bmesh.types.rst
bmesh.utils.rst
bmesh.geometry.rst
Introduction
------------

View File

@@ -49,10 +49,6 @@ This module gives access to low level bmesh operations.
Most operators take input and return output, they can be chained together
to perform useful operations.
.. note::
This API us new in 2.65 and not yet well tested.
Operator Example
++++++++++++++++

View File

@@ -92,7 +92,7 @@ SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
# For now, ignore add-ons and internal subclasses of 'bpy.types.PropertyGroup'.
#
# Besides disabling this line, the main change will be to add a
# 'toctree' to 'write_rst_contents' which contains the generated rst files.
# 'toctree' to 'write_rst_index' which contains the generated rst files.
# This 'toctree' can be generated automatically.
#
# See: D6261 for reference.
@@ -244,6 +244,7 @@ else:
"bpy.types", # supports filtering
"bpy.utils",
"bpy.utils.previews",
"bpy.utils.units",
"bpy_extras",
"gpu",
"gpu.types",
@@ -495,6 +496,13 @@ else:
bpy_struct = None
def import_value_from_module(module_name, import_name):
ns = {}
exec_str = "from %s import %s as value" % (module_name, import_name)
exec(exec_str, ns, ns)
return ns["value"]
def escape_rst(text):
""" Escape plain text which may contain characters used by RST.
"""
@@ -744,13 +752,12 @@ def pyprop2sphinx(ident, fw, identifier, py_prop):
else:
fw(ident + ".. attribute:: %s\n\n" % identifier)
write_indented_lines(ident + " ", fw, py_prop.__doc__)
fw("\n")
if py_prop.fset is None:
fw(ident + " (readonly)\n\n")
else:
fw("\n")
def pymodule2sphinx(basepath, module_name, module, title):
def pymodule2sphinx(basepath, module_name, module, title, module_all_extra):
import types
attribute_set = set()
filepath = os.path.join(basepath, module_name + ".rst")
@@ -797,42 +804,51 @@ def pymodule2sphinx(basepath, module_name, module, title):
fw(module.__doc__.strip())
fw("\n\n")
write_example_ref("", fw, module_name)
# write submodules
# we could also scan files but this ensures __all__ is used correctly
if module_all is not None:
if module_all or module_all_extra:
submod_name = None
submod = None
submod_ls = []
for submod_name in module_all:
ns = {}
exec_str = "from %s import %s as submod" % (module.__name__, submod_name)
exec(exec_str, ns, ns)
submod = ns["submod"]
for submod_name in (module_all or ()):
submod = import_value_from_module(module_name, submod_name)
if type(submod) == types.ModuleType:
submod_ls.append((submod_name, submod))
for submod_name in module_all_extra:
if submod_name in attribute_set:
continue
submod = import_value_from_module(module_name, submod_name)
# No type checks, since there are non-module types we treat as modules
# such as `bpy.app.translations` & `bpy.app.handlers`.
submod_ls.append((submod_name, submod))
del submod_name
del submod
if submod_ls:
fw(".. toctree::\n")
fw(" :maxdepth: 1\n\n")
fw(" :maxdepth: 1\n")
fw(" :caption: Submodules\n\n")
for submod_name, submod in submod_ls:
submod_name_full = "%s.%s" % (module_name, submod_name)
fw(" %s.rst\n\n" % submod_name_full)
fw(" %s.rst\n" % submod_name_full)
pymodule2sphinx(basepath, submod_name_full, submod, "%s submodule" % module_name)
pymodule2sphinx(basepath, submod_name_full, submod, "%s submodule" % module_name, ())
fw("\n")
del submod_ls
# done writing submodules!
write_example_ref("", fw, module_name)
# write members of the module
# only tested with PyStructs which are not exactly modules
for key, descr in sorted(type(module).__dict__.items()):
if key.startswith("__"):
continue
if key in module_all_extra:
continue
# naughty, we also add getset's into PyStructs, this is not typical py but also not incorrect.
# type_name is only used for examples and messages
@@ -855,6 +871,8 @@ def pymodule2sphinx(basepath, module_name, module, title):
# sort by the valye type
descr_sorted.sort(key=lambda descr_data: str(descr_data[3]))
for key, descr, value, value_type in descr_sorted:
if key in module_all_extra:
continue
# must be documented as a submodule
if is_struct_seq(value):
@@ -896,6 +914,9 @@ def pymodule2sphinx(basepath, module_name, module, title):
module_dir_value_type.sort(key=lambda triple: str(triple[2]))
for attribute, value, value_type in module_dir_value_type:
if attribute in module_all_extra:
continue
if value_type == FunctionType:
pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False)
# both the same at the moment but to be future proof
@@ -1054,6 +1075,7 @@ context_type_map = {
"selected_bones": ("EditBone", True),
"selected_editable_bones": ("EditBone", True),
"selected_editable_fcurves": ("FCurve", True),
"selected_editable_keyframes": ("Keyframe", True),
"selected_editable_objects": ("Object", True),
"selected_editable_sequences": ("Sequence", True),
"selected_nla_strips": ("NlaStrip", True),
@@ -1312,7 +1334,7 @@ def pyrna2sphinx(basepath):
fw(title_string(title, "="))
fw(".. module:: %s\n\n" % struct_module_name)
fw(".. currentmodule:: %s\n\n" % struct_module_name)
# docs first?, ok
write_example_ref("", fw, "%s.%s" % (struct_module_name, struct_id))
@@ -1543,8 +1565,7 @@ def pyrna2sphinx(basepath):
fw(title_string(class_name, "="))
fw(".. module:: %s\n" % class_module_name)
fw("\n")
fw(".. currentmodule:: %s\n\n" % class_module_name)
if use_subclasses:
subclass_ids = [
@@ -1558,7 +1579,7 @@ def pyrna2sphinx(basepath):
fw(".. class:: %s\n\n" % class_name)
fw(" %s\n\n" % descr_str)
fw(" .. note::\n\n")
fw(" Note that %s.%s is not actually available from within Blender,\n"
fw(" Note that :class:`%s.%s` is not actually available from within Blender,\n"
" it only exists for the purpose of documentation.\n\n" % (class_module_name, class_name))
descr_items = [
@@ -1673,15 +1694,26 @@ def write_sphinx_conf_py(basepath):
fw("]\n\n")
fw("html_title = 'Blender Python API'\n")
fw("html_theme = 'sphinx_rtd_theme'\n")
fw("html_theme_options = {\n")
fw(" 'canonical_url': 'https://docs.blender.org/api/current/',\n")
# fw(" 'analytics_id': '',\n")
# fw(" 'collapse_navigation': True,\n")
fw(" 'sticky_navigation': False,\n")
fw(" 'navigation_depth': 1,\n")
# fw(" 'includehidden': True,\n")
# fw(" 'titles_only': False\n")
fw("html_theme = 'default'\n")
# The theme 'sphinx_rtd_theme' is no longer distributed with sphinx by default, only use when available.
fw(r"""
try:
__import__('sphinx_rtd_theme')
html_theme = 'sphinx_rtd_theme'
except ModuleNotFoundError:
pass
""")
fw("if html_theme == 'sphinx_rtd_theme':\n")
fw(" html_theme_options = {\n")
fw(" 'canonical_url': 'https://docs.blender.org/api/current/',\n")
# fw(" 'analytics_id': '',\n")
# fw(" 'collapse_navigation': True,\n")
fw(" 'sticky_navigation': False,\n")
fw(" 'navigation_depth': 1,\n")
# fw(" 'includehidden': True,\n")
# fw(" 'titles_only': False\n")
fw(" }\n\n")
# not helpful since the source is generated, adds to upload size.
@@ -1730,7 +1762,7 @@ def execfile(filepath):
file_handle.close()
def write_rst_contents(basepath):
def write_rst_index(basepath):
'''
Write the rst file of the main page, needed for sphinx (index.html)
'''
@@ -1770,7 +1802,6 @@ def write_rst_contents(basepath):
# py modules
"bpy.utils",
"bpy.utils.previews",
"bpy.path",
"bpy.app",
@@ -1808,6 +1839,10 @@ def write_rst_contents(basepath):
fw(" %s\n" % mod)
fw("\n")
fw(title_string("Indices", "="))
fw("* :ref:`genindex`\n")
fw("* :ref:`modindex`\n\n")
# special case, this 'bmesh.ops.rst' is extracted from C source
if "bmesh.ops" not in EXCLUDE_MODULES:
execfile(os.path.join(SCRIPT_DIR, "rst_from_bmesh_opdefines.py"))
@@ -1843,6 +1878,7 @@ def write_rst_types_index(basepath):
file = open(filepath, "w", encoding="utf-8")
fw = file.write
fw(title_string("Types (bpy.types)", "="))
fw(".. module:: bpy.types\n\n")
fw(".. toctree::\n")
fw(" :glob:\n\n")
fw(" bpy.types.*\n\n")
@@ -1858,8 +1894,10 @@ def write_rst_ops_index(basepath):
file = open(filepath, "w", encoding="utf-8")
fw = file.write
fw(title_string("Operators (bpy.ops)", "="))
fw(".. module:: bpy.ops\n\n")
write_example_ref("", fw, "bpy.ops")
fw(".. toctree::\n")
fw(" :caption: Submodules\n")
fw(" :glob:\n\n")
fw(" bpy.ops.*\n\n")
file.close()
@@ -1884,7 +1922,7 @@ def write_rst_msgbus(basepath):
file.close()
# Write the contents.
pymodule2sphinx(basepath, 'bpy.msgbus', bpy.msgbus, 'Message Bus')
pymodule2sphinx(basepath, 'bpy.msgbus', bpy.msgbus, 'Message Bus', ())
EXAMPLE_SET_USED.add("bpy.msgbus")
@@ -1899,7 +1937,7 @@ def write_rst_data(basepath):
file = open(filepath, "w", encoding="utf-8")
fw = file.write
fw(title_string("Data Access (bpy.data)", "="))
fw(".. module:: bpy\n")
fw(".. module:: bpy.data\n")
fw("\n")
fw("This module is used for all Blender/Python access.\n")
fw("\n")
@@ -1936,6 +1974,7 @@ def write_rst_importable_modules(basepath):
"gpu.select": "GPU Select",
"gpu.shader": "GPU Shader",
"bmesh": "BMesh Module",
"bmesh.ops": "BMesh Operators",
"bmesh.types": "BMesh Types",
"bmesh.utils": "BMesh Utilities",
"bmesh.geometry": "BMesh Geometry Utilities",
@@ -1961,11 +2000,32 @@ def write_rst_importable_modules(basepath):
"freestyle.shaders": "Freestyle Shaders",
"freestyle.utils": "Freestyle Utilities",
}
# This is needed since some of the sub-modules listed above are not actual modules.
# Examples include `bpy.app.translations` & `bpy.app.handlers`.
#
# Most of these are `PyStructSequence` internally,
# however we don't want to document all of these as modules since some only contain
# a few values (version number for e.g).
#
# If we remove this logic and document all `PyStructSequence` as sub-modules it means
# `bpy.app.timers` for example would be presented on the same level as library information
# access such as `bpy.app.sdl` which doesn't seem useful since it hides more useful
# module-like objects among library data access.
importable_modules_parent_map = {}
for mod_name in importable_modules.keys():
if mod_name in EXCLUDE_MODULES:
continue
if "." in mod_name:
mod_name, submod_name = mod_name.rsplit(".", 1)
importable_modules_parent_map.setdefault(mod_name, []).append(submod_name)
for mod_name, mod_descr in importable_modules.items():
if mod_name not in EXCLUDE_MODULES:
module = __import__(mod_name,
fromlist=[mod_name.rsplit(".", 1)[-1]])
pymodule2sphinx(basepath, mod_name, module, mod_descr)
if mod_name in EXCLUDE_MODULES:
continue
module_all_extra = importable_modules_parent_map.get(mod_name, ())
module = __import__(mod_name, fromlist=[mod_name.rsplit(".", 1)[-1]])
pymodule2sphinx(basepath, mod_name, module, mod_descr, module_all_extra)
def copy_handwritten_rsts(basepath):
@@ -2030,7 +2090,7 @@ def rna2sphinx(basepath):
write_sphinx_conf_py(basepath)
# main page
write_rst_contents(basepath)
write_rst_index(basepath)
# context
if "bpy.context" not in EXCLUDE_MODULES:

View File

@@ -27,22 +27,6 @@ else
fi
# -----------------------------------------------------------------------------
# Get the number of cores for threaded build
ifndef NPROCS
NPROCS:=1
ifeq ($(OS), Linux)
NPROCS:=$(shell nproc)
endif
ifeq ($(OS), NetBSD)
NPROCS:=$(shell getconf NPROCESSORS_ONLN)
endif
ifneq (,$(filter $(OS),Darwin FreeBSD))
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
endif
# ----------------------------------------------------------------------------
# Blender Version & Info
@@ -92,7 +76,7 @@ fi
# Generate HTML (sphinx)
if $DO_OUT_HTML ; then
sphinx-build -b html -j $(NPROCS) $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
sphinx-build -b html -j auto $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
# XXX, saves space on upload and zip, should move HTML outside
# and zip up there, for now this is OK
@@ -119,7 +103,7 @@ fi
# Generate PDF (sphinx/laytex)
if $DO_OUT_PDF ; then
sphinx-build -n -b latex -j $(NPROCS) $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
sphinx-build -n -b latex -j auto $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
make -C $SPHINX_WORKDIR/sphinx-out
mv $SPHINX_WORKDIR/sphinx-out/contents.pdf \
$SPHINX_WORKDIR/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf

View File

@@ -9,3 +9,7 @@
/* Hide home icon in search area */
.wy-side-nav-search > a:hover {background: none; opacity: 0.9}
.wy-side-nav-search > a.icon::before {content: none}
.wy-nav-content {
max-width: 1000px !important;
}

View File

@@ -60,7 +60,7 @@ PlaybackManager_dealloc(PlaybackManagerP* self)
}
PyDoc_STRVAR(M_aud_PlaybackManager_play_doc,
".. classmethod:: setVolume(sound, catKey)\n\n"
".. classmethod:: play(sound, catKey)\n\n"
" Plays a sound through the playback manager and assigns it to a category.\n\n"
" :arg sound: The sound to play.\n"
" :type sound: :class:`Sound`\n"

View File

@@ -31,6 +31,17 @@ if(MSVC_CLANG AND WITH_OPENMP AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0.1
remove_cc_flag("-fopenmp")
endif()
# Exporting functions from the blender binary gives linker warnings on Apple arm64 systems.
# For now and until Apple arm64 is officially supported, these will just be silenced here.
# TODO (sebbas): Check if official arm64 devices give linker warnings without this block.
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
endif()
endif()
set(MANTAVERSION "0.13")
add_definitions(-DWITH_FLUID=1)

View File

@@ -60,7 +60,7 @@ template<class GridType, class T> void importVDB(typename GridType::Ptr from, Gr
template<class VDBType, class T>
void importVDB(VDBType vdbValue, ParticleDataImpl<T> *to, int index, float voxelSize)
{
(void)voxelSize; // Unused
unusedParameter(voxelSize); // Unused for now
T toMantaValue;
convertFrom(vdbValue, &toMantaValue);
to->set(index, toMantaValue);
@@ -165,12 +165,12 @@ static void setGridOptions(typename GridType::Ptr grid,
string name,
openvdb::GridClass cls,
float voxelSize,
bool precisionHalf)
int precision)
{
grid->setTransform(openvdb::math::Transform::createLinearTransform(voxelSize));
grid->setGridClass(cls);
grid->setName(name);
grid->setSaveFloatAsHalf(precisionHalf);
grid->setSaveFloatAsHalf(precision == PRECISION_MINI || precision == PRECISION_HALF);
}
template<class T, class GridType> typename GridType::Ptr exportVDB(Grid<T> *from)
@@ -194,7 +194,8 @@ template<class MantaType, class VDBType>
void exportVDB(ParticleDataImpl<MantaType> *from,
openvdb::points::PointDataGrid::Ptr to,
openvdb::tools::PointIndexGrid::Ptr pIndex,
bool skipDeletedParts)
bool skipDeletedParts,
int precision)
{
std::vector<VDBType> vdbValues;
std::string name = from->getName();
@@ -212,8 +213,21 @@ void exportVDB(ParticleDataImpl<MantaType> *from,
vdbValues.push_back(vdbValue);
}
openvdb::NamePair attribute =
openvdb::points::TypedAttributeArray<VDBType, openvdb::points::NullCodec>::attributeType();
// Use custom codec for precision of the attribute
openvdb::NamePair attribute;
if (precision == PRECISION_FULL) {
attribute =
openvdb::points::TypedAttributeArray<VDBType, openvdb::points::NullCodec>::attributeType();
}
else if (precision == PRECISION_HALF ||
precision == PRECISION_MINI) { // Mini uses same precision as half for now
attribute =
openvdb::points::TypedAttributeArray<VDBType,
openvdb::points::TruncateCodec>::attributeType();
}
else {
errMsg("exportVDB: invalid precision level");
}
openvdb::points::appendAttribute(to->tree(), name, attribute);
// Create a wrapper around the vdb values vector.
@@ -229,7 +243,8 @@ void exportVDB(ParticleDataImpl<MantaType> *from,
openvdb::points::PointDataGrid::Ptr exportVDB(BasicParticleSystem *from,
std::vector<ParticleDataBase *> &fromPData,
bool skipDeletedParts,
float voxelSize)
float voxelSize,
int precision)
{
std::vector<openvdb::Vec3s> positions;
std::vector<int> flags;
@@ -257,16 +272,34 @@ openvdb::points::PointDataGrid::Ptr exportVDB(BasicParticleSystem *from,
openvdb::tools::createPointIndexGrid<openvdb::tools::PointIndexGrid>(positionsWrapper,
*transform);
// TODO (sebbas): Use custom codec for attributes?
// using Codec = openvdb::points::FixedPointCodec</*1-byte=*/false, openvdb::points::UnitRange>;
openvdb::points::PointDataGrid::Ptr to =
openvdb::points::createPointDataGrid<openvdb::points::NullCodec /*Codec*/,
openvdb::points::PointDataGrid>(
*pointIndexGrid, positionsWrapper, *transform);
openvdb::points::PointDataGrid::Ptr to;
openvdb::NamePair flagAttribute;
using CodecNull = openvdb::points::NullCodec;
using CodecTrunc = openvdb::points::TruncateCodec;
using CodecFixPoint = openvdb::points::FixedPointCodec<true, openvdb::points::PositionRange>;
// Use custom codec for precision of the particle position and the flag attribute
if (precision == PRECISION_FULL) {
to = openvdb::points::createPointDataGrid<CodecNull, openvdb::points::PointDataGrid>(
*pointIndexGrid, positionsWrapper, *transform);
flagAttribute = openvdb::points::TypedAttributeArray<int, CodecNull>::attributeType();
}
else if (precision == PRECISION_HALF) {
to = openvdb::points::createPointDataGrid<CodecTrunc, openvdb::points::PointDataGrid>(
*pointIndexGrid, positionsWrapper, *transform);
flagAttribute = openvdb::points::TypedAttributeArray<int, CodecTrunc>::attributeType();
}
else if (precision == PRECISION_MINI) {
to = openvdb::points::createPointDataGrid<CodecFixPoint, openvdb::points::PointDataGrid>(
*pointIndexGrid, positionsWrapper, *transform);
flagAttribute = openvdb::points::TypedAttributeArray<int, CodecTrunc>::
attributeType(); // Use 16 bit trunc for flag for now
}
else {
errMsg("exportVDB: invalid precision level");
}
openvdb::NamePair flagAttribute =
openvdb::points::TypedAttributeArray<int,
openvdb::points::NullCodec /*Codec*/>::attributeType();
openvdb::points::appendAttribute(to->tree(), FLAG_NAME, flagAttribute);
// Create a wrapper around the flag vector.
openvdb::points::PointAttributeVector<int> flagWrapper(flags);
@@ -281,17 +314,17 @@ openvdb::points::PointDataGrid::Ptr exportVDB(BasicParticleSystem *from,
if (pdb->getType() == ParticleDataBase::TypeInt) {
debMsg("Writing int particle data '" << pdb->getName() << "'", 1);
ParticleDataImpl<int> *pdi = dynamic_cast<ParticleDataImpl<int> *>(pdb);
exportVDB<int, int>(pdi, to, pointIndexGrid, skipDeletedParts);
exportVDB<int, int>(pdi, to, pointIndexGrid, skipDeletedParts, precision);
}
else if (pdb->getType() == ParticleDataBase::TypeReal) {
debMsg("Writing real particle data '" << pdb->getName() << "'", 1);
ParticleDataImpl<Real> *pdi = dynamic_cast<ParticleDataImpl<Real> *>(pdb);
exportVDB<Real, float>(pdi, to, pointIndexGrid, skipDeletedParts);
exportVDB<Real, float>(pdi, to, pointIndexGrid, skipDeletedParts, precision);
}
else if (pdb->getType() == ParticleDataBase::TypeVec3) {
debMsg("Writing Vec3 particle data '" << pdb->getName() << "'", 1);
ParticleDataImpl<Vec3> *pdi = dynamic_cast<ParticleDataImpl<Vec3> *>(pdb);
exportVDB<Vec3, openvdb::Vec3s>(pdi, to, pointIndexGrid, skipDeletedParts);
exportVDB<Vec3, openvdb::Vec3s>(pdi, to, pointIndexGrid, skipDeletedParts, precision);
}
else {
errMsg("exportVDB: unknown ParticleDataBase type");
@@ -302,8 +335,10 @@ openvdb::points::PointDataGrid::Ptr exportVDB(BasicParticleSystem *from,
static void registerCustomCodecs()
{
using Codec = openvdb::points::FixedPointCodec</*1-byte=*/false, openvdb::points::UnitRange>;
openvdb::points::TypedAttributeArray<int, Codec>::registerType();
openvdb::points::TypedAttributeArray<int, openvdb::points::TruncateCodec>::registerType();
openvdb::points::TypedAttributeArray<float, openvdb::points::TruncateCodec>::registerType();
openvdb::points::TypedAttributeArray<openvdb::Vec3s,
openvdb::points::TruncateCodec>::registerType();
}
int writeObjectsVDB(const string &filename,
@@ -311,15 +346,14 @@ int writeObjectsVDB(const string &filename,
float worldSize,
bool skipDeletedParts,
int compression,
bool precisionHalf)
int precision)
{
openvdb::initialize();
openvdb::io::File file(filename);
openvdb::GridPtrVec gridsVDB;
// TODO (sebbas): Use custom codec for flag attribute?
// Register codecs one, this makes sure custom attributes can be read
// registerCustomCodecs();
// Register custom codecs, this makes sure custom attributes can be read
registerCustomCodecs();
std::vector<ParticleDataBase *> pdbBuffer;
@@ -365,7 +399,7 @@ int writeObjectsVDB(const string &filename,
debMsg("Writing particle system '" << mantaPP->getName()
<< "' (and buffered pData) to vdb file " << filename,
1);
vdbGrid = exportVDB(mantaPP, pdbBuffer, skipDeletedParts, voxelSize);
vdbGrid = exportVDB(mantaPP, pdbBuffer, skipDeletedParts, voxelSize, precision);
gridsVDB.push_back(vdbGrid);
pdbBuffer.clear();
}
@@ -382,7 +416,7 @@ int writeObjectsVDB(const string &filename,
// Set additional grid attributes, e.g. name, grid class, compression level, etc.
if (vdbGrid) {
setGridOptions<openvdb::GridBase>(vdbGrid, objectName, gClass, voxelSize, precisionHalf);
setGridOptions<openvdb::GridBase>(vdbGrid, objectName, gClass, voxelSize, precision);
}
}
@@ -434,19 +468,18 @@ int readObjectsVDB(const string &filename, std::vector<PbClass *> *objects, floa
openvdb::io::File file(filename);
openvdb::GridPtrVec gridsVDB;
// TODO (sebbas): Use custom codec for flag attribute?
// Register codecs one, this makes sure custom attributes can be read
// registerCustomCodecs();
// Register custom codecs, this makes sure custom attributes can be read
registerCustomCodecs();
try {
file.setCopyMaxBytes(0);
file.open();
gridsVDB = *(file.getGrids());
openvdb::MetaMap::Ptr metadata = file.getMetadata();
(void)metadata; // Unused for now
unusedParameter(metadata); // Unused for now
}
catch (const openvdb::IoError &e) {
(void)e; // Unused for now
unusedParameter(e); // Unused for now
debMsg("readObjectsVDB: Could not open vdb file " << filename, 1);
file.close();
return 0;
@@ -494,27 +527,36 @@ int readObjectsVDB(const string &filename, std::vector<PbClass *> *objects, floa
if (GridBase *mantaGrid = dynamic_cast<GridBase *>(*iter)) {
if (mantaGrid->getType() & GridBase::TypeInt) {
openvdb::Int32Grid::Ptr vdbIntGrid = openvdb::gridPtrCast<openvdb::Int32Grid>(vdbGrid);
if (!vdbIntGrid)
continue; // Sanity check: Cast can fail if onlyGrid is true but object count > 1
Grid<int> *mantaIntGrid = (Grid<int> *)mantaGrid;
debMsg("Reading into grid '" << mantaGrid->getName() << "' from int grid '"
<< vdbGrid->getName() << "' in vdb file " << filename,
1);
openvdb::Int32Grid::Ptr vdbIntGrid = openvdb::gridPtrCast<openvdb::Int32Grid>(vdbGrid);
Grid<int> *mantaIntGrid = (Grid<int> *)mantaGrid;
importVDB<openvdb::Int32Grid, int>(vdbIntGrid, mantaIntGrid);
}
else if (mantaGrid->getType() & GridBase::TypeReal) {
openvdb::FloatGrid::Ptr vdbFloatGrid = openvdb::gridPtrCast<openvdb::FloatGrid>(vdbGrid);
if (!vdbFloatGrid)
continue; // Sanity check: Cast can fail if onlyGrid is true but object count > 1
Grid<Real> *mantaRealGrid = (Grid<Real> *)mantaGrid;
debMsg("Reading into grid '" << mantaGrid->getName() << "' from real grid '"
<< vdbGrid->getName() << "' in vdb file " << filename,
1);
openvdb::FloatGrid::Ptr vdbFloatGrid = openvdb::gridPtrCast<openvdb::FloatGrid>(vdbGrid);
Grid<Real> *mantaRealGrid = (Grid<Real> *)mantaGrid;
importVDB<openvdb::FloatGrid, Real>(vdbFloatGrid, mantaRealGrid);
}
else if (mantaGrid->getType() & GridBase::TypeVec3) {
openvdb::Vec3SGrid::Ptr vdbVec3Grid = openvdb::gridPtrCast<openvdb::Vec3SGrid>(vdbGrid);
if (!vdbVec3Grid)
continue; // Sanity check: Cast can fail if onlyGrid is true but object count > 1
Grid<Vec3> *mantaVec3Grid = (Grid<Vec3> *)mantaGrid;
debMsg("Reading into grid '" << mantaGrid->getName() << "' from vec3 grid '"
<< vdbGrid->getName() << "' in vdb file " << filename,
1);
openvdb::Vec3SGrid::Ptr vdbVec3Grid = openvdb::gridPtrCast<openvdb::Vec3SGrid>(vdbGrid);
Grid<Vec3> *mantaVec3Grid = (Grid<Vec3> *)mantaGrid;
importVDB<openvdb::Vec3SGrid, Vec3>(vdbVec3Grid, mantaVec3Grid);
}
else {
@@ -523,12 +565,15 @@ int readObjectsVDB(const string &filename, std::vector<PbClass *> *objects, floa
}
}
else if (BasicParticleSystem *mantaPP = dynamic_cast<BasicParticleSystem *>(*iter)) {
openvdb::points::PointDataGrid::Ptr vdbPointGrid =
openvdb::gridPtrCast<openvdb::points::PointDataGrid>(vdbGrid);
if (!vdbPointGrid)
continue; // Sanity check: Cast can fail if onlyGrid is true but objects > 1
debMsg("Reading into particle system '" << mantaPP->getName() << "' from particle system '"
<< vdbGrid->getName() << "' in vdb file "
<< filename,
1);
openvdb::points::PointDataGrid::Ptr vdbPointGrid =
openvdb::gridPtrCast<openvdb::points::PointDataGrid>(vdbGrid);
importVDB(vdbPointGrid, mantaPP, pdbBuffer, voxelSize);
pdbBuffer.clear();
}
@@ -582,19 +627,23 @@ template openvdb::Vec3SGrid::Ptr exportVDB<Vec3, openvdb::Vec3SGrid>(Grid<Vec3>
openvdb::points::PointDataGrid::Ptr exportVDB(BasicParticleSystem *from,
std::vector<ParticleDataBase *> &fromPData,
bool skipDeletedParts = false,
float voxelSize = 1.0);
float voxelSize = 1.0,
int precision = PRECISION_HALF);
template void exportVDB<int, int>(ParticleDataImpl<int> *from,
openvdb::points::PointDataGrid::Ptr to,
openvdb::tools::PointIndexGrid::Ptr pIndex,
bool skipDeletedParts = false);
bool skipDeletedParts = false,
int precision = PRECISION_HALF);
template void exportVDB<Real, float>(ParticleDataImpl<Real> *from,
openvdb::points::PointDataGrid::Ptr to,
openvdb::tools::PointIndexGrid::Ptr pIndex,
bool skipDeletedParts = false);
bool skipDeletedParts = false,
int precision = PRECISION_HALF);
template void exportVDB<Vec3, openvdb::Vec3s>(ParticleDataImpl<Vec3> *from,
openvdb::points::PointDataGrid::Ptr to,
openvdb::tools::PointIndexGrid::Ptr pIndex,
bool skipDeletedParts = false);
bool skipDeletedParts = false,
int precision = PRECISION_HALF);
#else
@@ -603,7 +652,7 @@ int writeObjectsVDB(const string &filename,
float worldSize,
bool skipDeletedParts,
int compression,
bool precisionHalf)
int precision)
{
errMsg("Cannot save to .vdb file. Mantaflow has not been built with OpenVDB support.");
return 0;

View File

@@ -82,8 +82,15 @@ int save(const string &name,
float worldSize = 1.0,
bool skipDeletedParts = false,
int compression = COMPRESSION_ZIP,
bool precisionHalf = true)
bool precisionHalf = true,
int precision = PRECISION_HALF)
{
if (!precisionHalf) {
debMsg("Warning: precisionHalf argument is deprecated. Please use precision level instead", 0);
precision = PRECISION_HALF; // for backwards compatibility
}
if (name.find_last_of('.') == string::npos)
errMsg("file '" + name + "' does not have an extension");
string ext = name.substr(name.find_last_of('.'));
@@ -95,8 +102,7 @@ int save(const string &name,
else if (ext == ".vol")
return writeGridsVol(name, &objects);
if (ext == ".vdb")
return writeObjectsVDB(
name, &objects, worldSize, skipDeletedParts, compression, precisionHalf);
return writeObjectsVDB(name, &objects, worldSize, skipDeletedParts, compression, precision);
else if (ext == ".npz")
return writeGridsNumpy(name, &objects);
else if (ext == ".txt")
@@ -122,7 +128,9 @@ static PyObject *_W_1(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
bool skipDeletedParts = _args.getOpt<bool>("skipDeletedParts", 3, false, &_lock);
int compression = _args.getOpt<int>("compression", 4, COMPRESSION_ZIP, &_lock);
bool precisionHalf = _args.getOpt<bool>("precisionHalf", 5, true, &_lock);
_retval = toPy(save(name, objects, worldSize, skipDeletedParts, compression, precisionHalf));
int precision = _args.getOpt<int>("precision", 6, PRECISION_HALF, &_lock);
_retval = toPy(
save(name, objects, worldSize, skipDeletedParts, compression, precisionHalf, precision));
_args.check();
}
pbFinalizePlugin(parent, "save", !noTiming);

View File

@@ -28,6 +28,11 @@
#define COMPRESSION_ZIP 1
#define COMPRESSION_BLOSC 2
// OpenVDB precision flags
#define PRECISION_FULL 0
#define PRECISION_HALF 1
#define PRECISION_MINI 2
namespace Manta {
// Forward declations
@@ -70,7 +75,7 @@ int writeObjectsVDB(const std::string &filename,
float scale = 1.0,
bool skipDeletedParts = false,
int compression = COMPRESSION_ZIP,
bool precisionHalf = true);
int precision = PRECISION_HALF);
int readObjectsVDB(const std::string &filename,
std::vector<PbClass *> *objects,
float scale = 1.0);

View File

@@ -1,3 +1,3 @@
#define MANTA_GIT_VERSION "commit b8e557707805720ff00a8eb946db2ee5b9361b5a"
#define MANTA_GIT_VERSION "commit dffc3481b835dfa048effcbb8a9e613294ecae14"

View File

@@ -695,12 +695,7 @@ struct KnApplyEmission : public KernelBase {
// (important for emit from particles)
bool isInflow = (type & FlagGrid::TypeInflow && flags.isInflow(i, j, k));
bool isOutflow = (type & FlagGrid::TypeOutflow && flags.isOutflow(i, j, k));
if (type && !isInflow)
return;
if (type && isOutflow)
return;
if (emissionTexture && !(*emissionTexture)(i, j, k))
if ((type && !isInflow && !isOutflow) && (emissionTexture && !(*emissionTexture)(i, j, k)))
return;
if (isAbsolute)

View File

@@ -16,7 +16,8 @@ static const Pb::Register _reg(
"integration mode\nIntEuler = 0\nIntRK2 = 1\nIntRK4 = 2\n\n# CG preconditioner\nPcNone "
" = 0\nPcMIC = 1\nPcMGDynamic = 2\nPcMGStatic = 3\n\n# particles\nPtypeSpray = "
"2\nPtypeBubble = 4\nPtypeFoam = 8\nPtypeTracer = 16\n\n# OpenVDB export "
"flags\nCompression_None = 0\nCompression_Zip = 1\nCompression_Blosc = 2\n\n\n\n\n");
"flags\nCompression_None = 0\nCompression_Zip = 1\nCompression_Blosc = 2\n\n# OpenVDB "
"precision flags\nPrecision_Full = 0\nPrecision_Half = 1\nPrecision_Mini = 2\n\n\n\n");
extern "C" {
void PbRegister_file_0()
{

View File

@@ -57,7 +57,7 @@
#if defined(__arm__)
/* Attempt to fix compilation error on Debian armel kernel.
* arm7 architecture does have both 32 and 64bit atomics, however
* it's gcc doesn't have __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n defined.
* its gcc doesn't have __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n defined.
*/
# define JE_FORCE_SYNC_COMPARE_AND_SWAP_1
# define JE_FORCE_SYNC_COMPARE_AND_SWAP_4

View File

@@ -352,7 +352,7 @@ if(WITH_CYCLES_CUDA_BINARIES AND (NOT WITH_CYCLES_CUBIN_COMPILER))
set(MAX_MSVC 1910)
elseif(${CUDA_VERSION} EQUAL "9.1")
set(MAX_MSVC 1911)
elseif(${CUDA_VERSION} LESS "11.0")
elseif(${CUDA_VERSION} VERSION_GREATER_EQUAL 10.0)
set(MAX_MSVC 1999)
endif()
if(NOT MSVC_VERSION LESS ${MAX_MSVC} OR CMAKE_C_COMPILER_ID MATCHES "Clang")

View File

@@ -31,7 +31,6 @@ from math import pi
# enums
import _cycles
from . import engine
enum_devices = (
@@ -39,8 +38,10 @@ enum_devices = (
('GPU', "GPU Compute", "Use GPU compute device for rendering, configured in the system tab in the user preferences"),
)
if _cycles.with_network:
from _cycles import with_network
if with_network:
enum_devices += (('NETWORK', "Networked Device", "Use networked device for rendering"),)
del with_network
enum_feature_set = (
('SUPPORTED', "Supported", "Only use finished and supported features"),
@@ -184,6 +185,7 @@ enum_aov_types = (
def enum_openimagedenoise_denoiser(self, context):
import _cycles
if _cycles.with_openimagedenoise:
return [('OPENIMAGEDENOISE', "OpenImageDenoise", "Use Intel OpenImageDenoise AI denoiser running on the CPU", 4)]
return []
@@ -1599,15 +1601,20 @@ class CyclesPreferences(bpy.types.AddonPreferences):
elif entry.type == 'CPU':
cpu_devices.append(entry)
# Extend all GPU devices with CPU.
if compute_device_type in ('CUDA', 'OPENCL'):
if compute_device_type in {'CUDA', 'OPENCL'}:
devices.extend(cpu_devices)
return devices
# For backwards compatibility, only returns CUDA and OpenCL but still
# refreshes all devices.
def get_devices(self, compute_device_type=''):
import _cycles
# Ensure `self.devices` is not re-allocated when the second call to
# get_devices_for_type is made, freeing items from the first list.
for device_type in ('CUDA', 'OPTIX', 'OPENCL'):
self.update_device_entries(_cycles.available_devices(device_type))
cuda_devices = self.get_devices_for_type('CUDA')
self.get_devices_for_type('OPTIX')
opencl_devices = self.get_devices_for_type('OPENCL')
return cuda_devices, opencl_devices

View File

@@ -410,6 +410,12 @@ static PyObject *available_devices_func(PyObject * /*self*/, PyObject *args)
}
DeviceType type = Device::type_from_string(type_name);
/* "NONE" is defined by the add-on, see: `CyclesPreferences.get_device_types`. */
if ((type == DEVICE_NONE) && (strcmp(type_name, "NONE") != 0)) {
PyErr_Format(PyExc_ValueError, "Device \"%s\" not known.", type_name);
return NULL;
}
uint mask = (type == DEVICE_NONE) ? DEVICE_MASK_ALL : DEVICE_MASK(type);
mask |= DEVICE_MASK_CPU;

View File

@@ -151,6 +151,11 @@ void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d
const bool is_geometry = object_is_geometry(b_ob);
const bool is_light = !is_geometry && object_is_light(b_ob);
if (b_ob.is_instancer() && b_update->is_updated_shading()) {
/* Needed for e.g. object color updates on instancer. */
object_map.set_recalc(b_ob);
}
if (is_geometry || is_light) {
const bool updated_geometry = b_update->is_updated_geometry();

View File

@@ -105,7 +105,7 @@ class BVHSpatialSplit {
/* Lower-level functions which calculates boundaries of left and right nodes
* needed for spatial split.
*
* Operates directly with primitive specified by it's index, reused by higher
* Operates directly with primitive specified by its index, reused by higher
* level splitting functions.
*/
void split_triangle_primitive(const Mesh *mesh,

View File

@@ -86,7 +86,12 @@ endmacro()
# Cycles library dependencies common to all executables
macro(cycles_link_directories)
function(cycles_link_directories)
if(APPLE)
# APPLE plaform uses full paths for linking libraries, and avoids link_directories.
return()
endif()
if(WITH_OPENCOLORIO)
link_directories(${OPENCOLORIO_LIBPATH})
endif()
@@ -110,7 +115,7 @@ macro(cycles_link_directories)
${OPENEXR_LIBPATH}
${OPENJPEG_LIBPATH}
)
endmacro()
endfunction()
macro(cycles_target_link_libraries target)
if(WITH_CYCLES_LOGGING)

View File

@@ -98,7 +98,7 @@ void Node::set(const SocketType &input, float value)
void Node::set(const SocketType &input, float2 value)
{
assert(input.type == SocketType::FLOAT);
assert(input.type == SocketType::POINT2);
set_if_different(input, value);
}
@@ -165,7 +165,7 @@ void Node::set(const SocketType &input, array<float> &value)
void Node::set(const SocketType &input, array<float2> &value)
{
assert(input.type == SocketType::FLOAT_ARRAY);
assert(input.type == SocketType::POINT2_ARRAY);
set_if_different(input, value);
}
@@ -189,7 +189,7 @@ void Node::set(const SocketType &input, array<Transform> &value)
void Node::set(const SocketType &input, array<Node *> &value)
{
assert(input.type == SocketType::TRANSFORM_ARRAY);
assert(input.type == SocketType::NODE_ARRAY);
set_if_different(input, value);
}

View File

@@ -267,8 +267,8 @@ struct NodeType {
##__VA_ARGS__)
#define SOCKET_NODE_ARRAY(name, ui_name, node_type, ...) \
{ \
static Node *defval = NULL; \
assert(SOCKET_SIZEOF(T, name) == sizeof(Node *)); \
static array<Node *> defval = {}; \
assert(SOCKET_SIZEOF(T, name) == sizeof(array<Node *>)); \
type->register_input(ustring(#name), \
ustring(ui_name), \
SocketType::NODE_ARRAY, \

View File

@@ -379,11 +379,11 @@ if(WITH_CYCLES_CUDA_BINARIES)
set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}")
# warn for other versions
if((CUDA_VERSION MATCHES "101") OR (CUDA_VERSION MATCHES "102"))
if((CUDA_VERSION MATCHES "101") OR (CUDA_VERSION MATCHES "102") OR (CUDA_VERSION MATCHES "111"))
else()
message(WARNING
"CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, "
"build may succeed but only CUDA 10.1 and 10.2 are officially supported")
"build may succeed but only CUDA 10.1, 10.2 and 11.1 are officially supported")
endif()
# build for each arch
@@ -455,10 +455,10 @@ if(WITH_CYCLES_CUDA_BINARIES)
# cycles_cubin_cc since the env variable is read before main()
if(APPLE)
set(CUBIN_CC_ENV ${CMAKE_COMMAND}
-E env DYLD_LIBRARY_PATH="${CUDA_TOOLKIT_ROOT_DIR}/lib")
-E env DYLD_LIBRARY_PATH="${cuda_toolkit_root_dir}/lib")
elseif(UNIX)
set(CUBIN_CC_ENV ${CMAKE_COMMAND}
-E env LD_LIBRARY_PATH="${CUDA_TOOLKIT_ROOT_DIR}/lib64")
-E env LD_LIBRARY_PATH="${cuda_toolkit_root_dir}/lib64")
endif()
add_custom_command(
@@ -469,12 +469,12 @@ if(WITH_CYCLES_CUDA_BINARIES)
-i ${CMAKE_CURRENT_SOURCE_DIR}${cuda_kernel_src}
${cuda_flags}
-v
-cuda-toolkit-dir "${CUDA_TOOLKIT_ROOT_DIR}"
-cuda-toolkit-dir "${cuda_toolkit_root_dir}"
DEPENDS ${kernel_sources} cycles_cubin_cc)
else()
add_custom_command(
OUTPUT ${cuda_file}
COMMAND ${CUDA_NVCC_EXECUTABLE}
COMMAND ${cuda_nvcc_executable}
-arch=${arch}
${CUDA_NVCC_FLAGS}
--${format}
@@ -491,11 +491,35 @@ if(WITH_CYCLES_CUDA_BINARIES)
set(prev_arch "none")
foreach(arch ${CYCLES_CUDA_BINARIES_ARCH})
if(${arch} MATCHES "sm_2.")
if(${arch} MATCHES ".*_2.")
message(STATUS "CUDA binaries for ${arch} are no longer supported, skipped.")
elseif(${arch} MATCHES "sm_7." AND ${CUDA_VERSION} LESS 100)
elseif(${arch} MATCHES ".*_30")
if(DEFINED CUDA10_NVCC_EXECUTABLE)
set(cuda_nvcc_executable ${CUDA10_NVCC_EXECUTABLE})
set(cuda_toolkit_root_dir ${CUDA10_TOOLKIT_ROOT_DIR})
elseif(${CUDA_VERSION} LESS 110) # Support for sm_30 was removed in CUDA 11
set(cuda_nvcc_executable ${CUDA_NVCC_EXECUTABLE})
set(cuda_toolkit_root_dir ${CUDA_TOOLKIT_ROOT_DIR})
else()
message(STATUS "CUDA binaries for ${arch} require CUDA 10 or earlier, skipped.")
endif()
elseif(${arch} MATCHES ".*_7." AND ${CUDA_VERSION} LESS 100)
message(STATUS "CUDA binaries for ${arch} require CUDA 10.0+, skipped.")
elseif(${arch} MATCHES ".*_8.")
if(DEFINED CUDA11_NVCC_EXECUTABLE)
set(cuda_nvcc_executable ${CUDA11_NVCC_EXECUTABLE})
set(cuda_toolkit_root_dir ${CUDA11_TOOLKIT_ROOT_DIR})
elseif(${CUDA_VERSION} GREATER_EQUAL 111) # Support for sm_86 was introduced in CUDA 11
set(cuda_nvcc_executable ${CUDA_NVCC_EXECUTABLE})
set(cuda_toolkit_root_dir ${CUDA_TOOLKIT_ROOT_DIR})
else()
message(STATUS "CUDA binaries for ${arch} require CUDA 11.1+, skipped.")
endif()
else()
set(cuda_nvcc_executable ${CUDA_NVCC_EXECUTABLE})
set(cuda_toolkit_root_dir ${CUDA_TOOLKIT_ROOT_DIR})
endif()
if(DEFINED cuda_nvcc_executable AND DEFINED cuda_toolkit_root_dir)
# Compile regular kernel
CYCLES_CUDA_KERNEL_ADD(${arch} ${prev_arch} filter "" "${cuda_filter_sources}" FALSE)
CYCLES_CUDA_KERNEL_ADD(${arch} ${prev_arch} kernel "" "${cuda_sources}" FALSE)
@@ -508,6 +532,9 @@ if(WITH_CYCLES_CUDA_BINARIES)
if(WITH_CYCLES_CUDA_BUILD_SERIAL)
set(prev_arch ${arch})
endif()
unset(cuda_nvcc_executable)
unset(cuda_toolkit_root_dir)
endif()
endforeach()

View File

@@ -777,7 +777,7 @@ ccl_device void kernel_volume_decoupled_record(KernelGlobals *kg,
*
* This gives us restrictions that decoupled record should only happen
* in the stack manner, meaning if there's subsequent call of decoupled
* record it'll need to free memory before it's caller frees memory.
* record it'll need to free memory before its caller frees memory.
*/
const int index = kg->decoupled_volume_steps_index;
assert(index < sizeof(kg->decoupled_volume_steps) / sizeof(*kg->decoupled_volume_steps));

View File

@@ -20,7 +20,7 @@
/* Shader Virtual Machine
*
* A shader is a list of nodes to be executed. These are simply read one after
* the other and executed, using an node counter. Each node and it's associated
* the other and executed, using an node counter. Each node and its associated
* data is encoded as one or more uint4's in a 1D texture. If the data is larger
* than an uint4, the node can increase the node counter to compensate for this.
* Floats are encoded as int and then converted to float again.

View File

@@ -1129,7 +1129,7 @@ void GeometryManager::device_update_preprocess(Device *device, Scene *scene, Pro
}
}
if (need_update && geom->type == Geometry::VOLUME) {
if (geom->need_update_rebuild && geom->type == Geometry::VOLUME) {
/* Create volume meshes if there is voxel data. */
if (!volume_images_updated) {
progress.set_status("Updating Meshes Volume Bounds");

View File

@@ -76,9 +76,9 @@ OSLShaderManager::~OSLShaderManager()
void OSLShaderManager::free_memory()
{
# ifdef OSL_HAS_BLENDER_CLEANUP_FIX
/* There is a problem with llvm+osl: The order global destructors across
/* There is a problem with LLVM+OSL: The order global destructors across
* different compilation units run cannot be guaranteed, on windows this means
* that the llvm destructors run before the osl destructors, causing a crash
* that the LLVM destructors run before the osl destructors, causing a crash
* when the process exits. the OSL in svn has a special cleanup hack to
* sidestep this behavior */
OSL::pvt::LLVM_Util::Cleanup();

View File

@@ -380,20 +380,20 @@ string SceneUpdateStats::full_report()
void SceneUpdateStats::clear()
{
geometry.times.entries.clear();
image.times.entries.clear();
light.times.entries.clear();
object.times.entries.clear();
background.times.entries.clear();
bake.times.entries.clear();
camera.times.entries.clear();
film.times.entries.clear();
integrator.times.entries.clear();
osl.times.entries.clear();
particles.times.entries.clear();
scene.times.entries.clear();
svm.times.entries.clear();
tables.times.entries.clear();
geometry.times.clear();
image.times.clear();
light.times.clear();
object.times.clear();
background.times.clear();
bake.times.clear();
camera.times.clear();
film.times.clear();
integrator.times.clear();
osl.times.clear();
particles.times.clear();
scene.times.clear();
svm.times.clear();
tables.times.clear();
}
CCL_NAMESPACE_END

View File

@@ -94,6 +94,12 @@ class NamedTimeStats {
* makes sure all accumulating values are properly updated.
*/
vector<NamedTimeEntry> entries;
void clear()
{
total_time = 0.0;
entries.clear();
}
};
class NamedNestedSampleStats {

View File

@@ -158,7 +158,7 @@ class TileManager {
*
* however viewport rendering expects tiles to be allocated in a special way,
* meaning image is being sliced horizontally first and every device handles
* it's own slice
* its own slice
*/
bool background;

View File

@@ -51,13 +51,17 @@ set(SRC
util_string_test.cpp
util_task_test.cpp
util_time_test.cpp
util_avxf_avx_test.cpp
util_avxf_avx2_test.cpp
util_transform_test.cpp
)
set_source_files_properties(util_avxf_avx_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}")
set_source_files_properties(util_avxf_avx2_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}")
if(CXX_HAS_AVX)
list(APPEND SRC util_avxf_avx_test.cpp)
set_source_files_properties(util_avxf_avx_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}")
endif()
if(CXX_HAS_AVX2)
list(APPEND SRC util_avxf_avx2_test.cpp)
set_source_files_properties(util_avxf_avx2_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}")
endif()
if(WITH_GTESTS)
BLENDER_SRC_GTEST(cycles "${SRC}" "${ALL_CYCLES_LIBRARIES}")

View File

@@ -40,9 +40,9 @@ namespace {
template<typename T> class ShaderNodeBuilder {
public:
ShaderNodeBuilder(const string &name) : name_(name)
ShaderNodeBuilder(ShaderGraph &graph, const string &name) : name_(name)
{
node_ = new T();
node_ = graph.create_node<T>();
node_->name = name;
}
@@ -121,8 +121,8 @@ class ShaderGraphBuilder {
/* Common input/output boilerplate. */
ShaderGraphBuilder &add_attribute(const string &name)
{
return (*this).add_node(
ShaderNodeBuilder<AttributeNode>(name).set(&AttributeNode::attribute, ustring(name)));
return (*this).add_node(ShaderNodeBuilder<AttributeNode>(*graph_, name)
.set(&AttributeNode::attribute, ustring(name)));
}
ShaderGraphBuilder &output_closure(const string &from)
@@ -133,7 +133,7 @@ class ShaderGraphBuilder {
ShaderGraphBuilder &output_color(const string &from)
{
return (*this)
.add_node(ShaderNodeBuilder<EmissionNode>("EmissionNode"))
.add_node(ShaderNodeBuilder<EmissionNode>(*graph_, "EmissionNode"))
.add_connection(from, "EmissionNode::Color")
.output_closure("EmissionNode::Emission");
}
@@ -141,11 +141,16 @@ class ShaderGraphBuilder {
ShaderGraphBuilder &output_value(const string &from)
{
return (*this)
.add_node(ShaderNodeBuilder<EmissionNode>("EmissionNode"))
.add_node(ShaderNodeBuilder<EmissionNode>(*graph_, "EmissionNode"))
.add_connection(from, "EmissionNode::Strength")
.output_closure("EmissionNode::Emission");
}
ShaderGraph &graph()
{
return *graph_;
}
protected:
ShaderGraph *graph_;
map<string, ShaderNode *> node_map_;
@@ -203,14 +208,15 @@ TEST_F(RenderGraph, deduplicate_deep)
CORRECT_INFO_MESSAGE(log, "Folding Value2::Value to constant (0.8).");
CORRECT_INFO_MESSAGE(log, "Deduplicated 2 nodes.");
builder.add_node(ShaderNodeBuilder<GeometryNode>("Geometry1"))
.add_node(ShaderNodeBuilder<GeometryNode>("Geometry2"))
.add_node(ShaderNodeBuilder<ValueNode>("Value1").set(&ValueNode::value, 0.8f))
.add_node(ShaderNodeBuilder<ValueNode>("Value2").set(&ValueNode::value, 0.8f))
.add_node(ShaderNodeBuilder<NoiseTextureNode>("Noise1"))
.add_node(ShaderNodeBuilder<NoiseTextureNode>("Noise2"))
.add_node(
ShaderNodeBuilder<MixNode>("Mix").set(&MixNode::type, NODE_MIX_BLEND).set("Fac", 0.5f))
builder.add_node(ShaderNodeBuilder<GeometryNode>(graph, "Geometry1"))
.add_node(ShaderNodeBuilder<GeometryNode>(graph, "Geometry2"))
.add_node(ShaderNodeBuilder<ValueNode>(graph, "Value1").set(&ValueNode::value, 0.8f))
.add_node(ShaderNodeBuilder<ValueNode>(graph, "Value2").set(&ValueNode::value, 0.8f))
.add_node(ShaderNodeBuilder<NoiseTextureNode>(graph, "Noise1"))
.add_node(ShaderNodeBuilder<NoiseTextureNode>(graph, "Noise2"))
.add_node(ShaderNodeBuilder<MixNode>(graph, "Mix")
.set(&MixNode::type, NODE_MIX_BLEND)
.set("Fac", 0.5f))
.add_connection("Geometry1::Parametric", "Noise1::Vector")
.add_connection("Value1::Value", "Noise1::Scale")
.add_connection("Noise1::Color", "Mix::Color1")
@@ -235,7 +241,7 @@ TEST_F(RenderGraph, constant_fold_rgb_to_bw)
"Folding convert_float_to_color::value_color to constant (0.8, 0.8, 0.8).");
builder
.add_node(ShaderNodeBuilder<RGBToBWNode>("RGBToBWNodeNode")
.add_node(ShaderNodeBuilder<RGBToBWNode>(graph, "RGBToBWNodeNode")
.set("Color", make_float3(0.8f, 0.8f, 0.8f)))
.output_color("RGBToBWNodeNode::Val");
@@ -252,8 +258,8 @@ TEST_F(RenderGraph, constant_fold_emission1)
CORRECT_INFO_MESSAGE(log, "Discarding closure Emission.");
builder
.add_node(
ShaderNodeBuilder<EmissionNode>("Emission").set("Color", make_float3(0.0f, 0.0f, 0.0f)))
.add_node(ShaderNodeBuilder<EmissionNode>(graph, "Emission")
.set("Color", make_float3(0.0f, 0.0f, 0.0f)))
.output_closure("Emission::Emission");
graph.finalize(scene);
@@ -264,7 +270,7 @@ TEST_F(RenderGraph, constant_fold_emission2)
EXPECT_ANY_MESSAGE(log);
CORRECT_INFO_MESSAGE(log, "Discarding closure Emission.");
builder.add_node(ShaderNodeBuilder<EmissionNode>("Emission").set("Strength", 0.0f))
builder.add_node(ShaderNodeBuilder<EmissionNode>(graph, "Emission").set("Strength", 0.0f))
.output_closure("Emission::Emission");
graph.finalize(scene);
@@ -280,7 +286,7 @@ TEST_F(RenderGraph, constant_fold_background1)
CORRECT_INFO_MESSAGE(log, "Discarding closure Background.");
builder
.add_node(ShaderNodeBuilder<BackgroundNode>("Background")
.add_node(ShaderNodeBuilder<BackgroundNode>(graph, "Background")
.set("Color", make_float3(0.0f, 0.0f, 0.0f)))
.output_closure("Background::Background");
@@ -292,7 +298,7 @@ TEST_F(RenderGraph, constant_fold_background2)
EXPECT_ANY_MESSAGE(log);
CORRECT_INFO_MESSAGE(log, "Discarding closure Background.");
builder.add_node(ShaderNodeBuilder<BackgroundNode>("Background").set("Strength", 0.0f))
builder.add_node(ShaderNodeBuilder<BackgroundNode>(graph, "Background").set("Strength", 0.0f))
.output_closure("Background::Background");
graph.finalize(scene);
@@ -309,10 +315,10 @@ TEST_F(RenderGraph, constant_fold_shader_add)
CORRECT_INFO_MESSAGE(log, "Folding AddClosure2::Closure to socket Diffuse::BSDF.");
INVALID_INFO_MESSAGE(log, "Folding AddClosure3");
builder.add_node(ShaderNodeBuilder<DiffuseBsdfNode>("Diffuse"))
.add_node(ShaderNodeBuilder<AddClosureNode>("AddClosure1"))
.add_node(ShaderNodeBuilder<AddClosureNode>("AddClosure2"))
.add_node(ShaderNodeBuilder<AddClosureNode>("AddClosure3"))
builder.add_node(ShaderNodeBuilder<DiffuseBsdfNode>(graph, "Diffuse"))
.add_node(ShaderNodeBuilder<AddClosureNode>(graph, "AddClosure1"))
.add_node(ShaderNodeBuilder<AddClosureNode>(graph, "AddClosure2"))
.add_node(ShaderNodeBuilder<AddClosureNode>(graph, "AddClosure3"))
.add_connection("Diffuse::BSDF", "AddClosure1::Closure1")
.add_connection("Diffuse::BSDF", "AddClosure2::Closure2")
.add_connection("AddClosure1::Closure", "AddClosure3::Closure1")
@@ -335,15 +341,15 @@ TEST_F(RenderGraph, constant_fold_shader_mix)
CORRECT_INFO_MESSAGE(log, "Folding MixClosure3::Closure to socket Diffuse::BSDF.");
builder.add_attribute("Attribute")
.add_node(ShaderNodeBuilder<DiffuseBsdfNode>("Diffuse"))
.add_node(ShaderNodeBuilder<DiffuseBsdfNode>(graph, "Diffuse"))
/* choose left */
.add_node(ShaderNodeBuilder<MixClosureNode>("MixClosure1").set("Fac", 0.0f))
.add_node(ShaderNodeBuilder<MixClosureNode>(graph, "MixClosure1").set("Fac", 0.0f))
.add_connection("Diffuse::BSDF", "MixClosure1::Closure1")
/* choose right */
.add_node(ShaderNodeBuilder<MixClosureNode>("MixClosure2").set("Fac", 1.0f))
.add_node(ShaderNodeBuilder<MixClosureNode>(graph, "MixClosure2").set("Fac", 1.0f))
.add_connection("Diffuse::BSDF", "MixClosure2::Closure2")
/* both inputs folded the same */
.add_node(ShaderNodeBuilder<MixClosureNode>("MixClosure3"))
.add_node(ShaderNodeBuilder<MixClosureNode>(graph, "MixClosure3"))
.add_connection("Attribute::Fac", "MixClosure3::Fac")
.add_connection("MixClosure1::Closure", "MixClosure3::Closure1")
.add_connection("MixClosure2::Closure", "MixClosure3::Closure2")
@@ -362,7 +368,7 @@ TEST_F(RenderGraph, constant_fold_invert)
CORRECT_INFO_MESSAGE(log, "Folding Invert::Color to constant (0.68, 0.5, 0.32).");
builder
.add_node(ShaderNodeBuilder<InvertNode>("Invert")
.add_node(ShaderNodeBuilder<InvertNode>(graph, "Invert")
.set("Fac", 0.8f)
.set("Color", make_float3(0.2f, 0.5f, 0.8f)))
.output_color("Invert::Color");
@@ -380,7 +386,7 @@ TEST_F(RenderGraph, constant_fold_invert_fac_0)
CORRECT_INFO_MESSAGE(log, "Folding Invert::Color to socket Attribute::Color.");
builder.add_attribute("Attribute")
.add_node(ShaderNodeBuilder<InvertNode>("Invert").set("Fac", 0.0f))
.add_node(ShaderNodeBuilder<InvertNode>(graph, "Invert").set("Fac", 0.0f))
.add_connection("Attribute::Color", "Invert::Color")
.output_color("Invert::Color");
@@ -397,7 +403,7 @@ TEST_F(RenderGraph, constant_fold_invert_fac_0_const)
CORRECT_INFO_MESSAGE(log, "Folding Invert::Color to constant (0.2, 0.5, 0.8).");
builder
.add_node(ShaderNodeBuilder<InvertNode>("Invert")
.add_node(ShaderNodeBuilder<InvertNode>(graph, "Invert")
.set("Fac", 0.0f)
.set("Color", make_float3(0.2f, 0.5f, 0.8f)))
.output_color("Invert::Color");
@@ -415,7 +421,7 @@ TEST_F(RenderGraph, constant_fold_mix_add)
CORRECT_INFO_MESSAGE(log, "Folding MixAdd::Color to constant (0.62, 1.14, 1.42).");
builder
.add_node(ShaderNodeBuilder<MixNode>("MixAdd")
.add_node(ShaderNodeBuilder<MixNode>(graph, "MixAdd")
.set(&MixNode::type, NODE_MIX_ADD)
.set(&MixNode::use_clamp, false)
.set("Fac", 0.8f)
@@ -436,7 +442,7 @@ TEST_F(RenderGraph, constant_fold_mix_add_clamp)
CORRECT_INFO_MESSAGE(log, "Folding MixAdd::Color to constant (0.62, 1, 1).");
builder
.add_node(ShaderNodeBuilder<MixNode>("MixAdd")
.add_node(ShaderNodeBuilder<MixNode>(graph, "MixAdd")
.set(&MixNode::type, NODE_MIX_ADD)
.set(&MixNode::use_clamp, true)
.set("Fac", 0.8f)
@@ -458,7 +464,7 @@ TEST_F(RenderGraph, constant_fold_part_mix_dodge_no_fac_0)
builder.add_attribute("Attribute1")
.add_attribute("Attribute2")
.add_node(ShaderNodeBuilder<MixNode>("Mix")
.add_node(ShaderNodeBuilder<MixNode>(graph, "Mix")
.set(&MixNode::type, NODE_MIX_DODGE)
.set(&MixNode::use_clamp, false)
.set("Fac", 0.0f))
@@ -480,7 +486,7 @@ TEST_F(RenderGraph, constant_fold_part_mix_light_no_fac_0)
builder.add_attribute("Attribute1")
.add_attribute("Attribute2")
.add_node(ShaderNodeBuilder<MixNode>("Mix")
.add_node(ShaderNodeBuilder<MixNode>(graph, "Mix")
.set(&MixNode::type, NODE_MIX_LIGHT)
.set(&MixNode::use_clamp, false)
.set("Fac", 0.0f))
@@ -502,7 +508,7 @@ TEST_F(RenderGraph, constant_fold_part_mix_burn_no_fac_0)
builder.add_attribute("Attribute1")
.add_attribute("Attribute2")
.add_node(ShaderNodeBuilder<MixNode>("Mix")
.add_node(ShaderNodeBuilder<MixNode>(graph, "Mix")
.set(&MixNode::type, NODE_MIX_BURN)
.set(&MixNode::use_clamp, false)
.set("Fac", 0.0f))
@@ -524,7 +530,7 @@ TEST_F(RenderGraph, constant_fold_part_mix_blend_clamped_no_fac_0)
builder.add_attribute("Attribute1")
.add_attribute("Attribute2")
.add_node(ShaderNodeBuilder<MixNode>("Mix")
.add_node(ShaderNodeBuilder<MixNode>(graph, "Mix")
.set(&MixNode::type, NODE_MIX_BLEND)
.set(&MixNode::use_clamp, true)
.set("Fac", 0.0f))
@@ -550,21 +556,21 @@ TEST_F(RenderGraph, constant_fold_part_mix_blend)
builder.add_attribute("Attribute1")
.add_attribute("Attribute2")
/* choose left */
.add_node(ShaderNodeBuilder<MixNode>("MixBlend1")
.add_node(ShaderNodeBuilder<MixNode>(graph, "MixBlend1")
.set(&MixNode::type, NODE_MIX_BLEND)
.set(&MixNode::use_clamp, false)
.set("Fac", 0.0f))
.add_connection("Attribute1::Color", "MixBlend1::Color1")
.add_connection("Attribute2::Color", "MixBlend1::Color2")
/* choose right */
.add_node(ShaderNodeBuilder<MixNode>("MixBlend2")
.add_node(ShaderNodeBuilder<MixNode>(graph, "MixBlend2")
.set(&MixNode::type, NODE_MIX_BLEND)
.set(&MixNode::use_clamp, false)
.set("Fac", 1.0f))
.add_connection("Attribute1::Color", "MixBlend2::Color2")
.add_connection("Attribute2::Color", "MixBlend2::Color1")
/* both inputs folded to Attribute1 */
.add_node(ShaderNodeBuilder<MixNode>("MixBlend3")
.add_node(ShaderNodeBuilder<MixNode>(graph, "MixBlend3")
.set(&MixNode::type, NODE_MIX_BLEND)
.set(&MixNode::use_clamp, false))
.add_connection("Attribute1::Fac", "MixBlend3::Fac")
@@ -585,7 +591,7 @@ TEST_F(RenderGraph, constant_fold_part_mix_sub_same_fac_bad)
INVALID_INFO_MESSAGE(log, "Folding Mix::");
builder.add_attribute("Attribute")
.add_node(ShaderNodeBuilder<MixNode>("Mix")
.add_node(ShaderNodeBuilder<MixNode>(graph, "Mix")
.set(&MixNode::type, NODE_MIX_SUB)
.set(&MixNode::use_clamp, true)
.set("Fac", 0.5f))
@@ -606,7 +612,7 @@ TEST_F(RenderGraph, constant_fold_part_mix_sub_same_fac_1)
CORRECT_INFO_MESSAGE(log, "Folding Mix::Color to constant (0, 0, 0).");
builder.add_attribute("Attribute")
.add_node(ShaderNodeBuilder<MixNode>("Mix")
.add_node(ShaderNodeBuilder<MixNode>(graph, "Mix")
.set(&MixNode::type, NODE_MIX_SUB)
.set(&MixNode::use_clamp, true)
.set("Fac", 1.0f))
@@ -628,11 +634,11 @@ static void build_mix_partial_test_graph(ShaderGraphBuilder &builder,
builder
.add_attribute("Attribute")
/* constant on the left */
.add_node(ShaderNodeBuilder<MixNode>("Mix_Cx_Fx")
.add_node(ShaderNodeBuilder<MixNode>(builder.graph(), "Mix_Cx_Fx")
.set(&MixNode::type, type)
.set(&MixNode::use_clamp, false)
.set("Color1", constval))
.add_node(ShaderNodeBuilder<MixNode>("Mix_Cx_F1")
.add_node(ShaderNodeBuilder<MixNode>(builder.graph(), "Mix_Cx_F1")
.set(&MixNode::type, type)
.set(&MixNode::use_clamp, false)
.set("Color1", constval)
@@ -641,11 +647,11 @@ static void build_mix_partial_test_graph(ShaderGraphBuilder &builder,
.add_connection("Attribute::Color", "Mix_Cx_Fx::Color2")
.add_connection("Attribute::Color", "Mix_Cx_F1::Color2")
/* constant on the right */
.add_node(ShaderNodeBuilder<MixNode>("Mix_xC_Fx")
.add_node(ShaderNodeBuilder<MixNode>(builder.graph(), "Mix_xC_Fx")
.set(&MixNode::type, type)
.set(&MixNode::use_clamp, false)
.set("Color2", constval))
.add_node(ShaderNodeBuilder<MixNode>("Mix_xC_F1")
.add_node(ShaderNodeBuilder<MixNode>(builder.graph(), "Mix_xC_F1")
.set(&MixNode::type, type)
.set(&MixNode::use_clamp, false)
.set("Color2", constval)
@@ -654,15 +660,15 @@ static void build_mix_partial_test_graph(ShaderGraphBuilder &builder,
.add_connection("Attribute::Color", "Mix_xC_Fx::Color1")
.add_connection("Attribute::Color", "Mix_xC_F1::Color1")
/* results of actual tests simply added up to connect to output */
.add_node(ShaderNodeBuilder<MixNode>("Out12")
.add_node(ShaderNodeBuilder<MixNode>(builder.graph(), "Out12")
.set(&MixNode::type, NODE_MIX_ADD)
.set(&MixNode::use_clamp, true)
.set("Fac", 1.0f))
.add_node(ShaderNodeBuilder<MixNode>("Out34")
.add_node(ShaderNodeBuilder<MixNode>(builder.graph(), "Out34")
.set(&MixNode::type, NODE_MIX_ADD)
.set(&MixNode::use_clamp, true)
.set("Fac", 1.0f))
.add_node(ShaderNodeBuilder<MixNode>("Out1234")
.add_node(ShaderNodeBuilder<MixNode>(builder.graph(), "Out1234")
.set(&MixNode::type, NODE_MIX_ADD)
.set(&MixNode::use_clamp, true)
.set("Fac", 1.0f))
@@ -796,9 +802,9 @@ TEST_F(RenderGraph, constant_fold_separate_combine_rgb)
CORRECT_INFO_MESSAGE(log, "Folding CombineRGB::Image to constant (0.3, 0.5, 0.7).");
builder
.add_node(ShaderNodeBuilder<SeparateRGBNode>("SeparateRGB")
.add_node(ShaderNodeBuilder<SeparateRGBNode>(graph, "SeparateRGB")
.set("Image", make_float3(0.3f, 0.5f, 0.7f)))
.add_node(ShaderNodeBuilder<CombineRGBNode>("CombineRGB"))
.add_node(ShaderNodeBuilder<CombineRGBNode>(graph, "CombineRGB"))
.add_connection("SeparateRGB::R", "CombineRGB::R")
.add_connection("SeparateRGB::G", "CombineRGB::G")
.add_connection("SeparateRGB::B", "CombineRGB::B")
@@ -821,9 +827,9 @@ TEST_F(RenderGraph, constant_fold_separate_combine_xyz)
log, "Folding convert_vector_to_color::value_color to constant (0.3, 0.5, 0.7).");
builder
.add_node(ShaderNodeBuilder<SeparateXYZNode>("SeparateXYZ")
.add_node(ShaderNodeBuilder<SeparateXYZNode>(graph, "SeparateXYZ")
.set("Vector", make_float3(0.3f, 0.5f, 0.7f)))
.add_node(ShaderNodeBuilder<CombineXYZNode>("CombineXYZ"))
.add_node(ShaderNodeBuilder<CombineXYZNode>(graph, "CombineXYZ"))
.add_connection("SeparateXYZ::X", "CombineXYZ::X")
.add_connection("SeparateXYZ::Y", "CombineXYZ::Y")
.add_connection("SeparateXYZ::Z", "CombineXYZ::Z")
@@ -844,9 +850,9 @@ TEST_F(RenderGraph, constant_fold_separate_combine_hsv)
CORRECT_INFO_MESSAGE(log, "Folding CombineHSV::Color to constant (0.3, 0.5, 0.7).");
builder
.add_node(ShaderNodeBuilder<SeparateHSVNode>("SeparateHSV")
.add_node(ShaderNodeBuilder<SeparateHSVNode>(graph, "SeparateHSV")
.set("Color", make_float3(0.3f, 0.5f, 0.7f)))
.add_node(ShaderNodeBuilder<CombineHSVNode>("CombineHSV"))
.add_node(ShaderNodeBuilder<CombineHSVNode>(graph, "CombineHSV"))
.add_connection("SeparateHSV::H", "CombineHSV::H")
.add_connection("SeparateHSV::S", "CombineHSV::S")
.add_connection("SeparateHSV::V", "CombineHSV::V")
@@ -864,7 +870,7 @@ TEST_F(RenderGraph, constant_fold_gamma)
CORRECT_INFO_MESSAGE(log, "Folding Gamma::Color to constant (0.164317, 0.353553, 0.585662).");
builder
.add_node(ShaderNodeBuilder<GammaNode>("Gamma")
.add_node(ShaderNodeBuilder<GammaNode>(graph, "Gamma")
.set("Color", make_float3(0.3f, 0.5f, 0.7f))
.set("Gamma", 1.5f))
.output_color("Gamma::Color");
@@ -884,14 +890,14 @@ TEST_F(RenderGraph, constant_fold_gamma_part_0)
builder
.add_attribute("Attribute")
/* constant on the left */
.add_node(
ShaderNodeBuilder<GammaNode>("Gamma_Cx").set("Color", make_float3(0.0f, 0.0f, 0.0f)))
.add_node(ShaderNodeBuilder<GammaNode>(graph, "Gamma_Cx")
.set("Color", make_float3(0.0f, 0.0f, 0.0f)))
.add_connection("Attribute::Fac", "Gamma_Cx::Gamma")
/* constant on the right */
.add_node(ShaderNodeBuilder<GammaNode>("Gamma_xC").set("Gamma", 0.0f))
.add_node(ShaderNodeBuilder<GammaNode>(graph, "Gamma_xC").set("Gamma", 0.0f))
.add_connection("Attribute::Color", "Gamma_xC::Color")
/* output sum */
.add_node(ShaderNodeBuilder<MixNode>("Out")
.add_node(ShaderNodeBuilder<MixNode>(graph, "Out")
.set(&MixNode::type, NODE_MIX_ADD)
.set(&MixNode::use_clamp, true)
.set("Fac", 1.0f))
@@ -914,14 +920,14 @@ TEST_F(RenderGraph, constant_fold_gamma_part_1)
builder
.add_attribute("Attribute")
/* constant on the left */
.add_node(
ShaderNodeBuilder<GammaNode>("Gamma_Cx").set("Color", make_float3(1.0f, 1.0f, 1.0f)))
.add_node(ShaderNodeBuilder<GammaNode>(graph, "Gamma_Cx")
.set("Color", make_float3(1.0f, 1.0f, 1.0f)))
.add_connection("Attribute::Fac", "Gamma_Cx::Gamma")
/* constant on the right */
.add_node(ShaderNodeBuilder<GammaNode>("Gamma_xC").set("Gamma", 1.0f))
.add_node(ShaderNodeBuilder<GammaNode>(graph, "Gamma_xC").set("Gamma", 1.0f))
.add_connection("Attribute::Color", "Gamma_xC::Color")
/* output sum */
.add_node(ShaderNodeBuilder<MixNode>("Out")
.add_node(ShaderNodeBuilder<MixNode>(graph, "Out")
.set(&MixNode::type, NODE_MIX_ADD)
.set(&MixNode::use_clamp, true)
.set("Fac", 1.0f))
@@ -941,7 +947,7 @@ TEST_F(RenderGraph, constant_fold_bright_contrast)
CORRECT_INFO_MESSAGE(log, "Folding BrightContrast::Color to constant (0.16, 0.6, 1.04).");
builder
.add_node(ShaderNodeBuilder<BrightContrastNode>("BrightContrast")
.add_node(ShaderNodeBuilder<BrightContrastNode>(graph, "BrightContrast")
.set("Color", make_float3(0.3f, 0.5f, 0.7f))
.set("Bright", 0.1f)
.set("Contrast", 1.2f))
@@ -958,7 +964,8 @@ TEST_F(RenderGraph, constant_fold_blackbody)
EXPECT_ANY_MESSAGE(log);
CORRECT_INFO_MESSAGE(log, "Folding Blackbody::Color to constant (3.94163, 0.226523, 0).");
builder.add_node(ShaderNodeBuilder<BlackbodyNode>("Blackbody").set("Temperature", 1200.0f))
builder
.add_node(ShaderNodeBuilder<BlackbodyNode>(graph, "Blackbody").set("Temperature", 1200.0f))
.output_color("Blackbody::Color");
graph.finalize(scene);
@@ -980,7 +987,7 @@ TEST_F(RenderGraph, constant_fold_math)
CORRECT_INFO_MESSAGE(log, "Folding Math::Value to constant (1.6).");
builder
.add_node(ShaderNodeBuilder<MathNode>("Math")
.add_node(ShaderNodeBuilder<MathNode>(graph, "Math")
.set(&MathNode::type, NODE_MATH_ADD)
.set(&MathNode::use_clamp, false)
.set("Value1", 0.7f)
@@ -999,7 +1006,7 @@ TEST_F(RenderGraph, constant_fold_math_clamp)
CORRECT_INFO_MESSAGE(log, "Folding clamp::Result to constant (1).");
builder
.add_node(ShaderNodeBuilder<MathNode>("Math")
.add_node(ShaderNodeBuilder<MathNode>(graph, "Math")
.set(&MathNode::type, NODE_MATH_ADD)
.set(&MathNode::use_clamp, true)
.set("Value1", 0.7f)
@@ -1020,19 +1027,19 @@ static void build_math_partial_test_graph(ShaderGraphBuilder &builder,
builder
.add_attribute("Attribute")
/* constant on the left */
.add_node(ShaderNodeBuilder<MathNode>("Math_Cx")
.add_node(ShaderNodeBuilder<MathNode>(builder.graph(), "Math_Cx")
.set(&MathNode::type, type)
.set(&MathNode::use_clamp, false)
.set("Value1", constval))
.add_connection("Attribute::Fac", "Math_Cx::Value2")
/* constant on the right */
.add_node(ShaderNodeBuilder<MathNode>("Math_xC")
.add_node(ShaderNodeBuilder<MathNode>(builder.graph(), "Math_xC")
.set(&MathNode::type, type)
.set(&MathNode::use_clamp, false)
.set("Value2", constval))
.add_connection("Attribute::Fac", "Math_xC::Value1")
/* output sum */
.add_node(ShaderNodeBuilder<MathNode>("Out")
.add_node(ShaderNodeBuilder<MathNode>(builder.graph(), "Out")
.set(&MathNode::type, NODE_MATH_ADD)
.set(&MathNode::use_clamp, true))
.add_connection("Math_Cx::Value", "Out::Value1")
@@ -1170,7 +1177,7 @@ TEST_F(RenderGraph, constant_fold_vector_math)
CORRECT_INFO_MESSAGE(log, "Folding VectorMath::Vector to constant (3, 0, 0).");
builder
.add_node(ShaderNodeBuilder<VectorMathNode>("VectorMath")
.add_node(ShaderNodeBuilder<VectorMathNode>(graph, "VectorMath")
.set(&VectorMathNode::type, NODE_VECTOR_MATH_SUBTRACT)
.set("Vector1", make_float3(1.3f, 0.5f, 0.7f))
.set("Vector2", make_float3(-1.7f, 0.5f, 0.7f)))
@@ -1190,18 +1197,18 @@ static void build_vecmath_partial_test_graph(ShaderGraphBuilder &builder,
builder
.add_attribute("Attribute")
/* constant on the left */
.add_node(ShaderNodeBuilder<VectorMathNode>("Math_Cx")
.add_node(ShaderNodeBuilder<VectorMathNode>(builder.graph(), "Math_Cx")
.set(&VectorMathNode::type, type)
.set("Vector1", constval))
.add_connection("Attribute::Vector", "Math_Cx::Vector2")
/* constant on the right */
.add_node(ShaderNodeBuilder<VectorMathNode>("Math_xC")
.add_node(ShaderNodeBuilder<VectorMathNode>(builder.graph(), "Math_xC")
.set(&VectorMathNode::type, type)
.set("Vector2", constval))
.add_connection("Attribute::Vector", "Math_xC::Vector1")
/* output sum */
.add_node(ShaderNodeBuilder<VectorMathNode>("Out").set(&VectorMathNode::type,
NODE_VECTOR_MATH_ADD))
.add_node(ShaderNodeBuilder<VectorMathNode>(builder.graph(), "Out")
.set(&VectorMathNode::type, NODE_VECTOR_MATH_ADD))
.add_connection("Math_Cx::Vector", "Out::Vector1")
.add_connection("Math_xC::Vector", "Out::Vector2")
.output_color("Out::Vector");
@@ -1261,8 +1268,8 @@ TEST_F(RenderGraph, constant_fold_bump)
EXPECT_ANY_MESSAGE(log);
CORRECT_INFO_MESSAGE(log, "Folding Bump::Normal to socket Geometry1::Normal.");
builder.add_node(ShaderNodeBuilder<GeometryNode>("Geometry1"))
.add_node(ShaderNodeBuilder<BumpNode>("Bump"))
builder.add_node(ShaderNodeBuilder<GeometryNode>(graph, "Geometry1"))
.add_node(ShaderNodeBuilder<BumpNode>(graph, "Bump"))
.add_connection("Geometry1::Normal", "Bump::Normal")
.output_color("Bump::Normal");
@@ -1277,7 +1284,7 @@ TEST_F(RenderGraph, constant_fold_bump_no_input)
EXPECT_ANY_MESSAGE(log);
CORRECT_INFO_MESSAGE(log, "Folding Bump::Normal to socket geometry::Normal.");
builder.add_node(ShaderNodeBuilder<BumpNode>("Bump")).output_color("Bump::Normal");
builder.add_node(ShaderNodeBuilder<BumpNode>(graph, "Bump")).output_color("Bump::Normal");
graph.finalize(scene);
}
@@ -1304,7 +1311,7 @@ TEST_F(RenderGraph, constant_fold_rgb_curves)
init_test_curve(curve, make_float3(0.0f, 0.25f, 1.0f), make_float3(1.0f, 0.75f, 0.0f), 257);
builder
.add_node(ShaderNodeBuilder<RGBCurvesNode>("Curves")
.add_node(ShaderNodeBuilder<RGBCurvesNode>(graph, "Curves")
.set(&CurvesNode::curves, curve)
.set(&CurvesNode::min_x, 0.1f)
.set(&CurvesNode::max_x, 0.9f)
@@ -1328,7 +1335,7 @@ TEST_F(RenderGraph, constant_fold_rgb_curves_fac_0)
init_test_curve(curve, make_float3(0.0f, 0.25f, 1.0f), make_float3(1.0f, 0.75f, 0.0f), 257);
builder.add_attribute("Attribute")
.add_node(ShaderNodeBuilder<RGBCurvesNode>("Curves")
.add_node(ShaderNodeBuilder<RGBCurvesNode>(graph, "Curves")
.set(&CurvesNode::curves, curve)
.set(&CurvesNode::min_x, 0.1f)
.set(&CurvesNode::max_x, 0.9f)
@@ -1352,7 +1359,7 @@ TEST_F(RenderGraph, constant_fold_rgb_curves_fac_0_const)
init_test_curve(curve, make_float3(0.0f, 0.25f, 1.0f), make_float3(1.0f, 0.75f, 0.0f), 257);
builder
.add_node(ShaderNodeBuilder<RGBCurvesNode>("Curves")
.add_node(ShaderNodeBuilder<RGBCurvesNode>(graph, "Curves")
.set(&CurvesNode::curves, curve)
.set(&CurvesNode::min_x, 0.1f)
.set(&CurvesNode::max_x, 0.9f)
@@ -1376,7 +1383,7 @@ TEST_F(RenderGraph, constant_fold_vector_curves)
init_test_curve(curve, make_float3(0.0f, 0.25f, 1.0f), make_float3(1.0f, 0.75f, 0.0f), 257);
builder
.add_node(ShaderNodeBuilder<VectorCurvesNode>("Curves")
.add_node(ShaderNodeBuilder<VectorCurvesNode>(graph, "Curves")
.set(&CurvesNode::curves, curve)
.set(&CurvesNode::min_x, 0.1f)
.set(&CurvesNode::max_x, 0.9f)
@@ -1400,7 +1407,7 @@ TEST_F(RenderGraph, constant_fold_vector_curves_fac_0)
init_test_curve(curve, make_float3(0.0f, 0.25f, 1.0f), make_float3(1.0f, 0.75f, 0.0f), 257);
builder.add_attribute("Attribute")
.add_node(ShaderNodeBuilder<VectorCurvesNode>("Curves")
.add_node(ShaderNodeBuilder<VectorCurvesNode>(graph, "Curves")
.set(&CurvesNode::curves, curve)
.set(&CurvesNode::min_x, 0.1f)
.set(&CurvesNode::max_x, 0.9f)
@@ -1427,12 +1434,12 @@ TEST_F(RenderGraph, constant_fold_rgb_ramp)
init_test_curve(alpha, 0.75f, 1.0f, 9);
builder
.add_node(ShaderNodeBuilder<RGBRampNode>("Ramp")
.add_node(ShaderNodeBuilder<RGBRampNode>(graph, "Ramp")
.set(&RGBRampNode::ramp, curve)
.set(&RGBRampNode::ramp_alpha, alpha)
.set(&RGBRampNode::interpolate, true)
.set("Fac", 0.56f))
.add_node(ShaderNodeBuilder<MixNode>("Mix").set(&MixNode::type, NODE_MIX_ADD))
.add_node(ShaderNodeBuilder<MixNode>(graph, "Mix").set(&MixNode::type, NODE_MIX_ADD))
.add_connection("Ramp::Color", "Mix::Color1")
.add_connection("Ramp::Alpha", "Mix::Color2")
.output_color("Mix::Color");
@@ -1456,12 +1463,12 @@ TEST_F(RenderGraph, constant_fold_rgb_ramp_flat)
init_test_curve(alpha, 0.75f, 1.0f, 9);
builder
.add_node(ShaderNodeBuilder<RGBRampNode>("Ramp")
.add_node(ShaderNodeBuilder<RGBRampNode>(graph, "Ramp")
.set(&RGBRampNode::ramp, curve)
.set(&RGBRampNode::ramp_alpha, alpha)
.set(&RGBRampNode::interpolate, false)
.set("Fac", 0.56f))
.add_node(ShaderNodeBuilder<MixNode>("Mix").set(&MixNode::type, NODE_MIX_ADD))
.add_node(ShaderNodeBuilder<MixNode>(graph, "Mix").set(&MixNode::type, NODE_MIX_ADD))
.add_connection("Ramp::Color", "Mix::Color1")
.add_connection("Ramp::Alpha", "Mix::Color2")
.output_color("Mix::Color");
@@ -1482,7 +1489,7 @@ TEST_F(RenderGraph, constant_fold_convert_float_color_float)
"Folding convert_color_to_float::value_float to socket Attribute::Fac.");
builder.add_attribute("Attribute")
.add_node(ShaderNodeBuilder<InvertNode>("Invert").set("Fac", 0.0f))
.add_node(ShaderNodeBuilder<InvertNode>(graph, "Invert").set("Fac", 0.0f))
.add_connection("Attribute::Fac", "Invert::Color")
.output_value("Invert::Color");
@@ -1502,7 +1509,7 @@ TEST_F(RenderGraph, constant_fold_convert_color_vector_color)
"Folding convert_vector_to_color::value_color to socket Attribute::Color.");
builder.add_attribute("Attribute")
.add_node(ShaderNodeBuilder<VectorMathNode>("VecAdd")
.add_node(ShaderNodeBuilder<VectorMathNode>(graph, "VecAdd")
.set(&VectorMathNode::type, NODE_VECTOR_MATH_ADD)
.set("Vector2", make_float3(0, 0, 0)))
.add_connection("Attribute::Color", "VecAdd::Vector1")
@@ -1523,7 +1530,7 @@ TEST_F(RenderGraph, constant_fold_convert_color_float_color)
INVALID_INFO_MESSAGE(log, "Folding convert_float_to_color::");
builder.add_attribute("Attribute")
.add_node(ShaderNodeBuilder<MathNode>("MathAdd")
.add_node(ShaderNodeBuilder<MathNode>(graph, "MathAdd")
.set(&MathNode::type, NODE_MATH_ADD)
.set("Value2", 0.0f))
.add_connection("Attribute::Color", "MathAdd::Value1")

View File

@@ -141,7 +141,7 @@ ccl_device_inline float4 half4_to_float4(half4 h)
ccl_device_inline half float_to_half(float f)
{
const uint u = __float_as_uint(f);
/* Sign bit, shifted to it's position. */
/* Sign bit, shifted to its position. */
uint sign_bit = u & 0x80000000;
sign_bit >>= 16;
/* Exponent. */

View File

@@ -1996,7 +1996,7 @@ int Octree::floodFill(LeafNode *leaf, int st[3], int len, int /*height*/, int th
delete queue;
continue;
}
dc_printf("Less then %d, removing...\n", threshold);
dc_printf("Less than %d, removing...\n", threshold);
// We have to remove this noise

View File

@@ -38,10 +38,10 @@
*/
/* Global defines */
// Uncomment to see debug information
/* Uncomment to see debug information */
// #define IN_DEBUG_MODE
// Uncomment to see more output messages during repair
/* Uncomment to see more output messages during repair */
// #define IN_VERBOSE_MODE
/* Set scan convert params */
@@ -65,19 +65,19 @@ struct InternalNode {
/* Can have up to eight children */
Node *children[0];
/// Test if child is leaf
/** Test if child is leaf */
int is_child_leaf(int index) const
{
return (child_is_leaf_bitfield >> index) & 1;
}
/// If child index exists
/** If child index exists */
int has_child(int index) const
{
return (has_child_bitfield >> index) & 1;
}
/// Get the pointer to child index
/** Get the pointer to child index */
Node *get_child(int count)
{
return children[count];
@@ -88,13 +88,13 @@ struct InternalNode {
return children[count];
}
/// Get total number of children
/** Get total number of children */
int get_num_children() const
{
return numChildrenTable[has_child_bitfield];
}
/// Get the count of children
/** Get the count of children */
int get_child_count(int index) const
{
return childrenCountTable[has_child_bitfield][index];
@@ -108,7 +108,7 @@ struct InternalNode {
return childrenCountTable[has_child_bitfield];
}
/// Get all children
/** Get all children */
void fill_children(Node *children[8], int leaf[8])
{
int count = 0;
@@ -125,7 +125,7 @@ struct InternalNode {
}
}
/// Sets the child pointer
/** Sets the child pointer */
void set_child(int count, Node *chd)
{
children[count] = chd;
@@ -195,22 +195,22 @@ extern const int dirEdge[3][4];
*/
struct PathElement {
// Origin
/* Origin */
int pos[3];
// link
/* link */
PathElement *next;
};
struct PathList {
// Head
/* Head */
PathElement *head;
PathElement *tail;
// Length of the list
/* Length of the list */
int length;
// Next list
/* Next list */
PathList *next;
};
@@ -221,31 +221,31 @@ class Octree {
public:
/* Public members */
/// Memory allocators
/** Memory allocators */
VirtualMemoryAllocator *alloc[9];
VirtualMemoryAllocator *leafalloc[4];
/// Root node
/** Root node */
Node *root;
/// Model reader
/** Model reader */
ModelReader *reader;
/// Marching cubes table
/** Marching cubes table */
Cubes *cubes;
/// Length of grid
/** Length of grid */
int dimen;
int mindimen, minshift;
/// Maximum depth
/** Maximum depth */
int maxDepth;
/// The lower corner of the bounding box and the size
/** The lower corner of the bounding box and the size */
float origin[3];
float range;
/// Counting information
/** Counting information */
int nodeCount;
int nodeSpace;
int nodeCounts[9];
@@ -255,9 +255,9 @@ class Octree {
PathList *ringList;
int maxTrianglePerCell;
int outType; // 0 for OFF, 1 for PLY, 2 for VOL
int outType; /* 0 for OFF, 1 for PLY, 2 for VOL */
// For flood filling
/* For flood filling */
int use_flood_fill;
float thresh;
@@ -469,11 +469,11 @@ class Octree {
private:
/************ Operators for all nodes ************/
/// Lookup table
/** Lookup table */
int numEdgeTable[8];
int edgeCountTable[8][3];
/// Build up lookup table
/** Build up lookup table */
void buildTable()
{
for (int i = 0; i < 256; i++) {
@@ -550,13 +550,13 @@ class Octree {
printf("\n");
}
/// Retrieve signs
/** Retrieve signs */
int getSign(const LeafNode *leaf, int index)
{
return ((leaf->signs >> index) & 1);
}
/// Set sign
/** Set sign */
void setSign(LeafNode *leaf, int index)
{
leaf->signs |= (1 << index);
@@ -624,7 +624,7 @@ class Octree {
return (leaf->flood_fill >> eind) & 1;
}
/// Generate signs at the corners from the edge parity
/** Generate signs at the corners from the edge parity */
void generateSigns(LeafNode *leaf, unsigned char table[], int start)
{
leaf->signs = table[leaf->edge_parity];
@@ -634,7 +634,7 @@ class Octree {
}
}
/// Get edge parity
/** Get edge parity */
int getEdgeParity(const LeafNode *leaf, int index) const
{
assert(index >= 0 && index <= 11);
@@ -642,7 +642,7 @@ class Octree {
return (leaf->edge_parity >> index) & 1;
}
/// Get edge parity on a face
/** Get edge parity on a face */
int getFaceParity(LeafNode *leaf, int index)
{
int a = getEdgeParity(leaf, faceMap[index][0]) + getEdgeParity(leaf, faceMap[index][1]) +
@@ -656,7 +656,7 @@ class Octree {
return a;
}
/// Set edge parity
/** Set edge parity */
void flipEdge(LeafNode *leaf, int index)
{
assert(index >= 0 && index <= 11);
@@ -664,7 +664,7 @@ class Octree {
leaf->edge_parity ^= (1 << index);
}
/// Set 1
/** Set 1 */
void setEdge(LeafNode *leaf, int index)
{
assert(index >= 0 && index <= 11);
@@ -672,7 +672,7 @@ class Octree {
leaf->edge_parity |= (1 << index);
}
/// Set 0
/** Set 0 */
void resetEdge(LeafNode *leaf, int index)
{
assert(index >= 0 && index <= 11);
@@ -680,7 +680,7 @@ class Octree {
leaf->edge_parity &= ~(1 << index);
}
/// Flipping with a new intersection offset
/** Flipping with a new intersection offset */
void createPrimalEdgesMask(LeafNode *leaf)
{
leaf->primary_edge_intersections = getPrimalEdgesMask2(leaf);
@@ -707,7 +707,7 @@ class Octree {
if ((index & 3) == 0) {
int ind = index / 4;
if (getEdgeParity(leaf, index) && !getStoredEdgesParity(leaf, ind)) {
// Create a new node
/* Create a new node */
int num = getNumEdges(leaf) + 1;
setStoredEdgesParity(leaf, ind);
int count = getEdgeCount(leaf, ind);
@@ -739,14 +739,14 @@ class Octree {
return leaf;
}
/// Update parent link
/** Update parent link */
void updateParent(InternalNode *node, int len, int st[3], LeafNode *leaf)
{
// First, locate the parent
/* First, locate the parent */
int count;
InternalNode *parent = locateParent(node, len, st, count);
// Update
/* Update */
parent->set_child(count, (Node *)leaf);
}
@@ -757,18 +757,18 @@ class Octree {
return;
}
// First, locate the parent
/* First, locate the parent */
int count;
InternalNode *parent = locateParent(len, st, count);
// UPdate
/* Update */
parent->set_child(count, (Node *)node);
}
/// Find edge intersection on a given edge
/** Find edge intersection on a given edge */
int getEdgeIntersectionByIndex(int st[3], int index, float pt[3], int check) const
{
// First, locat the leaf
/* First, locat the leaf */
const LeafNode *leaf;
if (check) {
leaf = locateLeafCheck(st);
@@ -791,7 +791,7 @@ class Octree {
}
}
/// Retrieve number of edges intersected
/** Retrieve number of edges intersected */
int getPrimalEdgesMask(const LeafNode *leaf) const
{
return leaf->primary_edge_intersections;
@@ -803,7 +803,7 @@ class Octree {
((leaf->edge_parity & 0x100) >> 6));
}
/// Get the count for a primary edge
/** Get the count for a primary edge */
int getEdgeCount(const LeafNode *leaf, int index) const
{
return edgeCountTable[getPrimalEdgesMask(leaf)][index];
@@ -818,7 +818,7 @@ class Octree {
return numEdgeTable[getPrimalEdgesMask2(leaf)];
}
/// Set edge intersection
/** Set edge intersection */
void setEdgeOffset(LeafNode *leaf, float pt, int count)
{
float *pts = leaf->edge_intersections;
@@ -828,7 +828,7 @@ class Octree {
pts[EDGE_FLOATS * count + 3] = 0;
}
/// Set multiple edge intersections
/** Set multiple edge intersections */
void setEdgeOffsets(LeafNode *leaf, float pt[3], int len)
{
float *pts = leaf->edge_intersections;
@@ -837,35 +837,35 @@ class Octree {
}
}
/// Retrieve edge intersection
/** Retrieve edge intersection */
float getEdgeOffset(const LeafNode *leaf, int count) const
{
return leaf->edge_intersections[4 * count];
}
/// Update method
/** Update method */
LeafNode *updateEdgeOffsets(LeafNode *leaf, int oldlen, int newlen, float offs[3])
{
// First, create a new leaf node
/* First, create a new leaf node */
LeafNode *nleaf = createLeaf(newlen);
*nleaf = *leaf;
// Next, fill in the offsets
/* Next, fill in the offsets */
setEdgeOffsets(nleaf, offs, newlen);
// Finally, delete the old leaf
/* Finally, delete the old leaf */
removeLeaf(oldlen, leaf);
return nleaf;
}
/// Set minimizer index
/** Set minimizer index */
void setMinimizerIndex(LeafNode *leaf, int index)
{
leaf->minimizer_index = index;
}
/// Get minimizer index
/** Get minimizer index */
int getMinimizerIndex(LeafNode *leaf)
{
return leaf->minimizer_index;
@@ -890,7 +890,7 @@ class Octree {
}
}
/// Set edge intersection
/** Set edge intersection */
void setEdgeOffsetNormal(LeafNode *leaf, float pt, float a, float b, float c, int count)
{
float *pts = leaf->edge_intersections;
@@ -909,7 +909,7 @@ class Octree {
return pts[4 * count];
}
/// Set multiple edge intersections
/** Set multiple edge intersections */
void setEdgeOffsetsNormals(
LeafNode *leaf, const float pt[], const float a[], const float b[], const float c[], int len)
{
@@ -925,7 +925,7 @@ class Octree {
}
}
/// Retrieve complete edge intersection
/** Retrieve complete edge intersection */
void getEdgeIntersectionByIndex(
const LeafNode *leaf, int index, int st[3], int len, float pt[3], float nm[3]) const
{
@@ -1168,25 +1168,25 @@ class Octree {
}
}
/// Update method
/** Update method */
LeafNode *updateEdgeOffsetsNormals(
LeafNode *leaf, int oldlen, int newlen, float offs[3], float a[3], float b[3], float c[3])
{
// First, create a new leaf node
/* First, create a new leaf node */
LeafNode *nleaf = createLeaf(newlen);
*nleaf = *leaf;
// Next, fill in the offsets
/* Next, fill in the offsets */
setEdgeOffsetsNormals(nleaf, offs, a, b, c, newlen);
// Finally, delete the old leaf
/* Finally, delete the old leaf */
removeLeaf(oldlen, leaf);
return nleaf;
}
/// Locate a leaf
/// WARNING: assuming this leaf already exists!
/** Locate a leaf
* WARNING: assuming this leaf already exists! */
LeafNode *locateLeaf(int st[3])
{
@@ -1282,7 +1282,7 @@ class Octree {
/************ Operators for internal nodes ************/
/// Add a kid to an existing internal node
/** Add a kid to an existing internal node */
InternalNode *addChild(InternalNode *node, int index, Node *child, int aLeaf)
{
// Create new internal node
@@ -1318,7 +1318,7 @@ class Octree {
return rnode;
}
/// Allocate a node
/** Allocate a node */
InternalNode *createInternal(int length)
{
InternalNode *inode = (InternalNode *)alloc[length]->allocate();
@@ -1350,7 +1350,7 @@ class Octree {
leafalloc[num]->deallocate(leaf);
}
/// Add a leaf (by creating a new par node with the leaf added)
/** Add a leaf (by creating a new par node with the leaf added) */
InternalNode *addLeafChild(InternalNode *par, int index, int count, LeafNode *leaf)
{
int num = par->get_num_children() + 1;

View File

@@ -51,7 +51,7 @@ class GHOST_IEventConsumer;
* Blender.
* <br><br>
* Enough history. What does GHOST have to offer?<br>
* In short: everything that Blender needed from GLUT to run on all it's supported
* In short: everything that Blender needed from GLUT to run on all its supported
* operating systems and some extra's.
* This includes :
*

View File

@@ -36,7 +36,7 @@ class GHOST_CallbackEventConsumer : public GHOST_IEventConsumer {
/**
* Constructor.
* \param eventCallback The call-back routine invoked.
* \param userData The data passed back though the call-back routine.
* \param userData The data passed back through the call-back routine.
*/
GHOST_CallbackEventConsumer(GHOST_EventCallbackProcPtr eventCallback,
GHOST_TUserDataPtr userData);
@@ -58,7 +58,7 @@ class GHOST_CallbackEventConsumer : public GHOST_IEventConsumer {
protected:
/** The call-back routine invoked. */
GHOST_EventCallbackProcPtr m_eventCallback;
/** The data passed back though the call-back routine. */
/** The data passed back through the call-back routine. */
GHOST_TUserDataPtr m_userData;
#ifdef WITH_CXX_GUARDEDALLOC

View File

@@ -360,7 +360,7 @@ GHOST_TSuccess GHOST_System::createFullScreenWindow(GHOST_Window **window,
glSettings.flags |= GHOST_glAlphaBackground;
/* note: don't use getCurrentDisplaySetting() because on X11 we may
* be zoomed in and the desktop may be bigger then the viewport. */
* be zoomed in and the desktop may be bigger than the viewport. */
GHOST_ASSERT(m_displayManager,
"GHOST_System::createFullScreenWindow(): invalid display manager");
// GHOST_PRINT("GHOST_System::createFullScreenWindow(): creating full-screen window\n");

View File

@@ -1599,7 +1599,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
window->getClientBounds(bounds);
/* Switch back to Cocoa coordinates orientation
* (y=0 at bottom, the same as blender internal btw!), and to client coordinates. */
* (y=0 at bottom, the same as blender internal BTW!), and to client coordinates. */
window->getClientBounds(windowBounds);
window->screenToClient(bounds.m_l, bounds.m_b, correctedBounds.m_l, correctedBounds.m_t);
window->screenToClient(bounds.m_r, bounds.m_t, correctedBounds.m_r, correctedBounds.m_b);

View File

@@ -255,8 +255,8 @@ static GHOST_TKey convertSDLKey(SDL_Scancode key)
/* keypad events */
/* note, sdl defines a bunch of kp defines I never saw before like
* SDL_SCANCODE_KP_PERCENT, SDL_SCANCODE_KP_XOR - campbell */
/* NOTE: SDL defines a bunch of key-pad identifiers that aren't supported by GHOST,
* such as #SDL_SCANCODE_KP_PERCENT, #SDL_SCANCODE_KP_XOR. */
GXMAP(type, SDL_SCANCODE_KP_0, GHOST_kKeyNumpad0);
GXMAP(type, SDL_SCANCODE_KP_1, GHOST_kKeyNumpad1);
GXMAP(type, SDL_SCANCODE_KP_2, GHOST_kKeyNumpad2);

View File

@@ -354,7 +354,7 @@ class GHOST_SystemWin32 : public GHOST_System {
* Process special keys (VK_OEM_*), to see if current key layout
* gives us anything special, like ! on french AZERTY.
* \param vKey The virtual key from hardKey
* \param scanCode The ScanCode of pressed key (simular to PS/2 Set 1)
* \param scanCode The ScanCode of pressed key (similar to PS/2 Set 1)
*/
GHOST_TKey processSpecialKey(short vKey, short scanCode) const;

View File

@@ -175,7 +175,8 @@ GHOST_SystemX11::GHOST_SystemX11() : GHOST_System(), m_xkb_descr(NULL), m_start_
#undef GHOST_INTERN_ATOM_IF_EXISTS
#undef GHOST_INTERN_ATOM
m_last_warp = 0;
m_last_warp_x = 0;
m_last_warp_y = 0;
m_last_release_keycode = 0;
m_last_release_time = 0;
@@ -981,17 +982,24 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
window->getCursorGrabAccum(x_accum, y_accum);
if (x_new != xme.x_root || y_new != xme.y_root) {
if (xme.time > m_last_warp) {
/* when wrapping we don't need to add an event because the
* setCursorPosition call will cause a new event after */
setCursorPosition(x_new, y_new); /* wrap */
window->setCursorGrabAccum(x_accum + (xme.x_root - x_new),
y_accum + (xme.y_root - y_new));
m_last_warp = lastEventTime(xme.time);
/* Use time of last event to avoid wrapping several times on the 'same' actual wrap.
* Note that we need to deal with X and Y separately as those might wrap at the same time
* but still in two different events (corner case, see T74918).
* We also have to add a few extra milliseconds of 'padding', as sometimes we get two
* close events that will generate extra wrap on the same axis within those few
* milliseconds. */
if (x_new != xme.x_root && xme.time > m_last_warp_x) {
x_accum += (xme.x_root - x_new);
m_last_warp_x = lastEventTime(xme.time) + 25;
}
else {
setCursorPosition(x_new, y_new); /* wrap but don't accumulate */
if (y_new != xme.y_root && xme.time > m_last_warp_y) {
y_accum += (xme.y_root - y_new);
m_last_warp_y = lastEventTime(xme.time) + 25;
}
window->setCursorGrabAccum(x_accum, y_accum);
/* When wrapping we don't need to add an event because the
* #setCursorPosition call will cause a new event after. */
setCursorPosition(x_new, y_new); /* wrap */
}
else {
g_event = new GHOST_EventCursor(getMilliSeconds(),

View File

@@ -361,7 +361,8 @@ class GHOST_SystemX11 : public GHOST_System {
* To prevent multiple warp, we store the time of the last warp event
* and stop accumulating all events generated before that.
*/
Time m_last_warp;
Time m_last_warp_x;
Time m_last_warp_y;
/* Detect auto-repeat glitch. */
unsigned int m_last_release_keycode;

View File

@@ -60,7 +60,7 @@ class IK_QJacobian {
int m_dof, m_task_size;
bool m_transpose;
// the jacobian matrix and it's null space projector
// the jacobian matrix and its null space projector
MatrixXd m_jacobian, m_jacobian_tmp;
MatrixXd m_nullspace;

View File

@@ -54,7 +54,7 @@ namespace KDL {
class Error {
public:
/** Returns a description string describing the error.
* the returned pointer only garanteed to exists as long as
* the returned pointer only guaranteed to exists as long as
* the Error object exists.
*/
virtual ~Error() {}

View File

@@ -32,7 +32,7 @@
* ORO_Geometry V0.2
*
* \par history
* - changed layout of the comments to accomodate doxygen
* - changed layout of the comments to accommodate doxygen
*/
#ifndef ERROR_STACK_H
#define ERROR_STACK_H

View File

@@ -7,7 +7,7 @@
* ORO_Geometry V0.2
*
* @par history
* - changed layout of the comments to accomodate doxygen
* - changed layout of the comments to accommodate doxygen
*/
#include "utility.h"

View File

@@ -14,7 +14,7 @@
* functions and macro definitions.
*
* \par history
* - changed layout of the comments to accomodate doxygen
* - changed layout of the comments to accommodate doxygen
*/

View File

@@ -111,6 +111,7 @@ if(WITH_LIBMV)
libmv/simple_pipeline/intersect.cc
libmv/simple_pipeline/keyframe_selection.cc
libmv/simple_pipeline/modal_solver.cc
libmv/simple_pipeline/packed_intrinsics.cc
libmv/simple_pipeline/pipeline.cc
libmv/simple_pipeline/reconstruction.cc
libmv/simple_pipeline/reconstruction_scale.cc
@@ -149,6 +150,7 @@ if(WITH_LIBMV)
libmv/autotrack/region.h
libmv/autotrack/tracks.h
libmv/base/aligned_malloc.h
libmv/base/array.h
libmv/base/id_generator.h
libmv/base/map.h
libmv/base/scoped_ptr.h
@@ -191,6 +193,7 @@ if(WITH_LIBMV)
libmv/simple_pipeline/intersect.h
libmv/simple_pipeline/keyframe_selection.h
libmv/simple_pipeline/modal_solver.h
libmv/simple_pipeline/packed_intrinsics.h
libmv/simple_pipeline/pipeline.h
libmv/simple_pipeline/reconstruction.h
libmv/simple_pipeline/reconstruction_scale.h

View File

@@ -130,7 +130,7 @@ bool AutoTrack::TrackMarker(Marker* tracked_marker,
// Try to predict the location of the second marker.
bool predicted_position = false;
if (PredictMarkerPosition(tracks_, tracked_marker)) {
LG << "Succesfully predicted!";
LG << "Successfully predicted!";
predicted_position = true;
} else {
LG << "Prediction failed; trying to track anyway.";

View File

@@ -0,0 +1,32 @@
// Copyright (c) 2020 libmv authors.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
#ifndef LIBMV_BASE_ARRAY_H_
#define LIBMV_BASE_ARRAY_H_
#include <array>
namespace libmv {
using std::array;
} // namespace libmv
#endif // LIBMV_BASE_ARRAY_H_

View File

@@ -25,151 +25,18 @@
#ifndef LIBMV_BASE_VECTOR_H
#define LIBMV_BASE_VECTOR_H
#include <cstring>
#include <new>
#include <vector>
#include <Eigen/Core>
namespace libmv {
// A simple container class, which guarantees 16 byte alignment needed for most
// vectorization. Don't use this container for classes that cannot be copied
// via memcpy.
// FIXME: this class has some issues:
// - doesn't support iterators.
// - impede compatibility with code using STL.
// - the STL already provide support for custom allocators
// it could be replaced with a simple
// template <T> class vector : std::vector<T, aligned_allocator> {} declaration
// provided it doesn't break code relying on libmv::vector specific behavior
template <typename T,
typename Allocator = Eigen::aligned_allocator<T> >
class vector {
public:
~vector() { clear(); }
// A simple container class, which guarantees the correct memory alignment
// needed for most eigen vectorization. Don't use this container for classes
// that cannot be copied via memcpy.
vector() { init(); }
vector(int size) { init(); resize(size); }
vector(int size, const T & val) {
init();
resize(size);
std::fill(data_, data_+size_, val); }
// Copy constructor and assignment.
vector(const vector<T, Allocator> &rhs) {
init();
copy(rhs);
}
vector<T, Allocator> &operator=(const vector<T, Allocator> &rhs) {
if (&rhs != this) {
copy(rhs);
}
return *this;
}
/// Swaps the contents of two vectors in constant time.
void swap(vector<T, Allocator> &other) {
std::swap(allocator_, other.allocator_);
std::swap(size_, other.size_);
std::swap(capacity_, other.capacity_);
std::swap(data_, other.data_);
}
T *data() const { return data_; }
int size() const { return size_; }
int capacity() const { return capacity_; }
const T& back() const { return data_[size_ - 1]; }
T& back() { return data_[size_ - 1]; }
const T& front() const { return data_[0]; }
T& front() { return data_[0]; }
const T& operator[](int n) const { return data_[n]; }
T& operator[](int n) { return data_[n]; }
const T& at(int n) const { return data_[n]; }
T& at(int n) { return data_[n]; }
const T * begin() const { return data_; }
const T * end() const { return data_+size_; }
T * begin() { return data_; }
T * end() { return data_+size_; }
void resize(size_t size) {
reserve(size);
if (size > size_) {
construct(size_, size);
} else if (size < size_) {
destruct(size, size_);
}
size_ = size;
}
void push_back(const T &value) {
if (size_ == capacity_) {
reserve(size_ ? 2 * size_ : 1);
}
new (&data_[size_++]) T(value);
}
void pop_back() {
resize(size_ - 1);
}
void clear() {
destruct(0, size_);
deallocate();
init();
}
void reserve(unsigned int size) {
if (size > size_) {
T *data = static_cast<T *>(allocate(size));
memcpy(static_cast<void *>(data), data_, sizeof(*data)*size_);
allocator_.deallocate(data_, capacity_);
data_ = data;
capacity_ = size;
}
}
bool empty() {
return size_ == 0;
}
private:
void construct(int start, int end) {
for (int i = start; i < end; ++i) {
new (&data_[i]) T;
}
}
void destruct(int start, int end) {
for (int i = start; i < end; ++i) {
data_[i].~T();
}
}
void init() {
size_ = 0;
data_ = 0;
capacity_ = 0;
}
void *allocate(int size) {
return size ? allocator_.allocate(size) : 0;
}
void deallocate() {
allocator_.deallocate(data_, size_);
data_ = 0;
}
void copy(const vector<T, Allocator> &rhs) {
resize(rhs.size());
for (int i = 0; i < rhs.size(); ++i) {
(*this)[i] = rhs[i];
}
}
Allocator allocator_;
size_t size_;
size_t capacity_;
T *data_;
};
template <class ElementType>
using vector = std::vector<ElementType, Eigen::aligned_allocator<ElementType>>;
} // namespace libmv

View File

@@ -37,11 +37,9 @@ TEST(VectorAlignmentTest, PushBack) {
vector<Vec2> vs;
vs.push_back(x1);
EXPECT_EQ(1, vs.size());
EXPECT_EQ(1, vs.capacity());
vs.push_back(x2);
EXPECT_EQ(2, vs.size());
EXPECT_EQ(2, vs.capacity());
// The following is necessary because of some bug in gtest; the expected
// parameter can't be a fixed size vectorizable type with alignment
@@ -55,7 +53,6 @@ TEST(VectorAlignmentTest, PushBack) {
vs.push_back(x2);
vs.push_back(x2);
EXPECT_EQ(5, vs.size());
EXPECT_EQ(8, vs.capacity());
}
// Count the number of destruct calls to test that the destructor gets called.
@@ -80,7 +77,6 @@ TEST_F(VectorTest, EmptyVectorDoesNotConstruct) {
{
vector<Foo> v;
EXPECT_EQ(0, v.size());
EXPECT_EQ(0, v.capacity());
}
EXPECT_EQ(0, foo_construct_calls);
EXPECT_EQ(0, foo_destruct_calls);
@@ -98,13 +94,11 @@ TEST_F(VectorTest, DestructorGetsCalled) {
TEST_F(VectorTest, ReserveDoesNotCallConstructorsOrDestructors) {
vector<Foo> v;
EXPECT_EQ(0, v.size());
EXPECT_EQ(0, v.capacity());
EXPECT_EQ(0, foo_construct_calls);
EXPECT_EQ(0, foo_destruct_calls);
v.reserve(5);
EXPECT_EQ(0, v.size());
EXPECT_EQ(5, v.capacity());
EXPECT_EQ(0, foo_construct_calls);
EXPECT_EQ(0, foo_destruct_calls);
}
@@ -115,31 +109,23 @@ TEST_F(VectorTest, ResizeConstructsAndDestructsAsExpected) {
// Create one object.
v.resize(1);
EXPECT_EQ(1, v.size());
EXPECT_EQ(1, v.capacity());
EXPECT_EQ(1, foo_construct_calls);
EXPECT_EQ(0, foo_destruct_calls);
EXPECT_EQ(5, v[0].value);
// Create two more.
v.resize(3);
EXPECT_EQ(3, v.size());
EXPECT_EQ(3, v.capacity());
EXPECT_EQ(3, foo_construct_calls);
EXPECT_EQ(0, foo_destruct_calls);
// Delete the last one.
v.resize(2);
EXPECT_EQ(2, v.size());
EXPECT_EQ(3, v.capacity());
EXPECT_EQ(3, foo_construct_calls);
EXPECT_EQ(1, foo_destruct_calls);
// Delete the remaining two.
v.resize(0);
EXPECT_EQ(0, v.size());
EXPECT_EQ(3, v.capacity());
EXPECT_EQ(3, foo_construct_calls);
EXPECT_EQ(3, foo_destruct_calls);
}
TEST_F(VectorTest, PushPopBack) {
@@ -165,7 +151,6 @@ TEST_F(VectorTest, CopyConstructor) {
vector<int> b(a);
EXPECT_EQ(a.size(), b.size());
//EXPECT_EQ(a.capacity(), b.capacity());
for (int i = 0; i < a.size(); ++i) {
EXPECT_EQ(a[i], b[i]);
}
@@ -180,7 +165,6 @@ TEST_F(VectorTest, OperatorEquals) {
b = a;
EXPECT_EQ(a.size(), b.size());
//EXPECT_EQ(a.capacity(), b.capacity());
for (int i = 0; i < a.size(); ++i) {
EXPECT_EQ(a[i], b[i]);
}
@@ -192,15 +176,15 @@ TEST_F(VectorTest, STLFind) {
a.push_back(5);
a.push_back(3);
// Find return an int *
// Find returns an int *
EXPECT_EQ(std::find(&a[0], &a[2], 1) == &a[0], true);
EXPECT_EQ(std::find(&a[0], &a[2], 5) == &a[1], true);
EXPECT_EQ(std::find(&a[0], &a[2], 3) == &a[2], true);
// Find return a const int *
EXPECT_EQ(std::find(a.begin(), a.end(), 1) == &a[0], true);
EXPECT_EQ(std::find(a.begin(), a.end(), 5) == &a[1], true);
EXPECT_EQ(std::find(a.begin(), a.end(), 3) == &a[2], true);
// Find returns an interator
EXPECT_EQ(std::find(a.begin(), a.end(), 1) == std::next(a.begin(), 0), true);
EXPECT_EQ(std::find(a.begin(), a.end(), 5) == std::next(a.begin(), 1), true);
EXPECT_EQ(std::find(a.begin(), a.end(), 3) == std::next(a.begin(), 2), true);
// Search value that are not in the vector
EXPECT_EQ(std::find(a.begin(), a.end(), 0) == a.end(), true);

View File

@@ -35,38 +35,10 @@
#include "libmv/simple_pipeline/reconstruction.h"
#include "libmv/simple_pipeline/tracks.h"
#include "libmv/simple_pipeline/distortion_models.h"
#include "libmv/simple_pipeline/packed_intrinsics.h"
namespace libmv {
// The intrinsics need to get combined into a single parameter block; use these
// enums to index instead of numeric constants.
enum {
// Camera calibration values.
OFFSET_FOCAL_LENGTH,
OFFSET_PRINCIPAL_POINT_X,
OFFSET_PRINCIPAL_POINT_Y,
// Distortion model coefficients.
// WARNING: camera intrinsics are not required to define/use all of those,
// but they have to define all of them up to the last one they need, in that
// exact same order. See e.g. how `PolynomialCameraIntrinsics` needs to define
// `OFFSET_K4`, even though it does not use it.
OFFSET_K1,
OFFSET_K2,
OFFSET_K3,
OFFSET_K4,
OFFSET_P1,
OFFSET_P2,
// Maximal possible offset.
OFFSET_MAX,
};
#define FIRST_DISTORTION_COEFFICIENT OFFSET_K1
#define LAST_DISTORTION_COEFFICIENT OFFSET_P2
#define NUM_DISTORTION_COEFFICIENTS \
(LAST_DISTORTION_COEFFICIENT - FIRST_DISTORTION_COEFFICIENT + 1)
namespace {
bool NeedUseInvertIntrinsicsPipeline(const CameraIntrinsics *intrinsics) {
@@ -94,20 +66,23 @@ void ApplyDistortionModelUsingIntrinsicsBlock(
const T& normalized_x, const T& normalized_y,
T* distorted_x, T* distorted_y) {
// Unpack the intrinsics.
const T& focal_length = intrinsics_block[OFFSET_FOCAL_LENGTH];
const T& principal_point_x = intrinsics_block[OFFSET_PRINCIPAL_POINT_X];
const T& principal_point_y = intrinsics_block[OFFSET_PRINCIPAL_POINT_Y];
const T& focal_length =
intrinsics_block[PackedIntrinsics::OFFSET_FOCAL_LENGTH];
const T& principal_point_x =
intrinsics_block[PackedIntrinsics::OFFSET_PRINCIPAL_POINT_X];
const T& principal_point_y =
intrinsics_block[PackedIntrinsics::OFFSET_PRINCIPAL_POINT_Y];
// TODO(keir): Do early bailouts for zero distortion; these are expensive
// jet operations.
switch (invariant_intrinsics->GetDistortionModelType()) {
case DISTORTION_MODEL_POLYNOMIAL:
{
const T& k1 = intrinsics_block[OFFSET_K1];
const T& k2 = intrinsics_block[OFFSET_K2];
const T& k3 = intrinsics_block[OFFSET_K3];
const T& p1 = intrinsics_block[OFFSET_P1];
const T& p2 = intrinsics_block[OFFSET_P2];
const T& k1 = intrinsics_block[PackedIntrinsics::OFFSET_K1];
const T& k2 = intrinsics_block[PackedIntrinsics::OFFSET_K2];
const T& k3 = intrinsics_block[PackedIntrinsics::OFFSET_K3];
const T& p1 = intrinsics_block[PackedIntrinsics::OFFSET_P1];
const T& p2 = intrinsics_block[PackedIntrinsics::OFFSET_P2];
ApplyPolynomialDistortionModel(focal_length,
focal_length,
@@ -122,8 +97,8 @@ void ApplyDistortionModelUsingIntrinsicsBlock(
case DISTORTION_MODEL_DIVISION:
{
const T& k1 = intrinsics_block[OFFSET_K1];
const T& k2 = intrinsics_block[OFFSET_K2];
const T& k1 = intrinsics_block[PackedIntrinsics::OFFSET_K1];
const T& k2 = intrinsics_block[PackedIntrinsics::OFFSET_K2];
ApplyDivisionDistortionModel(focal_length,
focal_length,
@@ -143,12 +118,12 @@ void ApplyDistortionModelUsingIntrinsicsBlock(
case DISTORTION_MODEL_BROWN:
{
const T& k1 = intrinsics_block[OFFSET_K1];
const T& k2 = intrinsics_block[OFFSET_K2];
const T& k3 = intrinsics_block[OFFSET_K3];
const T& k4 = intrinsics_block[OFFSET_K4];
const T& p1 = intrinsics_block[OFFSET_P1];
const T& p2 = intrinsics_block[OFFSET_P2];
const T& k1 = intrinsics_block[PackedIntrinsics::OFFSET_K1];
const T& k2 = intrinsics_block[PackedIntrinsics::OFFSET_K2];
const T& k3 = intrinsics_block[PackedIntrinsics::OFFSET_K3];
const T& k4 = intrinsics_block[PackedIntrinsics::OFFSET_K4];
const T& p1 = intrinsics_block[PackedIntrinsics::OFFSET_P1];
const T& p2 = intrinsics_block[PackedIntrinsics::OFFSET_P2];
ApplyBrownDistortionModel(focal_length,
focal_length,
@@ -184,9 +159,12 @@ void InvertDistortionModelUsingIntrinsicsBlock(
const T& image_x, const T& image_y,
T* normalized_x, T* normalized_y) {
// Unpack the intrinsics.
const T& focal_length = intrinsics_block[OFFSET_FOCAL_LENGTH];
const T& principal_point_x = intrinsics_block[OFFSET_PRINCIPAL_POINT_X];
const T& principal_point_y = intrinsics_block[OFFSET_PRINCIPAL_POINT_Y];
const T& focal_length =
intrinsics_block[PackedIntrinsics::OFFSET_FOCAL_LENGTH];
const T& principal_point_x =
intrinsics_block[PackedIntrinsics::OFFSET_PRINCIPAL_POINT_X];
const T& principal_point_y =
intrinsics_block[PackedIntrinsics::OFFSET_PRINCIPAL_POINT_Y];
// TODO(keir): Do early bailouts for zero distortion; these are expensive
// jet operations.
@@ -199,8 +177,8 @@ void InvertDistortionModelUsingIntrinsicsBlock(
case DISTORTION_MODEL_NUKE:
{
const T& k1 = intrinsics_block[OFFSET_K1];
const T& k2 = intrinsics_block[OFFSET_K2];
const T& k1 = intrinsics_block[PackedIntrinsics::OFFSET_K1];
const T& k2 = intrinsics_block[PackedIntrinsics::OFFSET_K2];
InvertNukeDistortionModel(focal_length,
focal_length,
@@ -223,16 +201,19 @@ void NormalizedToImageSpace(const T* const intrinsics_block,
const T& normalized_x, const T& normalized_y,
T* image_x, T* image_y) {
// Unpack the intrinsics.
const T& focal_length = intrinsics_block[OFFSET_FOCAL_LENGTH];
const T& principal_point_x = intrinsics_block[OFFSET_PRINCIPAL_POINT_X];
const T& principal_point_y = intrinsics_block[OFFSET_PRINCIPAL_POINT_Y];
const T& focal_length =
intrinsics_block[PackedIntrinsics::OFFSET_FOCAL_LENGTH];
const T& principal_point_x =
intrinsics_block[PackedIntrinsics::OFFSET_PRINCIPAL_POINT_X];
const T& principal_point_y =
intrinsics_block[PackedIntrinsics::OFFSET_PRINCIPAL_POINT_Y];
*image_x = normalized_x * focal_length + principal_point_x;
*image_y = normalized_y * focal_length + principal_point_y;
}
// Cost functor which computes reprojection error of 3D point X on camera
// defined by angle-axis rotation and it's translation (which are in the same
// defined by angle-axis rotation and its translation (which are in the same
// block due to optimization reasons).
//
// This functor can only be used for distortion models which have analytically
@@ -291,7 +272,7 @@ struct ReprojectionErrorApplyIntrinsics {
};
// Cost functor which computes reprojection error of 3D point X on camera
// defined by angle-axis rotation and it's translation (which are in the same
// defined by angle-axis rotation and its translation (which are in the same
// block due to optimization reasons).
//
// This functor can only be used for distortion models which have analytically
@@ -314,9 +295,12 @@ struct ReprojectionErrorInvertIntrinsics {
const T* const X, // Point coordinates 3x1.
T* residuals) const {
// Unpack the intrinsics.
const T& focal_length = intrinsics[OFFSET_FOCAL_LENGTH];
const T& principal_point_x = intrinsics[OFFSET_PRINCIPAL_POINT_X];
const T& principal_point_y = intrinsics[OFFSET_PRINCIPAL_POINT_Y];
const T& focal_length =
intrinsics[PackedIntrinsics::OFFSET_FOCAL_LENGTH];
const T& principal_point_x =
intrinsics[PackedIntrinsics::OFFSET_PRINCIPAL_POINT_X];
const T& principal_point_y =
intrinsics[PackedIntrinsics::OFFSET_PRINCIPAL_POINT_Y];
// Compute projective coordinates: x = RX + t.
T x[3];
@@ -391,43 +375,6 @@ void BundleIntrinsicsLogMessage(const int bundle_intrinsics) {
}
}
// Pack intrinsics from object to an array for easier
// and faster minimization.
void PackIntrinisicsIntoArray(const CameraIntrinsics &intrinsics,
double intrinsics_block[OFFSET_MAX]) {
intrinsics_block[OFFSET_FOCAL_LENGTH] = intrinsics.focal_length();
intrinsics_block[OFFSET_PRINCIPAL_POINT_X] = intrinsics.principal_point_x();
intrinsics_block[OFFSET_PRINCIPAL_POINT_Y] = intrinsics.principal_point_y();
int num_distortion_parameters = intrinsics.num_distortion_parameters();
assert(num_distortion_parameters <= NUM_DISTORTION_COEFFICIENTS);
const double *distortion_parameters = intrinsics.distortion_parameters();
for (int i = 0; i < num_distortion_parameters; ++i) {
intrinsics_block[FIRST_DISTORTION_COEFFICIENT + i] =
distortion_parameters[i];
}
}
// Unpack intrinsics back from an array to an object.
void UnpackIntrinsicsFromArray(const double intrinsics_block[OFFSET_MAX],
CameraIntrinsics *intrinsics) {
intrinsics->SetFocalLength(intrinsics_block[OFFSET_FOCAL_LENGTH],
intrinsics_block[OFFSET_FOCAL_LENGTH]);
intrinsics->SetPrincipalPoint(intrinsics_block[OFFSET_PRINCIPAL_POINT_X],
intrinsics_block[OFFSET_PRINCIPAL_POINT_Y]);
int num_distortion_parameters = intrinsics->num_distortion_parameters();
assert(num_distortion_parameters <= NUM_DISTORTION_COEFFICIENTS);
double *distortion_parameters = intrinsics->distortion_parameters();
for (int i = 0; i < num_distortion_parameters; ++i) {
distortion_parameters[i] =
intrinsics_block[FIRST_DISTORTION_COEFFICIENT + i];
}
}
// Get a vector of camera's rotations denoted by angle axis
// conjuncted with translations into single block
//
@@ -564,12 +511,12 @@ template<typename CostFunction>
void AddResidualBlockToProblemImpl(const CameraIntrinsics *invariant_intrinsics,
double observed_x, double observed_y,
double weight,
double intrinsics_block[OFFSET_MAX],
double *intrinsics_block,
double *camera_R_t,
EuclideanPoint *point,
ceres::Problem* problem) {
problem->AddResidualBlock(new ceres::AutoDiffCostFunction<
CostFunction, 2, OFFSET_MAX, 6, 3>(
CostFunction, 2, PackedIntrinsics::NUM_PARAMETERS, 6, 3>(
new CostFunction(
invariant_intrinsics,
observed_x, observed_y,
@@ -583,7 +530,7 @@ void AddResidualBlockToProblemImpl(const CameraIntrinsics *invariant_intrinsics,
void AddResidualBlockToProblem(const CameraIntrinsics *invariant_intrinsics,
const Marker &marker,
double marker_weight,
double intrinsics_block[OFFSET_MAX],
double* intrinsics_block,
double *camera_R_t,
EuclideanPoint *point,
ceres::Problem* problem) {
@@ -620,7 +567,7 @@ void AddResidualBlockToProblem(const CameraIntrinsics *invariant_intrinsics,
void EuclideanBundlePointsOnly(const CameraIntrinsics *invariant_intrinsics,
const vector<Marker> &markers,
map<int, Vec6> &all_cameras_R_t,
double intrinsics_block[OFFSET_MAX],
double* intrinsics_block,
EuclideanReconstruction *reconstruction) {
ceres::Problem::Options problem_options;
ceres::Problem problem(problem_options);
@@ -700,11 +647,11 @@ void EuclideanBundleCommonIntrinsics(
// N-th element denotes whether track N is a constant zero-weighted track.
vector<bool> zero_weight_tracks_flags(tracks.MaxTrack() + 1, true);
// Residual blocks with 10 parameters are unwieldly with Ceres, so pack the
// intrinsics into a single block and rely on local parameterizations to
// control which intrinsics are allowed to vary.
double intrinsics_block[OFFSET_MAX];
PackIntrinisicsIntoArray(*intrinsics, intrinsics_block);
// Pack all intrinsics parameters into a single block and rely on local
// parameterizations to control which intrinsics are allowed to vary.
PackedIntrinsics packed_intrinsics;
intrinsics->Pack(&packed_intrinsics);
double* intrinsics_block = packed_intrinsics.GetParametersBlock();
// Convert cameras rotations to angle axis and merge with translation
// into single parameter block for maximal minimization speed.
@@ -800,21 +747,28 @@ void EuclideanBundleCommonIntrinsics(
if (!(bundle_intrinsics & bundle_enum)) { \
constant_intrinsics.push_back(offset); \
}
MAYBE_SET_CONSTANT(BUNDLE_FOCAL_LENGTH, OFFSET_FOCAL_LENGTH);
MAYBE_SET_CONSTANT(BUNDLE_PRINCIPAL_POINT, OFFSET_PRINCIPAL_POINT_X);
MAYBE_SET_CONSTANT(BUNDLE_PRINCIPAL_POINT, OFFSET_PRINCIPAL_POINT_Y);
MAYBE_SET_CONSTANT(BUNDLE_RADIAL_K1, OFFSET_K1);
MAYBE_SET_CONSTANT(BUNDLE_RADIAL_K2, OFFSET_K2);
MAYBE_SET_CONSTANT(BUNDLE_TANGENTIAL_P1, OFFSET_P1);
MAYBE_SET_CONSTANT(BUNDLE_TANGENTIAL_P2, OFFSET_P2);
MAYBE_SET_CONSTANT(BUNDLE_FOCAL_LENGTH,
PackedIntrinsics::OFFSET_FOCAL_LENGTH);
MAYBE_SET_CONSTANT(BUNDLE_PRINCIPAL_POINT,
PackedIntrinsics::OFFSET_PRINCIPAL_POINT_X);
MAYBE_SET_CONSTANT(BUNDLE_PRINCIPAL_POINT,
PackedIntrinsics::OFFSET_PRINCIPAL_POINT_Y);
MAYBE_SET_CONSTANT(BUNDLE_RADIAL_K1, PackedIntrinsics::OFFSET_K1);
MAYBE_SET_CONSTANT(BUNDLE_RADIAL_K2, PackedIntrinsics::OFFSET_K2);
MAYBE_SET_CONSTANT(BUNDLE_TANGENTIAL_P1, PackedIntrinsics::OFFSET_P1);
MAYBE_SET_CONSTANT(BUNDLE_TANGENTIAL_P2, PackedIntrinsics::OFFSET_P2);
#undef MAYBE_SET_CONSTANT
// Always set K3 and K4 constant, it's not used at the moment.
constant_intrinsics.push_back(OFFSET_K3);
constant_intrinsics.push_back(OFFSET_K4);
constant_intrinsics.push_back(PackedIntrinsics::OFFSET_K3);
constant_intrinsics.push_back(PackedIntrinsics::OFFSET_K4);
// TODO(sergey): Mark all parameters which are not used by the distortion
// model as constant.
ceres::SubsetParameterization *subset_parameterization =
new ceres::SubsetParameterization(OFFSET_MAX, constant_intrinsics);
new ceres::SubsetParameterization(PackedIntrinsics::NUM_PARAMETERS,
constant_intrinsics);
problem.SetParameterization(intrinsics_block, subset_parameterization);
}
@@ -839,8 +793,9 @@ void EuclideanBundleCommonIntrinsics(
UnpackCamerasRotationAndTranslation(all_cameras_R_t, reconstruction);
// Copy intrinsics back.
if (bundle_intrinsics != BUNDLE_NO_INTRINSICS)
UnpackIntrinsicsFromArray(intrinsics_block, intrinsics);
if (bundle_intrinsics != BUNDLE_NO_INTRINSICS) {
intrinsics->Unpack(packed_intrinsics);
}
LG << "Final intrinsics: " << *intrinsics;

View File

@@ -22,6 +22,7 @@
#include "libmv/logging/logging.h"
#include "libmv/simple_pipeline/distortion_models.h"
#include "libmv/simple_pipeline/packed_intrinsics.h"
namespace libmv {
@@ -131,6 +132,20 @@ void CameraIntrinsics::ResetLookupGrids() {
undistort_.Reset();
}
void CameraIntrinsics::Pack(PackedIntrinsics* packed_intrinsics) const {
packed_intrinsics->SetFocalLength(focal_length());
packed_intrinsics->SetPrincipalPoint(principal_point_x(),
principal_point_y());
}
void CameraIntrinsics::Unpack(const PackedIntrinsics& packed_intrinsics) {
SetFocalLength(packed_intrinsics.GetFocalLength(),
packed_intrinsics.GetFocalLength());
SetPrincipalPoint(packed_intrinsics.GetPrincipalPointX(),
packed_intrinsics.GetPrincipalPointY());
}
// Polynomial model.
PolynomialCameraIntrinsics::PolynomialCameraIntrinsics()
@@ -195,6 +210,30 @@ void PolynomialCameraIntrinsics::InvertIntrinsics(
normalized_y);
}
void PolynomialCameraIntrinsics::Pack(
PackedIntrinsics* packed_intrinsics) const {
CameraIntrinsics::Pack(packed_intrinsics);
packed_intrinsics->SetK1(k1());
packed_intrinsics->SetK2(k2());
packed_intrinsics->SetK3(k3());
packed_intrinsics->SetP1(p1());
packed_intrinsics->SetP2(p2());
}
void PolynomialCameraIntrinsics::Unpack(
const PackedIntrinsics& packed_intrinsics) {
CameraIntrinsics::Unpack(packed_intrinsics);
SetRadialDistortion(packed_intrinsics.GetK1(),
packed_intrinsics.GetK2(),
packed_intrinsics.GetK3());
SetTangentialDistortion(packed_intrinsics.GetP1(),
packed_intrinsics.GetP2());
}
// Division model.
DivisionCameraIntrinsics::DivisionCameraIntrinsics()
@@ -245,6 +284,21 @@ void DivisionCameraIntrinsics::InvertIntrinsics(double image_x,
normalized_y);
}
void DivisionCameraIntrinsics::Pack(
PackedIntrinsics* packed_intrinsics) const {
CameraIntrinsics::Pack(packed_intrinsics);
packed_intrinsics->SetK1(k1());
packed_intrinsics->SetK2(k2());
}
void DivisionCameraIntrinsics::Unpack(
const PackedIntrinsics& packed_intrinsics) {
CameraIntrinsics::Unpack(packed_intrinsics);
SetDistortion(packed_intrinsics.GetK1(), packed_intrinsics.GetK2());
}
// Nuke model.
NukeCameraIntrinsics::NukeCameraIntrinsics()
@@ -296,6 +350,21 @@ void NukeCameraIntrinsics::InvertIntrinsics(double image_x,
normalized_y);
}
void NukeCameraIntrinsics::Pack(
PackedIntrinsics* packed_intrinsics) const {
CameraIntrinsics::Pack(packed_intrinsics);
packed_intrinsics->SetK1(k1());
packed_intrinsics->SetK2(k2());
}
void NukeCameraIntrinsics::Unpack(
const PackedIntrinsics& packed_intrinsics) {
CameraIntrinsics::Unpack(packed_intrinsics);
SetDistortion(packed_intrinsics.GetK1(), packed_intrinsics.GetK2());
}
// Brown model.
BrownCameraIntrinsics::BrownCameraIntrinsics()
@@ -362,6 +431,32 @@ void BrownCameraIntrinsics::InvertIntrinsics(
normalized_y);
}
void BrownCameraIntrinsics::Pack(
PackedIntrinsics* packed_intrinsics) const {
CameraIntrinsics::Pack(packed_intrinsics);
packed_intrinsics->SetK1(k1());
packed_intrinsics->SetK2(k2());
packed_intrinsics->SetK3(k3());
packed_intrinsics->SetK4(k4());
packed_intrinsics->SetP1(p1());
packed_intrinsics->SetP2(p2());
}
void BrownCameraIntrinsics::Unpack(
const PackedIntrinsics& packed_intrinsics) {
CameraIntrinsics::Unpack(packed_intrinsics);
SetRadialDistortion(packed_intrinsics.GetK1(),
packed_intrinsics.GetK2(),
packed_intrinsics.GetK3(),
packed_intrinsics.GetK4());
SetTangentialDistortion(packed_intrinsics.GetP1(),
packed_intrinsics.GetP2());
}
std::ostream& operator <<(std::ostream &os,
const CameraIntrinsics &intrinsics) {
if (intrinsics.focal_length_x() == intrinsics.focal_length_x()) {

View File

@@ -32,6 +32,7 @@
namespace libmv {
class CameraIntrinsics;
class PackedIntrinsics;
namespace internal {
@@ -146,10 +147,6 @@ class CameraIntrinsics {
double principal_point_x() const { return K_(0, 2); }
double principal_point_y() const { return K_(1, 2); }
virtual int num_distortion_parameters() const = 0;
virtual double *distortion_parameters() = 0;
virtual const double *distortion_parameters() const = 0;
// Set the image size in pixels.
// Image is the size of image camera intrinsics were calibrated with.
void SetImageSize(int width, int height);
@@ -197,6 +194,9 @@ class CameraIntrinsics {
double *normalized_x,
double *normalized_y) const = 0;
virtual void Pack(PackedIntrinsics* packed_intrinsics) const;
virtual void Unpack(const PackedIntrinsics& packed_intrinsics);
// Distort an image using the current camera instrinsics
//
// The distorted image is computed in output_buffer using samples from
@@ -281,7 +281,6 @@ class PolynomialCameraIntrinsics : public CameraIntrinsics {
OFFSET_K1,
OFFSET_K2,
OFFSET_K3,
OFFSET_K4, // Unused, needed to map properly with all deform parameters defined in bundle.cc.
OFFSET_P1,
OFFSET_P2,
@@ -297,10 +296,6 @@ class PolynomialCameraIntrinsics : public CameraIntrinsics {
return DISTORTION_MODEL_POLYNOMIAL;
}
int num_distortion_parameters() const { return NUM_PARAMETERS; }
double *distortion_parameters() { return parameters_; };
const double *distortion_parameters() const { return parameters_; };
double k1() const { return parameters_[OFFSET_K1]; }
double k2() const { return parameters_[OFFSET_K2]; }
double k3() const { return parameters_[OFFSET_K3]; }
@@ -332,6 +327,9 @@ class PolynomialCameraIntrinsics : public CameraIntrinsics {
double *normalized_x,
double *normalized_y) const;
virtual void Pack(PackedIntrinsics* packed_intrinsics) const override;
virtual void Unpack(const PackedIntrinsics& packed_intrinsics) override;
private:
// OpenCV's distortion model with third order polynomial radial distortion
// terms and second order tangential distortion. The distortion is applied to
@@ -360,10 +358,6 @@ class DivisionCameraIntrinsics : public CameraIntrinsics {
return DISTORTION_MODEL_DIVISION;
}
int num_distortion_parameters() const { return NUM_PARAMETERS; }
double *distortion_parameters() { return parameters_; };
const double *distortion_parameters() const { return parameters_; };
double k1() const { return parameters_[OFFSET_K1]; }
double k2() const { return parameters_[OFFSET_K2]; }
@@ -389,6 +383,9 @@ class DivisionCameraIntrinsics : public CameraIntrinsics {
double *normalized_x,
double *normalized_y) const;
virtual void Pack(PackedIntrinsics* packed_intrinsics) const override;
virtual void Unpack(const PackedIntrinsics& packed_intrinsics) override;
private:
// Double-parameter division distortion model.
double parameters_[NUM_PARAMETERS];
@@ -414,10 +411,6 @@ class NukeCameraIntrinsics : public CameraIntrinsics {
return DISTORTION_MODEL_NUKE;
}
int num_distortion_parameters() const { return NUM_PARAMETERS; }
double *distortion_parameters() { return parameters_; };
const double *distortion_parameters() const { return parameters_; };
double k1() const { return parameters_[OFFSET_K1]; }
double k2() const { return parameters_[OFFSET_K2]; }
@@ -443,6 +436,9 @@ class NukeCameraIntrinsics : public CameraIntrinsics {
double *normalized_x,
double *normalized_y) const;
virtual void Pack(PackedIntrinsics* packed_intrinsics) const override;
virtual void Unpack(const PackedIntrinsics& packed_intrinsics) override;
private:
// Double-parameter division distortion model.
double parameters_[NUM_PARAMETERS];
@@ -472,10 +468,6 @@ class BrownCameraIntrinsics : public CameraIntrinsics {
return DISTORTION_MODEL_BROWN;
}
int num_distortion_parameters() const { return NUM_PARAMETERS; }
double *distortion_parameters() { return parameters_; };
const double *distortion_parameters() const { return parameters_; };
double k1() const { return parameters_[OFFSET_K1]; }
double k2() const { return parameters_[OFFSET_K2]; }
double k3() const { return parameters_[OFFSET_K3]; }
@@ -508,6 +500,9 @@ class BrownCameraIntrinsics : public CameraIntrinsics {
double *normalized_x,
double *normalized_y) const;
virtual void Pack(PackedIntrinsics* packed_intrinsics) const override;
virtual void Unpack(const PackedIntrinsics& packed_intrinsics) override;
private:
double parameters_[NUM_PARAMETERS];
};

View File

@@ -42,7 +42,7 @@ void ProjectMarkerOnSphere(const Marker &marker, Vec3 &X) {
X *= 5.0 / X.norm();
}
void ModalSolverLogProress(ProgressUpdateCallback *update_callback,
void ModalSolverLogProgress(ProgressUpdateCallback *update_callback,
double progress) {
if (update_callback) {
char message[256];
@@ -116,7 +116,7 @@ void ModalSolver(const Tracks &tracks,
for (int image = 0; image <= max_image; ++image) {
vector<Marker> all_markers = tracks.MarkersInImage(image);
ModalSolverLogProress(update_callback, (float) image / max_image);
ModalSolverLogProgress(update_callback, (float) image / max_image);
// Skip empty images without doing anything.
if (all_markers.size() == 0) {
@@ -175,8 +175,9 @@ void ModalSolver(const Tracks &tracks,
// STEP 2: Refine rotation with Ceres.
ceres::Problem problem;
ceres::LocalParameterization* quaternion_parameterization =
new ceres::QuaternionParameterization;
// NOTE: Parameterization is lazily initialized when it is really needed,
// and is re-used by all parameters block.
ceres::LocalParameterization* quaternion_parameterization = NULL;
int num_residuals = 0;
for (int i = 0; i < all_markers.size(); ++i) {
@@ -195,6 +196,10 @@ void ModalSolver(const Tracks &tracks,
&quaternion(0));
num_residuals++;
if (quaternion_parameterization == NULL) {
quaternion_parameterization = new ceres::QuaternionParameterization();
}
problem.SetParameterization(&quaternion(0),
quaternion_parameterization);
}
@@ -235,7 +240,7 @@ void ModalSolver(const Tracks &tracks,
if (marker.image == image) {
// New track appeared on this image,
// project it's position onto sphere.
// project its position onto sphere.
LG << "Projecting track " << track << " at image " << image;

View File

@@ -0,0 +1,58 @@
// Copyright (c) 2020 libmv authors.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
#include "libmv/simple_pipeline/packed_intrinsics.h"
namespace libmv {
PackedIntrinsics::PackedIntrinsics() {
parameters_.fill(0.0);
known_parameters_.fill(false);
}
void PackedIntrinsics::SetFocalLength(double focal_length) {
SetParameter(OFFSET_FOCAL_LENGTH, focal_length);
}
double PackedIntrinsics::GetFocalLength() const {
return GetParameter(OFFSET_FOCAL_LENGTH);
}
void PackedIntrinsics::SetPrincipalPoint(double x, double y) {
SetParameter(OFFSET_PRINCIPAL_POINT_X, x);
SetParameter(OFFSET_PRINCIPAL_POINT_Y, y);
}
double PackedIntrinsics::GetPrincipalPointX() const {
return GetParameter(OFFSET_PRINCIPAL_POINT_X);
}
double PackedIntrinsics::GetPrincipalPointY() const {
return GetParameter(OFFSET_PRINCIPAL_POINT_Y);
}
void PackedIntrinsics::SetParameter(int index, double value) {
parameters_.at(index) = value;
known_parameters_.at(index) = value;
}
double PackedIntrinsics::GetParameter(int index) const {
// TODO(sergey): Consider adding a check for whether the parameter is known.
return parameters_.at(index);
}
} // namespace libmv

View File

@@ -0,0 +1,104 @@
// Copyright (c) 2020 libmv authors.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
#ifndef LIBMV_SIMPLE_PIPELINE_PACKED_INTRINSICS_H_
#define LIBMV_SIMPLE_PIPELINE_PACKED_INTRINSICS_H_
#include "libmv/base/array.h"
namespace libmv {
// Intrinsics parameters packed into a single continuous block of memory.
// Used in cases like minimization problems which involves camera intrinsics
// as a minimizing parameters.
//
// It keeps track of which parameters has been specified explicitly, which
// allows to mark parameters which are not used by distortion model as constant,
// which improves minimization quality.
class PackedIntrinsics {
public:
// Offsets of corresponding parameters in the array of all parameters.
enum {
// Camera calibration values.
OFFSET_FOCAL_LENGTH,
OFFSET_PRINCIPAL_POINT_X,
OFFSET_PRINCIPAL_POINT_Y,
// Distortion model coefficients.
OFFSET_K1,
OFFSET_K2,
OFFSET_K3,
OFFSET_K4,
OFFSET_P1,
OFFSET_P2,
// Number of parameters which are to be stored in the block.
NUM_PARAMETERS,
};
PackedIntrinsics();
void SetFocalLength(double focal_length);
double GetFocalLength() const;
void SetPrincipalPoint(double x, double y);
double GetPrincipalPointX() const;
double GetPrincipalPointY() const;
// TODO(sergey): Consider adding vectorized (Vec2) accessors for the principal
// point.
#define DEFINE_PARAMETER(parameter_name) \
void Set ## parameter_name(double value) { \
SetParameter(OFFSET_ ## parameter_name, value); \
} \
double Get ## parameter_name() const { \
return GetParameter(OFFSET_ ## parameter_name); \
} \
DEFINE_PARAMETER(K1)
DEFINE_PARAMETER(K2)
DEFINE_PARAMETER(K3)
DEFINE_PARAMETER(K4)
DEFINE_PARAMETER(P1)
DEFINE_PARAMETER(P2)
#undef DEFINE_PARAMETER
double* GetParametersBlock() { return parameters_.data(); }
const double* GetParametersBlock() const { return parameters_.data(); }
private:
void SetParameter(int index, double value);
double GetParameter(int index) const;
// All intrinsics parameters packed into a single block.
// Use OFFSET_FOO indexes to access corresponding values.
array<double, NUM_PARAMETERS> parameters_;
// Indexed by parameter offset, set to truth if the value of the parameter is
// explicitly specified.
array<bool, NUM_PARAMETERS> known_parameters_;
};
} // namespace libmv
#endif // LIBMV_SIMPLE_PIPELINE_PACKED_INTRINSICS_H_

View File

@@ -740,11 +740,13 @@ void MANTA::initializeRNAMap(FluidModifierData *fmd)
else if (fds->openvdb_compression == VDB_COMPRESSION_BLOSC)
vdbCompressionMethod = "Compression_Blosc";
string vdbPrecisionHalf = "True";
if (fds->openvdb_data_depth == VDB_PRECISION_HALF_FLOAT)
vdbPrecisionHalf = "True";
else if (fds->openvdb_data_depth == VDB_PRECISION_FULL_FLOAT)
vdbPrecisionHalf = "False";
string vdbPrecisionHalf = "Precision_Half";
if (fds->openvdb_data_depth == VDB_PRECISION_FULL_FLOAT)
vdbPrecisionHalf = "Precision_Full";
else if (fds->openvdb_data_depth == VDB_PRECISION_HALF_FLOAT)
vdbPrecisionHalf = "Precision_Half";
else if (fds->openvdb_data_depth == VDB_PRECISION_MINI_FLOAT)
vdbPrecisionHalf = "Precision_Mini";
mRNAMap["USING_SMOKE"] = getBooleanString(fds->type == FLUID_DOMAIN_TYPE_GAS);
mRNAMap["USING_LIQUID"] = getBooleanString(fds->type == FLUID_DOMAIN_TYPE_LIQUID);
@@ -843,6 +845,7 @@ void MANTA::initializeRNAMap(FluidModifierData *fmd)
mRNAMap["PARTICLE_MAXIMUM"] = to_string(fds->particle_maximum);
mRNAMap["PARTICLE_RADIUS"] = to_string(fds->particle_radius);
mRNAMap["FRACTIONS_THRESHOLD"] = to_string(fds->fractions_threshold);
mRNAMap["FRACTIONS_DISTANCE"] = to_string(fds->fractions_distance);
mRNAMap["MESH_CONCAVE_UPPER"] = to_string(fds->mesh_concave_upper);
mRNAMap["MESH_CONCAVE_LOWER"] = to_string(fds->mesh_concave_lower);
mRNAMap["MESH_PARTICLE_RADIUS"] = to_string(fds->mesh_particle_radius);

View File

@@ -122,7 +122,6 @@ timePerFrame_s$ID$ = $TIME_PER_FRAME$\n\
# In Blender fluid.c: frame_length = DT_DEFAULT * (25.0 / fps) * time_scale\n\
# with DT_DEFAULT = 0.1\n\
frameLength_s$ID$ = $FRAME_LENGTH$\n\
frameLengthUnscaled_s$ID$ = frameLength_s$ID$ / timeScale_s$ID$\n\
frameLengthRaw_s$ID$ = 0.1 * 25 # dt = 0.1 at 25 fps\n\
\n\
dt0_s$ID$ = $DT$\n\
@@ -149,23 +148,14 @@ mantaMsg('1 Blender length unit is ' + str(ratioResToBLength_s$ID$) + ' Mantaflo
ratioBTimeToTimestep_s$ID$ = float(1) / float(frameLengthRaw_s$ID$) # the time within 1 blender time unit, see also fluid.c\n\
mantaMsg('1 Blender time unit is ' + str(ratioBTimeToTimestep_s$ID$) + ' Mantaflow time units long.')\n\
\n\
ratioFrameToFramelength_s$ID$ = float(1) / float(frameLengthUnscaled_s$ID$ ) # the time within 1 frame\n\
mantaMsg('frame / frameLength is ' + str(ratioFrameToFramelength_s$ID$) + ' Mantaflow time units long.')\n\
\n\
scaleAcceleration_s$ID$ = ratioResToBLength_s$ID$ * (ratioBTimeToTimestep_s$ID$**2)# [meters/btime^2] to [cells/timestep^2] (btime: sec, min, or h, ...)\n\
mantaMsg('scaleAcceleration is ' + str(scaleAcceleration_s$ID$))\n\
\n\
scaleSpeedFrames_s$ID$ = ratioResToBLength_s$ID$ * ratioFrameToFramelength_s$ID$ # [blength/frame] to [cells/frameLength]\n\
mantaMsg('scaleSpeed is ' + str(scaleSpeedFrames_s$ID$))\n\
\n\
scaleSpeedTime_s$ID$ = ratioResToBLength_s$ID$ * ratioBTimeToTimestep_s$ID$ # [blength/btime] to [cells/frameLength]\n\
mantaMsg('scaleSpeedTime is ' + str(scaleSpeedTime_s$ID$))\n\
\n\
gravity_s$ID$ *= scaleAcceleration_s$ID$ # scale from world acceleration to cell based acceleration\n\
\n\
# OpenVDB options\n\
vdbCompression_s$ID$ = $COMPRESSION_OPENVDB$\n\
vdbPrecisionHalf_s$ID$ = $PRECISION_OPENVDB$\n\
vdbPrecision_s$ID$ = $PRECISION_OPENVDB$\n\
\n\
# Cache file names\n\
file_data_s$ID$ = '$NAME_DATA$'\n\
@@ -380,17 +370,10 @@ def fluid_pre_step_$ID$():\n\
x_obvel_s$ID$.safeDivide(numObs_s$ID$)\n\
y_obvel_s$ID$.safeDivide(numObs_s$ID$)\n\
z_obvel_s$ID$.safeDivide(numObs_s$ID$)\n\
\n\
x_obvel_s$ID$.multConst(scaleSpeedFrames_s$ID$)\n\
y_obvel_s$ID$.multConst(scaleSpeedFrames_s$ID$)\n\
z_obvel_s$ID$.multConst(scaleSpeedFrames_s$ID$)\n\
copyRealToVec3(sourceX=x_obvel_s$ID$, sourceY=y_obvel_s$ID$, sourceZ=z_obvel_s$ID$, target=obvelC_s$ID$)\n\
\n\
# translate invels (world space) to grid space\n\
if using_invel_s$ID$:\n\
x_invel_s$ID$.multConst(scaleSpeedTime_s$ID$)\n\
y_invel_s$ID$.multConst(scaleSpeedTime_s$ID$)\n\
z_invel_s$ID$.multConst(scaleSpeedTime_s$ID$)\n\
copyRealToVec3(sourceX=x_invel_s$ID$, sourceY=y_invel_s$ID$, sourceZ=z_invel_s$ID$, target=invelC_s$ID$)\n\
\n\
if using_guiding_s$ID$:\n\
@@ -400,9 +383,6 @@ def fluid_pre_step_$ID$():\n\
velT_s$ID$.multConst(vec3(gamma_sg$ID$))\n\
\n\
# translate external forces (world space) to grid space\n\
x_force_s$ID$.multConst(scaleSpeedFrames_s$ID$)\n\
y_force_s$ID$.multConst(scaleSpeedFrames_s$ID$)\n\
z_force_s$ID$.multConst(scaleSpeedFrames_s$ID$)\n\
copyRealToVec3(sourceX=x_force_s$ID$, sourceY=y_force_s$ID$, sourceZ=z_force_s$ID$, target=forces_s$ID$)\n\
\n\
# If obstacle has velocity, i.e. is a moving obstacle, switch to dynamic preconditioner\n\
@@ -626,10 +606,6 @@ def bake_guiding_process_$ID$(framenr, format_guiding, path_guiding, resumable):
x_guidevel_s$ID$.safeDivide(numGuides_s$ID$)\n\
y_guidevel_s$ID$.safeDivide(numGuides_s$ID$)\n\
z_guidevel_s$ID$.safeDivide(numGuides_s$ID$)\n\
\n\
x_guidevel_s$ID$.multConst(scaleSpeedFrames_s$ID$)\n\
y_guidevel_s$ID$.multConst(scaleSpeedFrames_s$ID$)\n\
z_guidevel_s$ID$.multConst(scaleSpeedFrames_s$ID$)\n\
copyRealToVec3(sourceX=x_guidevel_s$ID$, sourceY=y_guidevel_s$ID$, sourceZ=z_guidevel_s$ID$, target=guidevelC_s$ID$)\n\
\n\
mantaMsg('Extrapolating guiding velocity')\n\
@@ -718,7 +694,7 @@ def fluid_file_export_s$ID$(framenr, file_format, path, dict, file_name=None, mo
file = os.path.join(path, file_name + '_' + framenr + file_format)\n\
if not os.path.isfile(file) or mode_override:\n\
if file_format == '.vdb':\n\
saveCombined = save(name=file, objects=list(dict.values()), worldSize=domainSize_s$ID$, skipDeletedParts=True, compression=vdbCompression_s$ID$, precisionHalf=vdbPrecisionHalf_s$ID$)\n\
saveCombined = save(name=file, objects=list(dict.values()), worldSize=domainSize_s$ID$, skipDeletedParts=True, compression=vdbCompression_s$ID$, precision=vdbPrecision_s$ID$)\n\
elif file_format == '.bobj.gz' or file_format == '.obj':\n\
for name, object in dict.items():\n\
if not os.path.isfile(file) or mode_override:\n\

View File

@@ -41,6 +41,7 @@ using_mesh_s$ID$ = $USING_MESH$\n\
using_final_mesh_s$ID$ = $USING_IMPROVED_MESH$\n\
using_fractions_s$ID$ = $USING_FRACTIONS$\n\
fracThreshold_s$ID$ = $FRACTIONS_THRESHOLD$\n\
fracDistance_s$ID$ = $FRACTIONS_DISTANCE$\n\
flipRatio_s$ID$ = $FLIP_RATIO$\n\
concaveUpper_s$ID$ = $MESH_CONCAVE_UPPER$\n\
concaveLower_s$ID$ = $MESH_CONCAVE_LOWER$\n\
@@ -243,11 +244,16 @@ def liquid_step_$ID$():\n\
pp_s$ID$.advectInGrid(flags=flags_s$ID$, vel=vel_s$ID$, integrationMode=IntRK4, deleteInObstacle=deleteInObstacle_s$ID$, stopInObstacle=False, skipNew=True)\n\
\n\
mantaMsg('Pushing particles out of obstacles')\n\
if using_obstacle_s$ID$ and using_fractions_s$ID$ and fracDistance_s$ID$ > 0:\n\
# Optional: Increase distance between fluid and obstacles (only obstacles, not borders)\n\
pushOutofObs(parts=pp_s$ID$, flags=flags_s$ID$, phiObs=phiObsIn_s$ID$, thresh=fracDistance_s$ID$)\n\
pushOutofObs(parts=pp_s$ID$, flags=flags_s$ID$, phiObs=phiObs_s$ID$)\n\
\n\
# save original states for later (used during mesh / secondary particle creation)\n\
phiTmp_s$ID$.copyFrom(phi_s$ID$)\n\
velTmp_s$ID$.copyFrom(vel_s$ID$)\n\
# but only save the state at the beginning of an adaptive frame\n\
if not s$ID$.timePerFrame:\n\
phiTmp_s$ID$.copyFrom(phi_s$ID$)\n\
velTmp_s$ID$.copyFrom(vel_s$ID$)\n\
\n\
mantaMsg('Advecting phi')\n\
advectSemiLagrange(flags=flags_s$ID$, vel=vel_s$ID$, grid=phi_s$ID$, order=1) # first order is usually enough\n\
@@ -302,7 +308,7 @@ def liquid_step_$ID$():\n\
PD_fluid_guiding(vel=vel_s$ID$, velT=velT_s$ID$, flags=flags_s$ID$, phi=phi_s$ID$, curv=curvature_s$ID$, surfTens=surfaceTension_s$ID$, fractions=fractions_s$ID$, weight=weightGuide_s$ID$, blurRadius=beta_sg$ID$, pressure=pressure_s$ID$, tau=tau_sg$ID$, sigma=sigma_sg$ID$, theta=theta_sg$ID$, zeroPressureFixing=domainClosed_s$ID$)\n\
else:\n\
mantaMsg('Pressure')\n\
solvePressure(flags=flags_s$ID$, vel=vel_s$ID$, pressure=pressure_s$ID$, phi=phi_s$ID$, curv=curvature_s$ID$, surfTens=surfaceTension_s$ID$, fractions=fractions_s$ID$, obvel=obvel_s$ID$ if using_fractions_s$ID$ else None, zeroPressureFixing=domainClosed_s$ID$)\n\
solvePressure(flags=flags_s$ID$, vel=vel_s$ID$, pressure=pressure_s$ID$, curv=curvature_s$ID$, surfTens=surfaceTension_s$ID$, fractions=fractions_s$ID$, obvel=obvel_s$ID$ if using_fractions_s$ID$ else None, zeroPressureFixing=domainClosed_s$ID$)\n\
\n\
extrapolateMACSimple(flags=flags_s$ID$, vel=vel_s$ID$, distance=4, intoObs=True if using_fractions_s$ID$ else False)\n\
setWallBcs(flags=flags_s$ID$, vel=vel_s$ID$, obvel=None if using_fractions_s$ID$ else obvel_s$ID$, phiObs=phiObs_s$ID$, fractions=fractions_s$ID$)\n\

View File

@@ -1076,7 +1076,7 @@ static tbool AssignRecur(const int piTriListIn[],
return TFALSE;
if ((pMyTriInfo->iFlag & GROUP_WITH_ANY) != 0) {
// first to group with a group-with-anything triangle
// determines it's orientation.
// determines its orientation.
// This is the only existing order dependency in the code!!
if (pMyTriInfo->AssignedGroup[0] == NULL && pMyTriInfo->AssignedGroup[1] == NULL &&
pMyTriInfo->AssignedGroup[2] == NULL) {

View File

@@ -471,7 +471,7 @@ bool OCIOImpl::supportGLSLDraw()
* using regular 2D texture.
*
* When all drawing is finished, finishGLSLDraw shall be called to
* restore OpenGL context to it's pre-GLSL draw state.
* restore OpenGL context to its pre-GLSL draw state.
*/
bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r,
OCIO_ConstProcessorRcPtr *ocio_processor_scene_to_ui,

View File

@@ -250,7 +250,7 @@ inline bool TopologyRefinerFactory<TopologyRefinerData>::assignComponentTags(
base_mesh_topology->setVertexSharpness(vertex_index, sharpness);
}
// If it's vertex where 2 non-manifold edges meet adjust vertex sharpness to
// If its vertex where 2 non-manifold edges meet adjust vertex sharpness to
// the edges.
// This way having a plane with all 4 edges set to be sharp produces sharp
// corners in the subdivided result.

View File

@@ -107,7 +107,7 @@ typedef struct OpenSubdiv_Converter {
bool (*isInfiniteSharpVertex)(const struct OpenSubdiv_Converter *converter,
const int vertex_index);
// If vertex is not infinitely sharp, this is it's actual sharpness.
// If vertex is not infinitely sharp, this is its actual sharpness.
float (*getVertexSharpness)(const struct OpenSubdiv_Converter *converter,
const int vertex_index);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -1,185 +1,46 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="1280"
height="256"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
version="1.0"
sodipodi:docname="alert_icons.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
style="display:inline;enable-background:new"
inkscape:export-filename="alert_icons.png"
inkscape:export-xdpi="96.000008"
inkscape:export-ydpi="96.000008">
<metadata
id="metadata5323">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1017"
id="namedview5321"
showgrid="true"
inkscape:zoom="1"
inkscape:cx="935.85776"
inkscape:cy="91.379624"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="layer2"
showguides="true"
inkscape:guide-bbox="true"
inkscape:document-rotation="0"
inkscape:snap-global="false">
<inkscape:grid
type="xygrid"
id="grid9048"
spacingx="256"
spacingy="256"
empcolor="#818181"
empopacity="0.25098039"
visible="true"
enabled="true" />
<inkscape:grid
type="xygrid"
id="grid5904"
spacingx="8"
spacingy="8"
color="#0effa8"
opacity="0.1254902"
dotted="true"
empspacing="1"
enabled="true" />
<inkscape:grid
type="xygrid"
id="grid5914"
spacingx="2"
spacingy="2"
enabled="false" />
</sodipodi:namedview>
<defs
id="defs4" />
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="ICONS"
style="display:inline">
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:16.6870575;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:new"
d="m 127.63711,28.7478 c -5.87683,0.194787 -11.21722,3.472426 -14.05563,8.62676 L 23.520017,200.96344 c -6.122262,11.1248 1.916754,24.74614 14.606389,24.74895 H 218.24917 c 12.68963,-0.003 20.72865,-13.62415 14.6064,-24.74895 L 142.79409,37.37456 c -3.02886,-5.500109 -8.88551,-8.833516 -15.15698,-8.62676 z m 0.22154,6.670573 v 0 c 3.73286,-0.124026 7.22725,1.867665 9.02982,5.141498 l 90.14625,163.738859 c 3.60722,6.55818 -1.22393,14.73515 -8.70414,14.73655 H 38.0383 c -7.480045,-0.002 -12.311115,-8.17837 -8.703973,-14.73655 L 119.48372,40.559871 c 1.68886,-3.067777 4.87047,-5.025451 8.36825,-5.141498 z m 0.11013,3.341816 c -2.32339,0.07946 -4.43144,1.37183 -5.55381,3.410278 L 32.268804,205.90932 c -2.456157,4.46565 0.682153,9.78322 5.775511,9.78416 H 218.33641 c 5.09337,-8.3e-4 8.23175,-5.31851 5.77562,-9.78416 L 133.96261,42.170467 c -1.19843,-2.176546 -3.50581,-3.490246 -5.98737,-3.410278 v 0 z M 120,88 h 16 c 2.04554,5e-4 4.12156,2.199338 4,4 l -6,74 c -0.11183,1.65503 -0.59661,2.75123 -2.47659,2.75165 l -7.04624,-0.0312 C 122.59719,168.71998 122.11192,167.65503 122,166 l -6,-74 c -0.12175,-1.800662 1.95448,-3.9995 4,-4 z m 8,90 c 5.52669,-2e-5 10,4.4685 10,10 0,5.53149 -4.47331,10.00002 -10,10 -5.52677,2e-5 -10.00016,-4.46851 -10,-10 -1.6e-4,-5.5315 4.47323,-10.00002 10,-10 z"
id="path6144"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccc" />
<path
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:99.71450043px;line-height:0;font-family:Balloons;-inkscape-font-specification:Balloons;letter-spacing:0px;word-spacing:0px;display:inline;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:17.32685852;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:normal;enable-background:new"
d="m 383.95942,24 c -57.41261,0 -103.95477,46.547438 -103.95477,103.96662 0,57.41919 46.54216,103.96662 103.95477,103.96662 57.4126,0 103.95484,-46.54743 103.95484,-103.96662 C 487.91426,70.547438 441.37202,24 383.95942,24 Z m 0,6.601049 c 53.74795,0 97.35455,43.611594 97.35455,97.365571 0,53.75398 -43.6066,97.36556 -97.35455,97.36556 -53.74796,0 -97.35448,-43.61158 -97.35448,-97.36556 0,-53.753977 43.60652,-97.365571 97.35448,-97.365571 z m 0,3.300528 c -51.9643,0 -94.05432,42.094804 -94.05432,94.065043 0,51.97024 42.09002,94.06504 94.05432,94.06504 51.96438,0 94.05439,-42.09482 94.05439,-94.06504 0,-51.970239 -42.09001,-94.065043 -94.05439,-94.065043 z m 0.0908,32.982721 c 9.84154,-0.01154 19.616,3.163309 27.0651,9.337525 7.44926,6.174231 12.46912,15.484523 12.46912,26.990837 0,30.52988 -31.3515,32.18014 -31.3515,51.15818 v 6.62361 c -1.7e-4,1.82277 -1.47764,3.30035 -3.30015,3.30053 h -9.94566 c -1.82251,-1.8e-4 -3.29998,-1.47776 -3.30014,-3.30053 v -6.62361 c 0,-29.70475 31.37409,-29.70475 31.35149,-51.15818 0,-6.446126 -2.72956,-11.141868 -7.00639,-14.520388 -4.27665,-3.378519 -10.19753,-5.260217 -16.09787,-5.260217 -5.62494,0 -11.59672,2.555319 -16.01727,6.236842 -4.42104,3.681525 -7.05852,8.409614 -7.05852,11.893503 -1.7e-4,1.82275 -1.47765,3.30035 -3.30015,3.30053 h -9.90045 c -1.82251,-1.8e-4 -3.29998,-1.47778 -3.30015,-3.30053 0,-9.471145 5.13288,-18.135164 12.52374,-24.39618 7.39102,-6.26102 17.1535,-10.269545 27.1683,-10.281922 z m -0.19653,105.739362 c 5.46786,-1e-5 9.90045,4.43309 9.90045,9.90159 0,5.4685 -4.43259,9.9016 -9.90045,9.90159 -5.46785,1e-5 -9.90043,-4.43309 -9.90043,-9.90159 0,-5.4685 4.43258,-9.9016 9.90043,-9.90159 z"
id="circle6315"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ssssssssssssssscccccccccccsccccccccccccc" />
<path
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
inkscape:connector-curvature="0"
id="path6333"
d="m 599.84744,24 c -1.80933,3.07e-4 -3.54432,0.719021 -4.82371,1.998072 l -57.09842,57.077994 c -1.27955,1.278828 -1.99844,3.013304 -1.99878,4.821983 v 80.215561 c 3.4e-4,1.80869 0.71921,3.54317 1.99878,4.822 l 57.09842,57.078 c 1.27939,1.27906 3.01438,1.99776 4.82371,1.99807 h 80.24427 c 1.80933,-3.1e-4 3.54432,-0.71901 4.82372,-1.99807 l 57.09841,-57.078 c 1.27955,-1.27883 1.99845,-3.01331 1.99878,-4.822 V 87.898049 c 5.1e-4,-1.806564 -0.71597,-3.539557 -1.99211,-4.818658 L 685.03536,26.001397 C 683.75491,24.719499 682.01719,23.999438 680.20496,24 Z m 0.7029,6.820055 h 78.9484 c 0.4535,-8.02e-4 0.88863,0.17894 1.20926,0.499517 l 55.98244,56.075635 c 0.31986,0.319706 0.4996,0.753326 0.49969,1.205495 v 78.810278 c -9e-5,0.45216 -0.17983,0.88577 -0.49969,1.20549 l -56.0957,56.07563 c -0.31982,0.31975 -0.75359,0.49943 -1.20592,0.49951 h -78.83848 c -0.45233,-8e-5 -0.88611,-0.17976 -1.20592,-0.49951 l -56.0957,-56.07563 c -0.31987,-0.31972 -0.49961,-0.75333 -0.4997,-1.20549 V 88.600702 c 9e-5,-0.452169 0.17983,-0.885789 0.4997,-1.205495 l 56.0957,-56.075635 c 0.31981,-0.319758 0.75359,-0.499433 1.20592,-0.499517 z m 0.70624,3.410027 -55.09631,55.076599 v 77.398309 l 55.09631,55.07659 h 77.42599 l 55.09631,-55.07659 V 89.306681 L 678.79251,34.230082 Z m 0.28649,43.477851 c 0.92189,-0.01364 1.80993,0.34714 2.46182,0.999035 l 35.96469,36.511252 35.96468,-36.511252 c 1.33226,-1.331257 3.49144,-1.331257 4.8237,0 l 8.52812,8.525069 c 1.33158,1.331718 1.33158,3.490265 0,4.821983 l -36.52432,35.95182 36.52432,35.95182 c 1.33158,1.33172 1.33158,3.49026 0,4.82197 l -8.52812,8.52507 c -1.33226,1.33127 -3.49144,1.33127 -4.8237,0 l -35.96468,-36.51126 -35.96469,36.51126 c -1.33226,1.33127 -3.49143,1.33127 -4.8237,0 l -8.52812,-8.52507 c -1.33158,-1.33171 -1.33158,-3.49025 0,-4.82197 L 627.1774,128.00584 590.65307,92.05402 c -1.33158,-1.331718 -1.33158,-3.490265 0,-4.821983 l 8.52812,-8.525069 c 0.62733,-0.627427 1.47461,-0.985395 2.36188,-0.999035 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:6.82127094;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:normal;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
style="display:inline;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.4464879;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:normal;enable-background:new"
d="m 824.87953,24.018442 c -19.10949,0 -34.49375,15.358505 -34.49375,34.436102 v 99.864706 c 0,17.91493 13.56662,32.54727 31.04439,34.26458 v -6.90406 C 807.68893,184.01188 797.2408,172.53207 797.2408,158.31925 V 58.454544 c 0,-15.383034 12.23007,-27.592598 27.63873,-27.592598 h 144.8736 c 15.40867,0 27.63877,12.209564 27.63877,27.592598 v 99.864706 c 0,15.38302 -12.2301,27.59259 -27.63877,27.59259 h -95.80091 l -5.63213,6.84349 h 101.43304 c 19.1095,0 34.49377,-15.3585 34.49377,-34.43608 V 58.454544 c 0,-19.077597 -15.38427,-34.436102 -34.49377,-34.436102 z m 0,10.287115 c -13.59981,0 -24.18938,10.571906 -24.18938,24.148987 v 99.864706 c 0,13.57706 10.58957,24.14898 24.18938,24.14898 v 3.44361 6.84349 3.44361 34.43612 c 7e-4,3.22387 4.06509,4.65054 6.10375,2.19934 l 0.91288,-1.09632 32.39946,-38.98275 h 0.0303 l 8.58971,-10.32409 c 0.0742,-0.0121 0.15004,-0.0207 0.22575,-0.0235 0.1673,-0.003 0.33391,0.0172 0.49516,0.0606 h 96.11747 c 13.59983,0 24.18941,-10.57191 24.18941,-24.14899 V 58.454579 c 0,-13.577083 -10.58958,-24.148987 -24.18941,-24.148987 z m 70.60096,20.809631 c 5.71509,-1.6e-5 10.3481,4.625269 10.3481,10.330833 0,5.705565 -4.63301,10.330849 -10.3481,10.33083 -5.71525,1.9e-5 -10.34827,-4.625265 -10.3481,-10.33083 -1.7e-4,-5.705564 4.63285,-10.330849 10.3481,-10.330833 z m 5.28521,32.610044 c 0.21939,4.99e-4 0.43816,0.02186 0.65348,0.06387 2.54598,0.323665 4.52032,2.47196 4.52057,5.10152 v 55.097748 h 8.62342 c 1.905,2e-4 3.4492,1.54185 3.44937,3.44361 v 3.44363 c -1.7e-4,1.90176 -1.54437,3.44343 -3.44937,3.44362 H 880.0695 c -1.905,-1.9e-4 -3.4492,-1.54186 -3.44936,-3.44362 v -3.44363 c 1.6e-4,-1.90176 1.54436,-3.44341 3.44936,-3.44361 h 8.62341 V 98.056045 h -8.62341 c -1.905,-1.9e-4 -3.4492,-1.541842 -3.44936,-3.443611 v -3.443609 c 1.6e-4,-1.901769 1.54436,-3.443422 3.44936,-3.443611 z"
id="rect6452"
inkscape:connector-curvature="0"
sodipodi:nodetypes="sssccsssssssccssssssssccccccccccccssssscscccccccccccccccccccccc" />
<g
id="g888">
<path
inkscape:transform-center-y="-16.504573"
inkscape:transform-center-x="7.7978312"
d="m 1234.3776,142.72031 a 49.979294,47.518188 0 0 1 -49.8548,47.51804 49.979294,47.518188 0 0 1 -50.1032,-47.28143 49.979294,47.518188 0 0 1 49.6054,-47.753477 49.979294,47.518188 0 0 1 50.3501,47.043637"
sodipodi:open="true"
sodipodi:end="6.2732263"
sodipodi:start="0"
sodipodi:ry="47.518188"
sodipodi:rx="49.979294"
sodipodi:cy="142.72031"
sodipodi:cx="1184.3983"
sodipodi:type="arc"
id="path869"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke-width:4.34395075;stroke-miterlimit:4;stroke-dasharray:none" />
<g
transform="matrix(4.318758,0,0,4.4238041,-165.58547,-1034.3978)"
id="g15769">
<path
inkscape:connector-curvature="0"
id="path14548"
style="clip-rule:evenodd;display:inline;fill:#265787;fill-rule:nonzero;stroke-width:0.88226169;stroke-linejoin:round;stroke-miterlimit:1.41420996"
d="m 306.07569,265.40069 c 0.0928,-1.6816 0.90332,-3.16312 2.12613,-4.21334 1.19918,-1.03156 2.81325,-1.66205 4.57438,-1.66205 1.75937,0 3.37345,0.63049 4.5735,1.66205 1.22194,1.05022 2.03248,2.53174 2.12613,4.21157 0.0928,1.72784 -0.59083,3.33297 -1.79001,4.52281 -1.22281,1.21029 -2.96205,1.96973 -4.90962,1.96973 -1.94757,0 -3.69031,-0.75944 -4.91225,-1.96973 -1.20005,-1.18984 -1.88192,-2.79497 -1.78826,-4.52104 z" />
<path
inkscape:connector-curvature="0"
id="path14552"
style="clip-rule:evenodd;display:inline;fill:#e87d0d;fill-rule:nonzero;stroke-width:0.88226169;stroke-linejoin:round;stroke-miterlimit:1.41420996"
d="m 295.40565,268.79858 c 0.0114,0.65806 0.21795,1.93683 0.52781,2.93547 0.65123,2.11379 1.75587,4.06929 3.29292,5.79269 1.57731,1.77142 3.51963,3.19425 5.76305,4.20446 2.35809,1.06089 4.91312,1.60157 7.56707,1.59712 2.64956,-0.004 5.2046,-0.5549 7.56269,-1.6238 2.24342,-1.01999 4.18398,-2.44904 5.75867,-4.22135 1.53617,-1.73052 2.63906,-3.68957 3.29205,-5.80336 0.32824,-1.06801 0.53569,-2.15203 0.61884,-3.2396 0.0814,-1.07157 0.0473,-2.14491 -0.10241,-3.21737 -0.29235,-2.08978 -1.00398,-4.05061 -2.09987,-5.83804 -1.00223,-1.64248 -2.29419,-3.08042 -3.83036,-4.29072 l 0.004,-0.003 -15.50264,-12.09315 c -0.014,-0.0107 -0.0254,-0.0222 -0.0403,-0.032 -1.01711,-0.79323 -2.72747,-0.79056 -3.84612,0.004 -1.1309,0.8039 -1.26045,2.13336 -0.25384,2.97193 l -0.004,0.004 6.46593,5.34183 -19.70764,0.0213 c -0.01,0 -0.0192,0 -0.0262,0 -1.62896,0.002 -3.19489,1.08757 -3.50475,2.45971 -0.31861,1.39793 0.78778,2.55753 2.48151,2.56376 l -0.003,0.006 9.98906,-0.0196 -17.82484,13.90014 c -0.0228,0.0169 -0.0473,0.0347 -0.0683,0.0516 -1.68147,1.30812 -2.22504,3.48326 -1.16591,4.85985 1.07488,1.39971 3.36032,1.40238 5.0593,0.008 l 9.72805,-8.08876 c 0,0 -0.1418,1.09202 -0.13042,1.74741 z m 24.99801,3.65667 c -2.00446,2.07466 -4.81071,3.25116 -7.84716,3.25739 -3.04084,0.005 -5.84708,-1.1605 -7.85155,-3.2316 -0.97947,-1.00932 -1.69898,-2.1707 -2.14276,-3.40767 -0.43503,-1.21563 -0.60396,-2.50596 -0.49192,-3.80785 0.10591,-1.27254 0.47879,-2.48639 1.074,-3.58463 0.58471,-1.07957 1.39,-2.0551 2.38435,-2.88034 1.94844,-1.61313 4.42908,-2.48639 7.0235,-2.48995 2.59705,-0.004 5.07593,0.8617 7.02613,2.4695 0.9926,0.82168 1.79701,1.79365 2.38172,2.87144 0.59784,1.09736 0.96809,2.30676 1.07838,3.58286 0.11029,1.30011 -0.0586,2.58866 -0.49368,3.80517 -0.44466,1.24053 -1.16153,2.40192 -2.14101,3.41568 z" />
</g>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="320" height="64" viewBox="0 0 320 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;">
<rect id="bg" x="0" y="0" width="320" height="64" style="fill:#202020; display:none;"/>
<g id="grid" opacity="0.05" style="display:none;">
<rect x="262" y="6" width="52" height="52" style="fill:#fff;"/>
<rect x="198" y="6" width="52" height="52" style="fill:#fff;"/>
<rect x="134" y="6" width="52" height="52" style="fill:#fff;"/>
<rect x="70" y="6" width="52" height="52" style="fill:#fff;"/>
<rect x="6" y="6" width="52" height="52" style="fill:#fff;"/>
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="sheet_layout"
style="display:none">
<g
style="opacity:1"
id="g3323">
<rect
y="0"
x="768"
height="256"
width="256"
id="rect6450"
style="display:inline;vector-effect:none;fill:#1a1a1a;fill-opacity:1;stroke:none;stroke-width:7.5590601;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:105.70800018;stroke-opacity:1;marker:none;paint-order:fill markers stroke;enable-background:new" />
<rect
style="display:inline;vector-effect:none;fill:#1a1a1a;fill-opacity:1;stroke:none;stroke-width:7.5590601;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:105.70800018;stroke-opacity:1;marker:none;paint-order:fill markers stroke;enable-background:new"
id="rect6442"
width="256"
height="256"
x="512"
y="0" />
<rect
style="display:inline;vector-effect:none;fill:#1a1a1a;fill-opacity:1;stroke:none;stroke-width:7.5590601;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:105.70800018;stroke-opacity:1;marker:none;paint-order:fill markers stroke;enable-background:new"
id="rect6134"
width="256"
height="256"
x="0"
y="0" />
<rect
y="0"
x="256"
height="256"
width="256"
id="rect6161"
style="display:inline;vector-effect:none;fill:#1a1a1a;fill-opacity:1;stroke:none;stroke-width:7.5590601;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:105.70800018;stroke-opacity:1;marker:none;paint-order:fill markers stroke;enable-background:new" />
<g id="WARNING">
<path d="M35.462,10.006c-0.714,-1.241 -2.036,-2.006 -3.468,-2.006c-1.432,-0 -2.754,0.765 -3.468,2.006l-23,40c-0.711,1.238 -0.709,2.761 0.006,3.997c0.715,1.236 2.034,1.997 3.462,1.997l46,0c1.428,0 2.747,-0.761 3.462,-1.997c0.715,-1.236 0.717,-2.759 0.006,-3.997l-23,-40Zm-2.601,1.496l23,40c0.178,0.309 0.177,0.69 -0.001,0.999c-0.179,0.309 -0.509,0.499 -0.866,0.499l-46,0c-0.357,-0 -0.687,-0.19 -0.866,-0.499c-0.178,-0.309 -0.179,-0.69 -0.001,-0.999c0,-0 23,-40 23,-40c0.179,-0.311 0.509,-0.502 0.867,-0.502c0.358,0 0.689,0.191 0.867,0.502Z" style="fill:#fff;"/>
<circle cx="32" cy="46.5" r="2.5" style="fill:#fff;"/>
<path d="M32,24c1.38,0 2.5,1.12 2.5,2.5l-1.5,14.5l-2,0l-1.5,-14.5c0,-1.38 1.12,-2.5 2.5,-2.5Z" style="fill:#fff;"/>
</g>
<g id="QUESTION">
<path d="M96,6c14.35,-0 26,11.65 26,26c-0,14.35 -11.65,26 -26,26c-14.35,-0 -26,-11.65 -26,-26c-0,-14.35 11.65,-26 26,-26Zm-0,3c12.694,-0 23,10.306 23,23c-0,12.694 -10.306,23 -23,23c-12.694,-0 -23,-10.306 -23,-23c-0,-12.694 10.306,-23 23,-23Z" style="fill:#fff;"/>
<circle cx="96" cy="44" r="3" style="fill:#fff;"/>
<path d="M90.549,23.479l-1.513,-3.293c-0.002,-0.011 3.28,-2.209 7.964,-2.186c3.557,0.018 5.213,1.34 5.855,1.849c1.185,0.939 2.131,2.714 2.131,5.105c-0,0.741 -0.095,1.683 -0.424,2.567c-0.292,0.787 -0.706,1.528 -1.226,2.142c-0.883,1.042 -2.347,2.273 -2.825,2.656c-0.477,0.382 -1.73,1.348 -2.411,2.341c-0.48,0.7 -0.6,1.743 -0.6,2.485l-0,0.855l-3.5,0l0,-1.236c0,-0.269 0.032,-2.339 0.716,-3.511c0.709,-1.212 1.371,-1.885 2.599,-2.906c1.204,-1.002 2.275,-1.967 2.841,-2.814c0.54,-0.81 0.637,-1.629 0.637,-2.399c0,-0.77 -0.167,-1.716 -1.036,-2.482c-0.797,-0.702 -2.36,-0.865 -3.257,-0.865c-1.083,-0 -1.867,0.158 -2.99,0.526c-1.448,0.475 -2.961,1.166 -2.961,1.166Z" style="fill:#fff;"/>
</g>
<g id="ERROR">
<path d="M186,22.059c0,-0.531 -0.211,-1.039 -0.586,-1.414l-14.059,-14.059c-0.375,-0.375 -0.883,-0.586 -1.414,-0.586l-19.882,0c-0.531,0 -1.039,0.211 -1.414,0.586l-14.059,14.059c-0.375,0.375 -0.586,0.883 -0.586,1.414l-0,19.882c0,0.531 0.211,1.039 0.586,1.414l14.059,14.059c0.375,0.375 0.883,0.586 1.414,0.586l19.882,-0c0.531,-0 1.039,-0.211 1.414,-0.586l14.059,-14.059c0.375,-0.375 0.586,-0.883 0.586,-1.414l-0,-19.882Zm-3,0.828c0,-0.265 -0.105,-0.519 -0.293,-0.707l-12.887,-12.887c-0.188,-0.188 -0.442,-0.293 -0.707,-0.293l-18.226,0c-0.265,0 -0.519,0.105 -0.707,0.293l-12.887,12.887c-0.188,0.188 -0.293,0.442 -0.293,0.707l0,18.226c0,0.265 0.105,0.519 0.293,0.707l12.887,12.887c0.188,0.188 0.442,0.293 0.707,0.293l18.226,-0c0.265,0 0.519,-0.105 0.707,-0.293l12.887,-12.887c0.188,-0.188 0.293,-0.442 0.293,-0.707l0,-18.226Z" style="fill:#fff;"/>
<path d="M150.808,19.979c-0.391,-0.39 -1.024,-0.39 -1.415,0l-1.414,1.414c-0.39,0.391 -0.39,1.024 0,1.415l21.213,21.213c0.391,0.39 1.024,0.39 1.415,-0l1.414,-1.414c0.39,-0.391 0.39,-1.024 -0,-1.415l-21.213,-21.213Z" style="fill:#fff;"/>
<path d="M172.021,22.808c0.39,-0.391 0.39,-1.024 -0,-1.415l-1.414,-1.414c-0.391,-0.39 -1.024,-0.39 -1.415,0l-21.213,21.213c-0.39,0.391 -0.39,1.024 0,1.415l1.414,1.414c0.391,0.39 1.024,0.39 1.415,-0l21.213,-21.213Z" style="fill:#fff;"/>
</g>
<g id="ERROR-ALT" style="display:none;">
<path d="M186,22.059c0,-0.531 -0.211,-1.039 -0.586,-1.414l-14.059,-14.059c-0.375,-0.375 -0.883,-0.586 -1.414,-0.586l-19.882,0c-0.531,0 -1.039,0.211 -1.414,0.586l-14.059,14.059c-0.375,0.375 -0.586,0.883 -0.586,1.414l-0,19.882c0,0.531 0.211,1.039 0.586,1.414l14.059,14.059c0.375,0.375 0.883,0.586 1.414,0.586l19.882,-0c0.531,-0 1.039,-0.211 1.414,-0.586l14.059,-14.059c0.375,-0.375 0.586,-0.883 0.586,-1.414l-0,-19.882Zm-3,0.828c0,-0.265 -0.105,-0.519 -0.293,-0.707l-12.887,-12.887c-0.188,-0.188 -0.442,-0.293 -0.707,-0.293l-18.226,0c-0.265,0 -0.519,0.105 -0.707,0.293l-12.887,12.887c-0.188,0.188 -0.293,0.442 -0.293,0.707l0,18.226c0,0.265 0.105,0.519 0.293,0.707l12.887,12.887c0.188,0.188 0.442,0.293 0.707,0.293l18.226,-0c0.265,0 0.519,-0.105 0.707,-0.293l12.887,-12.887c0.188,-0.188 0.293,-0.442 0.293,-0.707l0,-18.226Z" style="fill:#fff;"/>
<circle cx="160" cy="44" r="3" style="fill:#fff;"/>
<path d="M160,18c1.656,0 3,1.344 3,3l-2,16l-2,0l-2,-16c0,-1.656 1.344,-3 3,-3Z" style="fill:#fff;"/>
</g>
<g id="INFO">
<path d="M224,6c14.35,-0 26,11.65 26,26c-0,14.35 -11.65,26 -26,26c-14.35,-0 -26,-11.65 -26,-26c-0,-14.35 11.65,-26 26,-26Zm-0,3c12.694,-0 23,10.306 23,23c-0,12.694 -10.306,23 -23,23c-12.694,-0 -23,-10.306 -23,-23c-0,-12.694 10.306,-23 23,-23Z" style="fill:#fff;"/>
<path d="M217.675,29.977l0.232,-1.395c0,0 2.519,-1.582 5.587,-1.582c3.067,-0 4.005,1.542 4.005,3.758c0,3.17 -2.242,7.836 -2.242,10.262c-0,1.379 0.725,1.645 1.861,1.645c0.945,-0 1.921,-0.136 2.367,-0.57l-0.492,1.602c-0,-0 -2.626,1.303 -5.207,1.303c-3.241,0 -4.297,-1.5 -4.28,-3.758c0.018,-2.4 2.249,-7.276 2.249,-10.099c0,-1.734 -1.269,-1.641 -1.917,-1.641c-1.32,-0 -2.163,0.475 -2.163,0.475Z" style="fill:#fff;"/>
<ellipse cx="226.5" cy="21" rx="3.5" ry="3" style="fill:#fff;"/>
</g>
<g id="BLENDER">
<path d="M310.66,22.503l-18.849,-14.481c-1.34,-1.042 -3.719,-0.803 -4.899,0.315c-1.14,1.078 -1.095,2.428 0.265,3.486l7.609,6.177l-23.895,0c-1.805,0 -3.795,1.138 -4.224,2.835c-0.482,1.91 1.059,3.165 3.103,3.165l11.938,0l-21.565,16.506c-2.094,1.619 -2.827,4.19 -1.508,5.787c1.289,1.559 3.983,1.635 6.073,0.122l11.865,-9.71c-0.193,1.075 -0.219,2.327 -0.065,3.264c1.52,9.103 10.046,16.034 20.637,16.034c11.525,0 20.855,-8.55 20.855,-18.96c0.007,-5.892 -2.877,-11.109 -7.34,-14.54Zm-13.534,24.534c-7.022,0 -12.714,-5.181 -12.714,-11.515c-0,-6.337 5.692,-11.577 12.714,-11.577c7.022,-0 12.714,5.131 12.714,11.577c0,6.295 -5.692,11.515 -12.714,11.515Z" style="fill:#fff;fill-rule:nonzero;"/>
<path d="M297.391,27.766c-4.479,-0 -8.113,3.342 -8.113,7.383c-0,4.04 3.634,7.343 8.113,7.343c4.48,0 8.114,-3.303 8.114,-7.343c0,-4.041 -3.634,-7.383 -8.114,-7.383Z" style="fill:#fff;fill-rule:nonzero;"/>
</g>
<g id="BLENDER-COLOR" style="display:none;">
<path d="M297,21.75c-8.282,0 -15,6.205 -15,13.75c0,7.545 6.718,13.75 15,13.75c8.282,0 15,-6.205 15,-13.75c0,-7.545 -6.718,-13.75 -15,-13.75Z" style="fill:#fff;fill-rule:nonzero;"/>
<path d="M310.66,22.503l-18.849,-14.481c-1.34,-1.042 -3.719,-0.803 -4.899,0.315c-1.14,1.078 -1.095,2.428 0.265,3.486l7.609,6.177l-23.895,0c-1.805,0 -3.795,1.138 -4.224,2.835c-0.482,1.91 1.059,3.165 3.103,3.165l11.938,0l-21.565,16.506c-2.094,1.619 -2.827,4.19 -1.508,5.787c1.289,1.559 3.983,1.635 6.073,0.122l11.865,-9.71c-0.193,1.075 -0.219,2.327 -0.065,3.264c1.52,9.103 10.046,16.034 20.637,16.034c11.525,0 20.855,-8.55 20.855,-18.96c0.007,-5.892 -2.877,-11.109 -7.34,-14.54Zm-13.534,24.534c-7.022,0 -12.714,-5.181 -12.714,-11.515c-0,-6.337 5.692,-11.577 12.714,-11.577c7.022,-0 12.714,5.131 12.714,11.577c0,6.295 -5.692,11.515 -12.714,11.515Z" style="fill:#e87d0d;fill-rule:nonzero;"/>
<path d="M297.391,27.766c-4.479,-0 -8.113,3.342 -8.113,7.383c-0,4.04 3.634,7.343 8.113,7.343c4.48,0 8.114,-3.303 8.114,-7.343c0,-4.041 -3.634,-7.383 -8.114,-7.383Z" style="fill:#265787;fill-rule:nonzero;"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -45,7 +45,7 @@ const bTheme U_theme_default = {
.outline = RGBA(0x373737ff),
.inner = RGBA(0x313131ff),
.inner_sel = RGBA(0x5680c2ff),
.item = RGBA(0xffffff8f),
.item = RGBA(0xe6e6e6cc),
.text = RGBA(0xe6e6e6ff),
.text_sel = RGBA(0xffffffff),
.roundness = 0.2f,
@@ -124,7 +124,7 @@ const bTheme U_theme_default = {
.outline = RGBA(0x444444ff),
.inner = RGBA(0x2c2c2cff),
.inner_sel = RGBA(0x696e76ff),
.item = RGBA(0xe6e6e6ff),
.item = RGBA(0xd9d9d9ff),
.text = RGBA(0xd9d9d9ff),
.text_sel = RGBA(0xffffffff),
.shadetop = 10,
@@ -234,7 +234,7 @@ const bTheme U_theme_default = {
.inner_changed_sel = RGBA(0xd26400ff),
.blend = 0.5f,
},
.widget_emboss = RGBA(0x00000005),
.widget_emboss = RGBA(0x00000026),
.menu_shadow_fac = 0.3f,
.menu_shadow_width = 4,
.editor_outline = RGBA(0x1f1f1fff),
@@ -262,7 +262,6 @@ const bTheme U_theme_default = {
.icon_folder = RGBA(0xe3c16eff),
},
.space_properties = {
.match = RGBA(0x5680c2ff),
.back = RGBA(0x42424200),
.title = RGBA(0xd4d4d4ff),
.text = RGBA(0xe6e6e6ff),
@@ -287,6 +286,7 @@ const bTheme U_theme_default = {
.vertex_size = 3,
.outline_width = 1,
.facedot_size = 4,
.match = RGBA(0x5680c2ff),
},
.space_view3d = {
.back = RGBA(0x393939ff),
@@ -685,6 +685,7 @@ const bTheme U_theme_default = {
.back = RGBA(0x333333b3),
.sub_back = RGBA(0x0000003e),
},
.grid = RGBA(0x505050ff),
.wire_edit = RGBA(0xc0c0c0ff),
.vertex_select = RGBA(0xff8500ff),
.edge_select = RGBA(0xff8500ff),
@@ -716,7 +717,6 @@ const bTheme U_theme_default = {
.paint_curve_pivot = RGBA(0xff7f7f7f),
.paint_curve_handle = RGBA(0x7fff7f7f),
.metadatatext = RGBA(0xffffffff),
.grid = RGBA(0x505050ff),
},
.space_text = {
.back = RGBA(0x30303000),

Some files were not shown because too many files have changed in this diff Show More