Compare commits

...

65 Commits

Author SHA1 Message Date
dff47e3b94 Merge branch 'master' into soc-2021-geometry-nodes-regression-test 2021-07-27 00:59:28 +05:30
cf74cd9367 Cycles: upgrade CUDA to 11.4
This fixes a performance regression on Ampere cards, on specific scenes like
classroom. For cycles-x there is little difference, but this is still helpful
for LTS releases, and we need to upgrade at some point anyway.
2021-07-26 19:46:51 +02:00
Nikhil Shringarpurey
6eb94d8df2 Cleanup: fix compiler warnings due to implicit cast
Differential Revision: https://developer.blender.org/D11950
2021-07-26 18:04:40 +02:00
22b03e1c68 Fix Python error in benchmark executable detection after recent changes 2021-07-26 18:04:40 +02:00
fd32fe6b02 Updating cmake error messsage 2021-07-26 21:30:59 +05:30
abf3ce811f LayerCollections: Add a way to prevent their resync with Collection hierarchy.
This is an easy & safe, yet not-so-nice way to address the
LayerCollections vs. Collections hierarchy resync problem.

Currently this resync is enforced everytime something changes in the
Collections hierarchy, which is extremely inneficient, and can even
produce 'loss' of LayerCollection data during complex Collection
processes.

Current example is during Library Overrides resync process. New code:
 * Makes resync significantly faster (between 10 and 15%).
 * Fixes 'disappearing' layer collections settings on sub-collections'
   layers.

NOTE: This is not a proper fix for the underlying issue. However,
implementing and testing the 'lazy update' solution as proposed by
{T73411} requires a significant amount of time (especially in testing
and tracking all places where code would need to ensure LayerCollections
are up-to-date), which is not possible currently.

Differential Revision: https://developer.blender.org/D11889
2021-07-26 17:36:46 +02:00
cee67f3be2 Cleanup: Fix compiler warning in previous commit 2021-07-26 17:25:56 +02:00
a14ee85ccd Fix T90127: Merge Down layer doesn't take the transform location into account
Now the layer transformation is applied before the merge.
2021-07-26 17:20:00 +02:00
231b313c55 Mantaflow: Remove Noise Type Option
Mantflow only supports wavelet noise, thus the parameter with only one option is no longer useful.

Differential Revision: https://developer.blender.org/D6770
2021-07-26 10:59:49 -04:00
Germano Cavalcante
3059853732 Cleanup: Rearrange mesh extraction files
In the draw module, it's not easy to identify what its header is, and
where the shared functions are.

So move `draw_cache_extract_mesh_extractors.c` and
`draw_cache_extract_mesh_private.h` to the same folder as the extractors
and rename these files to make them more identifiable.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11991
2021-07-26 10:25:39 -03:00
a9121640be macOS Cleanup: Remove old version specific code
Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D12021
2021-07-26 18:39:08 +05:30
14f94fd1ca VSE: Fix snapping bugs
Fix hold offset check causing missing snapping point when strip have
only still frames.

Fix effect strips of transformed strips causing snapping to prevoius
strip positions.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11948
2021-07-26 14:57:13 +02:00
0708e605d5 Merge branch 'master' into soc-2021-geometry-nodes-regression-test 2021-07-26 18:05:39 +05:30
1b53fde9fc Cleanup: missed comment in D12029
No functional change.
2021-07-26 13:25:57 +01:00
5fc1779b65 CMake: Add directory exists check 2021-07-26 17:45:52 +05:30
71d7505487 Geometry Nodes: Fix vector math project bug
Implementation is incorrect compared to Cycles/Eevee.

Reported by @DrDubosc in comments of T88922.

Differential Revision: https://developer.blender.org/D12029
2021-07-26 13:06:15 +01:00
a0cba9fb95 VSE: Fix truncated label
Label for snapping current frame to strips was cut off and not very readable.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D11951
2021-07-26 12:57:48 +02:00
faa65f151d Revert "cmake: enable Wayland by default"
This reverts commit a2ccd0e495.

This change was part of the still-under-review patch D11489, which
hasn't been accepted yet.
2021-07-26 12:18:53 +02:00
c17a266e29 Revert "GHOST/wayland: use Wayland only when 'BLENDER_WAYLAND' is set"
This reverts commit c971c851d3.

This change was part of the still-under-review patch D11489, which
hasn't been accepted yet.
2021-07-26 12:16:42 +02:00
Stefan Werner
1a3cb90e4e Cycles: Fixed memory leak in ColorSpaceManager
Cached OCIO processors were not freed, instead the color spaces were freed twice.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D12011
2021-07-26 11:45:29 +02:00
12afb19959 Cleanup: clang tidy 2021-07-26 11:43:51 +02:00
Himanshi Kalra
6abf63f463 Fix T85517: Cannot type Space while holding Shift key in text-field like spaces.
Fix for T85517
Bug: Couldn't type space while holding down the shift key in text spaces (e.g. when saving a file, changing the name of object).

Changes: Removing the key combination of Shift + space in `WM_event_is_ime_switch` method.

Reviewed By: harley, mont29

Maniphest Tasks: T85517

Differential Revision: https://developer.blender.org/D10452
2021-07-26 09:33:03 +02:00
501bca9f5b Cleanup: clang-format 2021-07-26 12:41:49 +10:00
828c66f393 Cleanup: spelling in comments 2021-07-26 12:32:42 +10:00
471d4b105a Cleanup: use doxy comments 2021-07-26 12:32:40 +10:00
a77d203932 UI: Line Art: Rename "Baking" panel to "Bake"
Avoid using verbs for panel names, and be consistent with the
"Bake" panel in Cycles, Ocean Modifier, etc.
2021-07-26 00:03:17 +02:00
0cb25a51de UI: Line Art: Always use Material icon on picker
The Material picker shouldn't change icon based on it's state,
it should always display the Material icon.
2021-07-25 23:59:53 +02:00
6a673b6000 UI: Fix button alignment on Grease Pencil modifiers 2021-07-25 23:57:32 +02:00
8fda1f363a UI: Line Art Modifier: Tweaks to labels and tooltips
- Clearer tooltips for Source Object/Collection.
- Remove redundant Source/Target on labels.
- Always write Grease Pencil with title case.
2021-07-25 23:55:23 +02:00
4886ed2863 Fix T86768, bevel doesn't loop slide sometimes.
Six years ago, Bug T44961 about unwanted spikes had me not do a loop
slide if the angle was too extreme, to avoid unwanted spikes.
The current bug showed that that angle was much too big, and limited
desired behavior in many cases. Changing the angle from 0.25 radians
to 0.0001 radians (about 0.006 degrees) still fixes the original bug
and seems very unlikely to be limiting desired behavior now.
2021-07-25 15:14:37 -04:00
0aad8100ae Fix T89391, etc. Boolean bugs when objects have negative scale.
The old modifier code, now just used for Fast, has code in it to
flip faces of arguments when their tranform's negativity differs
from the main object's transform's negativity.
I had neglected to put that logic in when I made the change that
skipped the round trip through BMesh.
Fixing this means that the results are more what the user expects
when some or all operands have negative scales.
2021-07-25 13:29:45 -04:00
b8f3df9817 Add curve tests 2021-07-21 21:35:59 +05:30
ad3afa02af Minor Fix: create_evaluated_object method changed return type fix 2021-07-21 20:48:00 +05:30
c54b53fa14 Merge branch 'master' into soc-2021-geometry-nodes-regression-test 2021-07-21 01:42:56 +05:30
8e41ce4959 Merge branch 'master' into soc-2021-geometry-nodes-regression-test 2021-07-20 15:28:50 +05:30
25e388c8b1 Addressed comments by Habib 2021-07-20 15:23:07 +05:30
5040638dbf Updated the path for geometry_nodes folder 2021-07-16 17:59:14 +05:30
53fc2ca51f Polishing script, checking for verbose use cases 2021-07-16 17:38:54 +05:30
af0743c47d Polishing script: WIP 2021-07-16 17:20:38 +05:30
d066f16a6c Updated based on review by Habib Gahbiche 2021-07-13 13:34:45 +05:30
3d18b2d9f7 Renaming: From MeshTest to SpecMeshTest curve_to_mesh tests 2021-07-09 18:15:54 +05:30
faae72e8ee Addressed comments by Jacques Lucke 2021-07-09 18:05:54 +05:30
09566e510a Merge branch 'master' into soc-2021-geometry-nodes-regression-test 2021-07-09 14:32:09 +05:30
a5baa450d1 Added test file for Geometry Nodes 2021-07-09 14:27:53 +05:30
82aa700fe6 Removing unwanted formatting changes 2021-07-09 14:19:16 +05:30
43fd05d8d8 Solved merge formatting conflicts 2021-07-09 02:14:11 +05:30
16f7672513 Removed extra files 2021-07-09 02:08:20 +05:30
984ad47d93 Added the remaining classes, updated the python test files.
Added the changes back to mesh test file.
2021-07-09 01:49:39 +05:30
c400f79582 Small test file 2021-07-07 19:09:50 +05:30
7e45a760b4 Added backward support for existing tests.
- Added create_expected_object if it doesn't exist.
- Added a counter condition for recusrion.
- Added optional test_name in basemesh test.
- Added code of previous MeshTest to SpecMeshTest.
- Changed default value of apply_modifier(s) flag and do_compare flag.
2021-07-07 18:46:09 +05:30
3c996fe7e2 Merge branch 'master' into soc-2021-geometry-nodes-regression-test 2021-07-05 01:21:06 +05:30
2edc2136a1 WIP: Saving work, Mesh Test Abstract class implementattion complete, updating to Win 11 2021-07-03 14:17:38 +05:30
fec564b321 Refactoring of mesh test in a new file: WIP 2021-07-01 11:00:29 +05:30
70e8acf0ba Merge branch 'master' into soc-2021-geometry-nodes-regression-test 2021-06-28 12:00:15 +05:30
2778211cea Merge branch 'master' into soc-2021-geometry-nodes-regression-test 2021-06-18 16:56:27 +05:30
24a401c36d Changes based on review by Habib Gahbiche
Removed global variable FILE UPDATE COUNT, introduced a function
run_test().
2021-06-17 11:12:27 +05:30
959fe77e9c Removing unused functions for remove modifiers 2021-06-17 11:06:44 +05:30
6f699690ee Removed unwanted return statements 2021-06-16 16:15:54 +05:30
f52c674991 Alerted ctest with failed or pass
Added a global file count base condition, in case of failure
recursion. Added exit condition for errors.
2021-06-16 13:51:05 +05:30
5dc85773eb Merge branch 'master' into soc-2021-geometry-nodes-regression-test 2021-06-15 23:30:14 +05:30
825081a2d0 Changes based on review by Jacques Lucke 2021-06-15 23:28:02 +05:30
10ace20bcf Created a script for running blend file with pre-loaded modifier
Added a loop to add each category geo_node tests

Each geometry node test is an individual test. It can be run
separately by ctest command. For example ctest -R geo_node_mesh
This will run all mesh tests.

The extra overhead is each test adds to the total tests.

Updated the script, adding support for cmd arguments

Added exception errors for try except, formatting, adding comments
Improved the workflow, updated error messages. Re-running of the
test after BLENDER_TEST_UPDATE.

Merge branch 'geo-node-testing' into soc-2021-geometry-nodes-regression-test

Differential Revision: https://developer.blender.org/D11611
2021-06-15 16:56:46 +05:30
8b151c5cdb Updated the script, adding support for cmd arguments
Added exception errors for try except, formatting, adding comments
Improved the workflow, updated error messages. Re-running of the
test after BLENDER_TEST_UPDATE.
2021-06-15 13:18:29 +05:30
fd25c2c59a Added a loop to add each category geo_node tests
Each geometry node test is an individual test. It can be run
separately by ctest command. For example ctest -R geo_node_mesh
This will run all mesh tests.

The extra overhead is each test adds to the total tests.
2021-06-11 16:22:19 +05:30
225f638afd Created a script for running blend file with pre-loaded modifier 2021-06-10 16:29:13 +05:30
122 changed files with 1099 additions and 788 deletions

View File

@@ -217,7 +217,7 @@ if(UNIX AND NOT (APPLE OR HAIKU))
option(WITH_GHOST_X11 "Enable building Blender against X11 for windowing" ON)
mark_as_advanced(WITH_GHOST_X11)
option(WITH_GHOST_WAYLAND "Enable building Blender against Wayland for windowing" ON)
option(WITH_GHOST_WAYLAND "Enable building Blender against Wayland for windowing (under development)" OFF)
mark_as_advanced(WITH_GHOST_WAYLAND)
endif()

View File

@@ -404,7 +404,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 "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
# Use OpenMP from our precompiled libraries.
message(STATUS "Using ${LIBDIR}/openmp for OpenMP")
set(OPENMP_CUSTOM ON)
@@ -480,10 +480,8 @@ else()
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic")
endif()
if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
# Xcode 5 is always using CLANG, which has too low template depth of 128 for libmv
# Clang has too low template depth of 128 for libmv.
string(APPEND CMAKE_CXX_FLAGS " -ftemplate-depth=1024")
endif()
# Avoid conflicts with Luxrender, and other plug-ins that may use the same
# libraries as Blender with a different version or build options.

View File

@@ -41,7 +41,7 @@
},
"cuda11":
{
"version": "11.3"
"version": "11.4"
}
},
"cmake":

View File

@@ -461,18 +461,19 @@ string CUDADevice::compile_kernel(const DeviceRequestedFeatures &requested_featu
const int nvcc_cuda_version = cuewCompilerVersion();
VLOG(1) << "Found nvcc " << nvcc << ", CUDA version " << nvcc_cuda_version << ".";
if (nvcc_cuda_version < 80) {
if (nvcc_cuda_version < 101) {
printf(
"Unsupported CUDA version %d.%d detected, "
"you need CUDA 8.0 or newer.\n",
"you need CUDA 10.1 or newer.\n",
nvcc_cuda_version / 10,
nvcc_cuda_version % 10);
return string();
}
else if (!(nvcc_cuda_version == 101 || nvcc_cuda_version == 102)) {
else if (!(nvcc_cuda_version == 101 || nvcc_cuda_version == 102 || nvcc_cuda_version == 111 ||
nvcc_cuda_version == 112 || nvcc_cuda_version == 113 || nvcc_cuda_version == 114)) {
printf(
"CUDA version %d.%d detected, build may succeed but only "
"CUDA 10.1 and 10.2 are officially supported.\n",
"CUDA 10.1 to 11.4 are officially supported.\n",
nvcc_cuda_version / 10,
nvcc_cuda_version % 10);
}

View File

@@ -380,11 +380,16 @@ 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") OR (CUDA_VERSION MATCHES "111"))
if((CUDA_VERSION MATCHES "101") OR
(CUDA_VERSION MATCHES "102") OR
(CUDA_VERSION MATCHES "111") OR
(CUDA_VERSION MATCHES "112") OR
(CUDA_VERSION MATCHES "113") OR
(CUDA_VERSION MATCHES "114"))
else()
message(WARNING
"CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, "
"build may succeed but only CUDA 10.1, 10.2 and 11.1 are officially supported")
"build may succeed but only CUDA 10.1 to 11.4 are officially supported")
endif()
# build for each arch

View File

@@ -385,7 +385,7 @@ void ColorSpaceManager::free_memory()
{
#ifdef WITH_OCIO
map_free_memory(cached_colorspaces);
map_free_memory(cached_colorspaces);
map_free_memory(cached_processors);
#endif
}

View File

@@ -103,7 +103,7 @@ ccl_device float fast_sinf(float x)
* 1.19209e-07 max error
*/
int q = fast_rint(x * M_1_PI_F);
float qf = q;
float qf = (float)q;
x = madd(qf, -0.78515625f * 4, x);
x = madd(qf, -0.00024187564849853515625f * 4, x);
x = madd(qf, -3.7747668102383613586e-08f * 4, x);
@@ -132,7 +132,7 @@ ccl_device float fast_cosf(float x)
{
/* Same argument reduction as fast_sinf(). */
int q = fast_rint(x * M_1_PI_F);
float qf = q;
float qf = (float)q;
x = madd(qf, -0.78515625f * 4, x);
x = madd(qf, -0.00024187564849853515625f * 4, x);
x = madd(qf, -3.7747668102383613586e-08f * 4, x);
@@ -160,7 +160,7 @@ ccl_device void fast_sincosf(float x, float *sine, float *cosine)
{
/* Same argument reduction as fast_sin. */
int q = fast_rint(x * M_1_PI_F);
float qf = q;
float qf = (float)q;
x = madd(qf, -0.78515625f * 4, x);
x = madd(qf, -0.00024187564849853515625f * 4, x);
x = madd(qf, -3.7747668102383613586e-08f * 4, x);
@@ -207,7 +207,7 @@ ccl_device float fast_tanf(float x)
* we sometimes need to take the reciprocal of the polynomial
*/
int q = fast_rint(x * 2.0f * M_1_PI_F);
float qf = q;
float qf = (float)q;
x = madd(qf, -0.78515625f * 2, x);
x = madd(qf, -0.00024187564849853515625f * 2, x);
x = madd(qf, -3.7747668102383613586e-08f * 2, x);
@@ -407,7 +407,7 @@ ccl_device float fast_logb(float x)
x = fabsf(x);
x = clamp(x, FLT_MIN, FLT_MAX);
unsigned bits = __float_as_uint(x);
return (int)(bits >> 23) - 127;
return (float)((int)(bits >> 23) - 127);
}
ccl_device float fast_exp2f(float x)

View File

@@ -188,8 +188,8 @@ extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
GHOST_GLSettings glSettings);
/**
* Create a new offscreen context.
* Never explicitly delete the context, use disposeContext() instead.
* Create a new off-screen context.
* Never explicitly delete the context, use #disposeContext() instead.
* \param systemhandle: The handle to the system.
* \param platform_support_callback: An optional callback to check platform support.
* \return A handle to the new context ( == NULL if creation failed).

View File

@@ -29,8 +29,8 @@
/**
* Interface for GHOST context.
*
* You can create a offscreen context (windowless) with the system's
* GHOST_ISystem::createOffscreenContext method.
* You can create a off-screen context (windowless) with the system's
* #GHOST_ISystem::createOffscreenContext method.
* \see GHOST_ISystem#createOffscreenContext
*/
class GHOST_IContext {

View File

@@ -261,8 +261,8 @@ class GHOST_ISystem {
virtual GHOST_TSuccess disposeWindow(GHOST_IWindow *window) = 0;
/**
* Create a new offscreen context.
* Never explicitly delete the context, use disposeContext() instead.
* Create a new off-screen context.
* Never explicitly delete the context, use #disposeContext() instead.
* \return The new context (or 0 if creation failed).
*/
virtual GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings) = 0;

View File

@@ -611,9 +611,9 @@ typedef void (*GHOST_TimerProcPtr)(struct GHOST_TimerTaskHandle__ *task, uint64_
struct GHOST_XrDrawViewInfo;
struct GHOST_XrError;
/**
* The XR view (i.e. the OpenXR runtime) may require a different graphics library than OpenGL. An
* offscreen texture of the viewport will then be drawn into using OpenGL, but the final texture
* draw call will happen through another lib (say DirectX).
* The XR view (i.e. the OpenXR runtime) may require a different graphics library than OpenGL.
* An off-screen texture of the viewport will then be drawn into using OpenGL,
* but the final texture draw call will happen through another library (say DirectX).
*
* This enum defines the possible graphics bindings to attempt to enable.
*/

View File

@@ -239,7 +239,7 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
}
attribs[i++] = 0;
/* Some drivers don't like having a true offscreen context.
/* Some drivers don't like having a true off-screen context.
* Create a pixel buffer instead of a window to render to.
* even if it will never be used for drawing. */
int pbuffer_attribs[] = {GLX_PBUFFER_WIDTH, 1, GLX_PBUFFER_HEIGHT, 1, None};

View File

@@ -57,12 +57,6 @@ GHOST_TSuccess GHOST_ISystem::createSystem()
/* Special case, try Wayland, fall back to X11. */
try {
m_system = new GHOST_SystemWayland();
if (!std::getenv("BLENDER_WAYLAND")) {
printf("Connected to a Wayland compositor but Wayland is disabled at "\
"runtime.\nSet environment variable 'BLENDER_WAYLAND' (e.g. "\
"BLENDER_WAYLAND= blender) to use Wayland.\n");
throw std::runtime_error(std::string());
}
}
catch (const std::runtime_error &) {
/* fallback to X11. */

View File

@@ -113,8 +113,8 @@ class GHOST_System : public GHOST_ISystem {
GHOST_TSuccess disposeWindow(GHOST_IWindow *window);
/**
* Create a new offscreen context.
* Never explicitly delete the context, use disposeContext() instead.
* Create a new off-screen context.
* Never explicitly delete the context, use #disposeContext() instead.
* \return The new context (or 0 if creation failed).
*/
virtual GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings) = 0;

View File

@@ -112,8 +112,8 @@ class GHOST_SystemCocoa : public GHOST_System {
const GHOST_IWindow *parentWindow = NULL);
/**
* Create a new offscreen context.
* Never explicitly delete the context, use disposeContext() instead.
* Create a new off-screen context.
* Never explicitly delete the context, use #disposeContext() instead.
* \return The new context (or 0 if creation failed).
*/
GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings);

View File

@@ -761,7 +761,7 @@ GHOST_IWindow *GHOST_SystemCocoa::createWindow(const char *title,
}
/**
* Create a new offscreen context.
* Create a new off-screen context.
* Never explicitly delete the context, use #disposeContext() instead.
* \return The new context (or 0 if creation failed).
*/

View File

@@ -259,7 +259,7 @@ GHOST_IWindow *GHOST_SystemWin32::createWindow(const char *title,
}
/**
* Create a new offscreen context.
* Create a new off-screen context.
* Never explicitly delete the window, use #disposeContext() instead.
* \return The new context (or 0 if creation failed).
*/
@@ -363,7 +363,7 @@ GHOST_TSuccess GHOST_SystemWin32::disposeContext(GHOST_IContext *context)
}
/**
* Create a new offscreen DirectX 11 context.
* Create a new off-screen DirectX 11 context.
* Never explicitly delete the window, use #disposeContext() instead.
* \return The new context (or 0 if creation failed).
*/

View File

@@ -138,8 +138,8 @@ class GHOST_SystemWin32 : public GHOST_System {
const GHOST_IWindow *parentWindow = 0);
/**
* Create a new offscreen context.
* Never explicitly delete the window, use disposeContext() instead.
* Create a new off-screen context.
* Never explicitly delete the window, use #disposeContext() instead.
* \return The new context (or 0 if creation failed).
*/
GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings);
@@ -152,8 +152,8 @@ class GHOST_SystemWin32 : public GHOST_System {
GHOST_TSuccess disposeContext(GHOST_IContext *context);
/**
* Create a new offscreen DirectX context.
* Never explicitly delete the context, use disposeContext() instead.
* Create a new off-screen DirectX context.
* Never explicitly delete the context, use #disposeContext() instead.
* This is for GHOST internal, Win32 specific use, so it can be called statically.
*
* \return The new context (or 0 if creation failed).

View File

@@ -390,8 +390,8 @@ GHOST_IWindow *GHOST_SystemX11::createWindow(const char *title,
}
/**
* Create a new offscreen context.
* Never explicitly delete the context, use disposeContext() instead.
* Create a new off-screen context.
* Never explicitly delete the context, use #disposeContext() instead.
* \return The new context (or 0 if creation failed).
*/
GHOST_IContext *GHOST_SystemX11::createOffscreenContext(GHOST_GLSettings glSettings)

View File

@@ -148,8 +148,8 @@ class GHOST_SystemX11 : public GHOST_System {
const GHOST_IWindow *parentWindow = 0);
/**
* Create a new offscreen context.
* Never explicitly delete the context, use disposeContext() instead.
* Create a new off-screen context.
* Never explicitly delete the context, use #disposeContext() instead.
* \return The new context (or 0 if creation failed).
*/
GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings);

View File

@@ -148,7 +148,7 @@ static void create_reference_spaces(OpenXRSessionData &oxr, const GHOST_XrPose &
if (XR_FAILED(result)) {
/* One of the rare cases where we don't want to immediately throw an exception on failure,
* since runtimes are not required to support the stage reference space. Although we need the
* since run-times are not required to support the stage reference space. Although we need the
* stage reference space for absolute tracking, if the runtime doesn't support it then just
* fallback to the local space. */
if (result == XR_ERROR_REFERENCE_SPACE_UNSUPPORTED) {

View File

@@ -67,7 +67,7 @@ const char *(*MEM_name_ptr)(void *vmemh) = MEM_lockfree_name_ptr;
void *aligned_malloc(size_t size, size_t alignment)
{
/* posix_memalign requires alignment to be a multiple of sizeof(void *). */
/* #posix_memalign requires alignment to be a multiple of `sizeof(void *)`. */
assert(alignment >= ALIGNED_MALLOC_MINIMUM_ALIGNMENT);
#ifdef _WIN32

View File

@@ -734,11 +734,9 @@ class PHYSICS_PT_noise(PhysicButtonsPanel, Panel):
col = flow.column()
col.prop(domain, "noise_scale", text="Upres Factor")
# TODO (sebbas): Mantaflow only supports wavelet noise. Maybe get rid of noise type field.
col.prop(domain, "noise_type", text="Noise Method")
col.prop(domain, "noise_strength", text="Strength")
col = flow.column()
col.prop(domain, "noise_strength", text="Strength")
col.prop(domain, "noise_pos_scale", text="Scale")
col.prop(domain, "noise_time_anim", text="Time")

View File

@@ -2294,8 +2294,8 @@ class SEQUENCER_PT_snapping(Panel):
col.prop(sequencer_tool_settings, "snap_ignore_muted", text="Muted Strips")
col.prop(sequencer_tool_settings, "snap_ignore_sound", text="Sound Strips")
col = layout.column()
col.prop(sequencer_tool_settings, "use_snap_current_frame_to_strips")
col = layout.column(heading="Current Frame", align=True)
col.prop(sequencer_tool_settings, "use_snap_current_frame_to_strips", text="Snap to Strips")
classes = (

View File

@@ -98,6 +98,9 @@ struct LayerCollection *BKE_layer_collection_from_index(struct ViewLayer *view_l
const int index);
int BKE_layer_collection_findindex(struct ViewLayer *view_layer, const struct LayerCollection *lc);
void BKE_layer_collection_resync_forbid(void);
void BKE_layer_collection_resync_allow(void);
void BKE_main_collection_sync(const struct Main *bmain);
void BKE_scene_collection_sync(const struct Scene *scene);
void BKE_layer_collection_sync(const struct Scene *scene, struct ViewLayer *view_layer);

View File

@@ -5005,7 +5005,6 @@ void BKE_fluid_modifier_copy(const struct FluidModifierData *fmd,
tfds->noise_pos_scale = fds->noise_pos_scale;
tfds->noise_time_anim = fds->noise_time_anim;
tfds->noise_scale = fds->noise_scale;
tfds->noise_type = fds->noise_type;
/* liquid domain options */
tfds->flip_ratio = fds->flip_ratio;

View File

@@ -737,6 +737,35 @@ int BKE_layer_collection_findindex(ViewLayer *view_layer, const LayerCollection
* in at least one layer collection. That list is also synchronized here, and
* stores state like selection. */
/* This API allows to temporarily forbid resync of LayerCollections.
*
* This can greatly improve performances in cases where those functions get
* called a lot (e.g. during massive remappings of IDs).
*
* Usage of these should be done very carefully though. In particular, calling
* code must ensures it resync LayerCollections before any UI/Eevnt loop
* handling can happen.
*
* WARNING: This is not threadsafe at all, only use from main thread.
*
* NOTE: This is a quick and safe band-aid around the long-known issue
* regarding this resync process.
* Proper fix would be to make resync itself lazy, i.e. only happen
* when actually needed.
* See also T73411.
*/
static bool no_resync = false;
void BKE_layer_collection_resync_forbid(void)
{
no_resync = true;
}
void BKE_layer_collection_resync_allow(void)
{
no_resync = false;
}
static void layer_collection_objects_sync(ViewLayer *view_layer,
LayerCollection *layer,
ListBase *r_lb_new_object_bases,
@@ -933,6 +962,10 @@ static void layer_collection_sync(ViewLayer *view_layer,
*/
void BKE_layer_collection_sync(const Scene *scene, ViewLayer *view_layer)
{
if (no_resync) {
return;
}
if (!scene->master_collection) {
/* Happens for old files that don't have versioning applied yet. */
return;
@@ -997,6 +1030,10 @@ void BKE_layer_collection_sync(const Scene *scene, ViewLayer *view_layer)
void BKE_scene_collection_sync(const Scene *scene)
{
if (no_resync) {
return;
}
LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
BKE_layer_collection_sync(scene, view_layer);
}
@@ -1004,6 +1041,10 @@ void BKE_scene_collection_sync(const Scene *scene)
void BKE_main_collection_sync(const Main *bmain)
{
if (no_resync) {
return;
}
/* TODO: if a single collection changed, figure out which
* scenes it belongs to and only update those. */
@@ -1018,6 +1059,10 @@ void BKE_main_collection_sync(const Main *bmain)
void BKE_main_collection_sync_remap(const Main *bmain)
{
if (no_resync) {
return;
}
/* On remapping of object or collection pointers free caches. */
/* TODO: try to make this faster */
@@ -1320,6 +1365,10 @@ static void layer_collection_local_sync(ViewLayer *view_layer,
void BKE_layer_collection_local_sync(ViewLayer *view_layer, const View3D *v3d)
{
if (no_resync) {
return;
}
const unsigned short local_collections_uuid = v3d->local_collections_uuid;
/* Reset flags and set the bases visible by default. */
@@ -1337,6 +1386,10 @@ void BKE_layer_collection_local_sync(ViewLayer *view_layer, const View3D *v3d)
*/
void BKE_layer_collection_local_sync_all(const Main *bmain)
{
if (no_resync) {
return;
}
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {

View File

@@ -1722,6 +1722,11 @@ void BKE_lib_override_library_main_resync(Main *bmain,
COLLECTION_RESTRICT_RENDER;
}
/* Necessary to improve performances, and prevent layers matching override sub-collections to be
* lost when re-syncing the parent override collection.
* Ref. T73411. */
BKE_layer_collection_resync_forbid();
int library_indirect_level = lib_override_libraries_index_define(bmain);
while (library_indirect_level >= 0) {
/* Update overrides from each indirect level separately. */
@@ -1734,6 +1739,8 @@ void BKE_lib_override_library_main_resync(Main *bmain,
library_indirect_level--;
}
BKE_layer_collection_resync_allow();
/* Essentially ensures that potentially new overrides of new objects will be instantiated. */
lib_override_library_create_post_process(
bmain, scene, view_layer, NULL, NULL, override_resync_residual_storage, true);

View File

@@ -97,6 +97,8 @@ class MeshesToIMeshInfo {
/* Transformation matrix to transform a coordinate in the corresponding
* Mesh to the local space of the first Mesh. */
Array<float4x4> to_target_transform;
/* For each input mesh, whether or not their transform is negative. */
Array<bool> has_negative_transform;
/* For each input mesh, how to remap the material slot numbers to
* the material slots in the first mesh. */
Span<Array<short>> material_remaps;
@@ -277,6 +279,7 @@ static IMesh meshes_to_imesh(Span<const Mesh *> meshes,
r_info->mesh_edge_offset = Array<int>(nmeshes);
r_info->mesh_poly_offset = Array<int>(nmeshes);
r_info->to_target_transform = Array<float4x4>(nmeshes);
r_info->has_negative_transform = Array<bool>(nmeshes);
r_info->material_remaps = material_remaps;
int v = 0;
int e = 0;
@@ -309,6 +312,12 @@ static IMesh meshes_to_imesh(Span<const Mesh *> meshes,
const float4x4 objn_mat = (obmats[mi] == nullptr) ? float4x4::identity() :
clean_obmat(*obmats[mi]);
r_info->to_target_transform[mi] = inv_target_mat * objn_mat;
r_info->has_negative_transform[mi] = objn_mat.is_negative();
/* All meshes 1 and up will be transformed into the local space of operand 0.
* Historical behavior of the modifier has been to flip the faces of any meshes
* that would have a negative transform if you do that. */
bool need_face_flip = r_info->has_negative_transform[mi] != r_info->has_negative_transform[0];
Vector<Vert *> verts(me->totvert);
Span<MVert> mverts = Span(me->mvert, me->totvert);
@@ -346,14 +355,21 @@ static IMesh meshes_to_imesh(Span<const Mesh *> meshes,
for (const MPoly &poly : Span(me->mpoly, me->totpoly)) {
int flen = poly.totloop;
face_vert.clear();
face_edge_orig.clear();
face_vert.resize(flen);
face_edge_orig.resize(flen);
const MLoop *l = &me->mloop[poly.loopstart];
for (int i = 0; i < flen; ++i) {
int mverti = r_info->mesh_vert_offset[mi] + l->v;
const Vert *fv = r_info->mesh_to_imesh_vert[mverti];
face_vert.append(fv);
face_edge_orig.append(e + l->e);
if (need_face_flip) {
face_vert[flen - i - 1] = fv;
int iedge = i < flen - 1 ? flen - i - 2 : flen - 1;
face_edge_orig[iedge] = e + l->e;
}
else {
face_vert[i] = fv;
face_edge_orig[i] = e + l->e;
}
++l;
}
r_info->mesh_to_imesh_face[f] = arena.add_face(face_vert, f, face_edge_orig);

View File

@@ -218,6 +218,11 @@ struct float4x4 {
return result;
}
bool is_negative() const
{
return is_negative_m4(ptr());
}
uint64_t hash() const
{
uint64_t h = 435109;

View File

@@ -384,7 +384,7 @@ typedef struct BevelParams {
// #pragma GCC diagnostic ignored "-Wpadded"
/* Only for debugging, this file shouldn't be in blender repo. */
/* Only for debugging, this file shouldn't be in blender repository. */
// #include "bevdebug.c"
/* Use the unused _BM_ELEM_TAG_ALT flag to flag the 'long' loops (parallel to beveled edge)
@@ -1495,8 +1495,9 @@ static void offset_meet(BevelParams *bp,
}
}
/* Chosen so 1/sin(BEVEL_GOOD_ANGLE) is about 4, giving that expansion factor to bevel width. */
#define BEVEL_GOOD_ANGLE 0.25f
/* This was changed from 0.25f to fix bug T86768.
* Original bug T44961 remains fixed with this value. */
#define BEVEL_GOOD_ANGLE 0.0001f
/**
* Calculate the meeting point between e1 and e2 (one of which should have zero offsets),

View File

@@ -52,8 +52,8 @@ set(INC
set(SRC
intern/draw_cache.c
intern/draw_cache_extract_mesh.cc
intern/draw_cache_extract_mesh_extractors.c
intern/draw_cache_extract_mesh_render_data.c
intern/mesh_extractors/extract_mesh.c
intern/mesh_extractors/extract_mesh_ibo_edituv.cc
intern/mesh_extractors/extract_mesh_ibo_fdots.cc
intern/mesh_extractors/extract_mesh_ibo_lines.cc
@@ -193,7 +193,6 @@ set(SRC
intern/DRW_render.h
intern/draw_cache.h
intern/draw_cache_extract.h
intern/draw_cache_extract_mesh_private.h
intern/draw_cache_impl.h
intern/draw_cache_inline.h
intern/draw_color_management.h
@@ -207,6 +206,7 @@ set(SRC
intern/draw_manager_text.h
intern/draw_shader.h
intern/draw_view.h
intern/mesh_extractors/extract_mesh.h
intern/smaa_textures.h
engines/basic/basic_engine.h
engines/eevee/eevee_engine.h

View File

@@ -178,19 +178,19 @@ static void eevee_cache_finish(void *vedata)
}
EEVEE_renderpasses_output_init(sldata, vedata, tot_samples);
/* Restart taa if a shader has finish compiling. */
/* HACK We should use notification of some sort from the compilation job instead. */
/* Restart TAA if a shader has finish compiling. */
/* HACK: We should use notification of some sort from the compilation job instead. */
if (g_data->queued_shaders_count != g_data->queued_shaders_count_prev) {
g_data->queued_shaders_count_prev = g_data->queued_shaders_count;
EEVEE_temporal_sampling_reset(vedata);
}
}
/* As renders in an HDR offscreen buffer, we need draw everything once
/* As renders in an HDR off-screen buffer, we need draw everything once
* during the background pass. This way the other drawing callback between
* the background and the scene pass are visible.
* NOTE: we could break it up in two passes using some depth test
* to reduce the fillrate */
* to reduce the fill-rate. */
static void eevee_draw_scene(void *vedata)
{
EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl;

View File

@@ -287,7 +287,7 @@ GPENCIL_tLayer *gpencil_layer_cache_add(GPENCIL_PrivateData *pd,
pd->is_render ? gpl->vertex_paint_opacity :
pd->vertex_paint_opacity;
/* Negate thickness sign to tag that strokes are in screen space.
* Convert to world units (by default, 1 meter = 2000 px). */
* Convert to world units (by default, 1 meter = 2000 pixels). */
float thickness_scale = (is_screenspace) ? -1.0f : (gpd->pixfactor / GPENCIL_PIXEL_FACTOR);
float layer_opacity = gpencil_layer_final_opacity_get(pd, ob, gpl);
float layer_tint[4];

View File

@@ -196,7 +196,7 @@ static void gpencil_layer_cache_populate(bGPDlayer *gpl,
float object_scale = mat4_to_scale(iter->ob->obmat);
/* Negate thickness sign to tag that strokes are in screen space.
* Convert to world units (by default, 1 meter = 2000 px). */
* Convert to world units (by default, 1 meter = 2000 pixels). */
float thickness_scale = (is_screenspace) ? -1.0f : (gpd->pixfactor / 2000.0f);
DRWShadingGroup *grp = iter->stroke_grp = DRW_shgroup_create_sub(iter->stroke_grp);

View File

@@ -41,9 +41,10 @@
#include "GPU_capabilities.h"
#include "draw_cache_extract.h"
#include "draw_cache_extract_mesh_private.h"
#include "draw_cache_inline.h"
#include "mesh_extractors/extract_mesh.h"
// #define DEBUG_TIME
#ifdef DEBUG_TIME

View File

@@ -38,7 +38,7 @@
#include "ED_mesh.h"
#include "draw_cache_extract_mesh_private.h"
#include "mesh_extractors/extract_mesh.h"
/* ---------------------------------------------------------------------- */
/** \name Update Loose Geometry
@@ -340,11 +340,9 @@ static int *mesh_render_data_mat_tri_len_build(MeshRenderData *mr)
return mesh_render_data_mat_tri_len_build_threaded(
mr, bm->totface, mesh_render_data_mat_tri_len_bm_range_fn);
}
else {
return mesh_render_data_mat_tri_len_build_threaded(
mr, mr->poly_len, mesh_render_data_mat_tri_len_mesh_range_fn);
}
}
/** \} */

View File

@@ -67,11 +67,12 @@
#include "ED_uvedit.h"
#include "draw_cache_extract.h"
#include "draw_cache_extract_mesh_private.h"
#include "draw_cache_inline.h"
#include "draw_cache_impl.h" /* own include */
#include "mesh_extractors/extract_mesh.h"
/* ---------------------------------------------------------------------- */
/** \name Dependencies between buffer and batch
* \{ */

View File

@@ -304,7 +304,7 @@ static DRWVolumeGrid *volume_grid_cache_get(const Volume *volume,
BLI_addtail(&cache->grids, cache_grid);
/* TODO: can we load this earlier, avoid accessing the global and take
* advantage of dependency graph multithreading? */
* advantage of dependency graph multi-threading? */
BKE_volume_load(volume, G.main);
/* Test if we support textures with the number of channels. */

View File

@@ -74,8 +74,8 @@ BLI_INLINE void DRW_ibo_request(GPUBatch *batch, GPUIndexBuf **ibo)
BLI_INLINE bool DRW_ibo_requested(GPUIndexBuf *ibo)
{
/* TODO: do not rely on data uploaded. This prevents multithreading.
* (need access to a gl context) */
/* TODO: do not rely on data uploaded. This prevents multi-threading.
* (need access to a OpenGL context). */
return (ibo != NULL && !GPU_indexbuf_is_init(ibo));
}
@@ -85,7 +85,7 @@ BLI_INLINE void DRW_vbo_request(GPUBatch *batch, GPUVertBuf **vbo)
*vbo = GPU_vertbuf_calloc();
}
if (batch != NULL) {
/* HACK we set vbos that may not yet be valid. */
/* HACK we set VBO's that may not yet be valid. */
GPU_batch_vertbuf_add(batch, *vbo);
}
}

View File

@@ -110,8 +110,8 @@ typedef struct DRWCullingState {
/* Minimum max UBO size is 64KiB. We take the largest
* UBO struct and alloc the max number.
* ((1 << 16) / sizeof(DRWObjectMatrix)) = 512
* Keep in sync with common_view_lib.glsl */
* `((1 << 16) / sizeof(DRWObjectMatrix)) = 512`
* Keep in sync with `common_view_lib.glsl`. */
#define DRW_RESOURCE_CHUNK_LEN 512
/**

View File

@@ -29,7 +29,8 @@
#include "ED_uvedit.h"
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
#include "draw_cache_impl.h"
void *mesh_extract_buffer_get(const MeshExtract *extractor, MeshBufferCache *mbc)

View File

@@ -21,12 +21,12 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "BLI_vector.hh"
#include "MEM_guardedalloc.h"
#include "extract_mesh.h"
namespace blender::draw {
/* ---------------------------------------------------------------------- */
/** \name Extract Edit UV Triangles Indices

View File

@@ -21,12 +21,12 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "BLI_vector.hh"
#include "MEM_guardedalloc.h"
#include "extract_mesh.h"
namespace blender::draw {
/* ---------------------------------------------------------------------- */
/** \name Extract Face-dots Indices

View File

@@ -21,10 +21,10 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "MEM_guardedalloc.h"
#include "extract_mesh.h"
namespace blender::draw {
/* ---------------------------------------------------------------------- */

View File

@@ -21,13 +21,13 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "BLI_edgehash.h"
#include "BLI_vector.hh"
#include "MEM_guardedalloc.h"
#include "extract_mesh.h"
namespace blender::draw {
/* ---------------------------------------------------------------------- */

View File

@@ -21,14 +21,14 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "BLI_bitmap.h"
#include "BLI_vector.hh"
#include "atomic_ops.h"
#include "MEM_guardedalloc.h"
#include "extract_mesh.h"
namespace blender::draw {
/* ---------------------------------------------------------------------- */
/** \name Extract Paint Mask Line Indices

View File

@@ -21,12 +21,12 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "BLI_vector.hh"
#include "MEM_guardedalloc.h"
#include "extract_mesh.h"
namespace blender::draw {
/* ---------------------------------------------------------------------- */

View File

@@ -21,10 +21,10 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "MEM_guardedalloc.h"
#include "extract_mesh.h"
namespace blender::draw {
static void extract_tris_mat_task_reduce(void *_userdata_to, void *_userdata_from)

View File

@@ -25,7 +25,7 @@
#include "GPU_capabilities.h"
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -21,7 +21,8 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
#include "draw_cache_impl.h"
namespace blender::draw {

View File

@@ -21,7 +21,8 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
#include "draw_cache_impl.h"
namespace blender::draw {

View File

@@ -25,7 +25,7 @@
#include "BKE_mesh.h"
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -25,7 +25,7 @@
#include "BKE_mesh.h"
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -21,7 +21,8 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
#include "draw_cache_impl.h"
namespace blender::draw {

View File

@@ -21,7 +21,7 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -21,7 +21,7 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -21,7 +21,7 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -21,7 +21,7 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -30,7 +30,7 @@
#include "BKE_editmesh_bvh.h"
#include "BKE_editmesh_cache.h"
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -21,7 +21,7 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -23,7 +23,7 @@
#include "MEM_guardedalloc.h"
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -27,7 +27,7 @@
#include "BKE_paint.h"
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -21,7 +21,7 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -21,7 +21,7 @@
* \ingroup draw
*/
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -30,7 +30,7 @@
#include "BKE_mesh.h"
#include "BKE_mesh_tangent.h"
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -23,7 +23,7 @@
#include "BLI_string.h"
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -25,7 +25,7 @@
#include "BLI_string.h"
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -25,7 +25,7 @@
#include "BKE_deform.h"
#include "draw_cache_extract_mesh_private.h"
#include "extract_mesh.h"
namespace blender::draw {

View File

@@ -38,14 +38,14 @@
using namespace blender::bke;
/* simple struct for storing backup info for one pose channel */
typedef struct PoseChannelBackup {
struct PoseChannelBackup {
struct PoseChannelBackup *next, *prev;
struct bPoseChannel *pchan; /* Pose channel this backup is for. */
struct bPoseChannel olddata; /* Backup of pose channel. */
struct IDProperty *oldprops; /* Backup copy (needs freeing) of pose channel's ID properties. */
} PoseChannelBackup;
};
struct PoseBackup {
bool is_bone_selection_relevant;
@@ -61,7 +61,7 @@ static PoseBackup *pose_backup_create(const Object *ob,
BoneNameSet backed_up_bone_names;
/* Make a backup of the given pose channel. */
auto store_animated_pchans = [&](FCurve *, const char *bone_name) {
auto store_animated_pchans = [&](FCurve * /* unused */, const char *bone_name) {
if (backed_up_bone_names.contains(bone_name)) {
/* Only backup each bone once. */
return;

View File

@@ -36,7 +36,8 @@ struct ReportList;
AssetTempIDConsumer *ED_asset_temp_id_consumer_create(const struct AssetHandle *handle);
void ED_asset_temp_id_consumer_free(AssetTempIDConsumer **consumer);
struct ID *ED_asset_temp_id_consumer_ensure_local_id(AssetTempIDConsumer *consumer,
struct ID *ED_asset_temp_id_consumer_ensure_local_id(
AssetTempIDConsumer *consumer,
const struct bContext *C,
const struct AssetLibraryReference *asset_library,
ID_Type id_type,

View File

@@ -109,15 +109,15 @@ const EnumPropertyItem *ED_asset_library_reference_to_rna_enum_itemf()
ICON_BLENDER,
"Current File",
"Show the assets currently available in this Blender session"},
{0, NULL, 0, NULL, NULL},
{0, nullptr, 0, nullptr, nullptr},
};
EnumPropertyItem *item = NULL;
EnumPropertyItem *item = nullptr;
int totitem = 0;
/* Add separator if needed. */
if (!BLI_listbase_is_empty(&U.asset_libraries)) {
const EnumPropertyItem sepr = {0, "", 0, "Custom", NULL};
const EnumPropertyItem sepr = {0, "", 0, "Custom", nullptr};
RNA_enum_item_add(&item, &totitem, &sepr);
}
@@ -144,7 +144,7 @@ const EnumPropertyItem *ED_asset_library_reference_to_rna_enum_itemf()
}
if (totitem) {
const EnumPropertyItem sepr = {0, "", 0, "Built-in", NULL};
const EnumPropertyItem sepr = {0, "", 0, "Built-in", nullptr};
RNA_enum_item_add(&item, &totitem, &sepr);
}

View File

@@ -918,7 +918,7 @@ void ED_annotation_draw_view3d(
return;
}
/* when rendering to the offscreen buffer we don't want to
/* When rendering to the off-screen buffer we don't want to
* deal with the camera border, otherwise map the coords to the camera border. */
if ((rv3d->persp == RV3D_CAMOB) && !(G.f & G_FLAG_RENDER_VIEWPORT)) {
rctf rectf;

View File

@@ -1355,6 +1355,14 @@ static int gpencil_merge_layer_exec(bContext *C, wmOperator *op)
LISTBASE_FOREACH (bGPDframe *, gpf_src, &gpl_src->frames) {
/* Try to find frame in destination layer hash table. */
bGPDframe *gpf_dst = BLI_ghash_lookup(gh_frames_dst, POINTER_FROM_INT(gpf_src->framenum));
/* Apply layer transformation. */
LISTBASE_FOREACH (bGPDstroke *, gps_src, &gpf_src->strokes) {
for (int p = 0; p < gps_src->totpoints; p++) {
bGPDspoint *pt = &gps_src->points[p];
mul_v3_m4v3(&pt->x, gpl_src->layer_mat, &pt->x);
}
}
/* Add to tail all strokes. */
if (gpf_dst) {
BLI_movelisttolist(&gpf_dst->strokes, &gpf_src->strokes);

View File

@@ -49,17 +49,17 @@ typedef struct IMMDrawPixelsTexState {
IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin);
/**
* immDrawPixelsTex - Functions like a limited glDrawPixels, but actually draws the
* #immDrawPixelsTex - Functions like a limited #glDrawPixels, but actually draws the
* image using textures, which can be tremendously faster on low-end
* cards, and also avoids problems with the raster position being
* clipped when offscreen. Pixel unpacking parameters and
* the glPixelZoom values are _not_ respected.
* clipped when off-screen. Pixel unpacking parameters and
* the #glPixelZoom values are _not_ respected.
*
* \attention Use immDrawPixelsTexSetup before calling this function.
* \attention Use #immDrawPixelsTexSetup before calling this function.
*
* \attention This routine makes many assumptions: the rect data
* \attention This routine makes many assumptions: the `rect` data
* is expected to be in RGBA byte or float format, and the
* modelview and projection matrices are assumed to define a
* model-view and projection matrices are assumed to define a
* 1-to-1 mapping to screen space.
*/
void immDrawPixelsTex(IMMDrawPixelsTexState *state,

View File

@@ -286,18 +286,15 @@ static void vicon_small_tri_right_draw(int x, int y, int w, int UNUSED(h), float
static void vicon_keytype_draw_wrapper(
int x, int y, int w, int h, float alpha, short key_type, short handle_type)
{
/* init dummy theme state for Action Editor - where these colors are defined
* (since we're doing this offscreen, free from any particular space_id)
*/
/* Initialize dummy theme state for Action Editor - where these colors are defined
* (since we're doing this off-screen, free from any particular space_id). */
struct bThemeState theme_state;
UI_Theme_Store(&theme_state);
UI_SetTheme(SPACE_ACTION, RGN_TYPE_WINDOW);
/* the "x" and "y" given are the bottom-left coordinates of the icon,
* while the draw_keyframe_shape() function needs the midpoint for
* the keyframe
*/
/* The "x" and "y" given are the bottom-left coordinates of the icon,
* while the #draw_keyframe_shape() function needs the midpoint for the keyframe. */
const float xco = x + w / 2 + 0.5f;
const float yco = y + h / 2 + 0.5f;
@@ -1347,8 +1344,8 @@ void ui_icon_ensure_deferred(const bContext *C, const int icon_id, const bool bi
case ICON_TYPE_PREVIEW: {
ID *id = (icon->id_type != 0) ? icon->obj : NULL;
PreviewImage *prv = id ? BKE_previewimg_id_ensure(id) : icon->obj;
/* Using jobs for screen previews crashes due to offscreen rendering.
* XXX would be nicer if PreviewImage could store if it supports jobs */
/* Using jobs for screen previews crashes due to off-screen rendering.
* XXX: would be nicer if #PreviewImage could store if it supports jobs. */
const bool use_jobs = !id || (GS(id->name) != ID_SCR);
if (prv) {
@@ -2144,7 +2141,7 @@ static int ui_id_brush_get_icon(const bContext *C, ID *id)
static int ui_id_screen_get_icon(const bContext *C, ID *id)
{
BKE_icon_id_ensure(id);
/* Don't use jobs here, offscreen rendering doesn't like this and crashes. */
/* Don't use jobs here, off-screen rendering doesn't like this and crashes. */
ui_id_icon_render(C, id, false);
return id->icon_id;

View File

@@ -188,7 +188,7 @@ static uiBlock *ui_block_func_POPOVER(bContext *C, uiPopupBlockHandle *handle, v
}
}
/* Estimated a maximum size so we don't go offscreen for low height
/* Estimated a maximum size so we don't go off-screen for low height
* areas near the bottom of the window on refreshes. */
handle->max_size_y = UI_UNIT_Y * 16.0f;
}

View File

@@ -59,9 +59,10 @@ static void asset_view_item_but_drag_set(uiBut *but,
}
char blend_path[FILE_MAX_LIBEXTRA];
/* Context can be NULL here, it's only needed for a File Browser specific hack that should go
/* Context can be null here, it's only needed for a File Browser specific hack that should go
* away before too long. */
ED_asset_handle_get_full_library_path(NULL, &list_data->asset_library, asset_handle, blend_path);
ED_asset_handle_get_full_library_path(
nullptr, &list_data->asset_library, asset_handle, blend_path);
if (blend_path[0]) {
ImBuf *imbuf = ED_assetlist_asset_image_get(asset_handle);

View File

@@ -1089,7 +1089,7 @@ bTheme *UI_GetTheme(void)
}
/**
* for the rare case we need to temp swap in a different theme (offscreen render)
* For the rare case we need to temp swap in a different theme (off-screen render).
*/
void UI_Theme_Store(struct bThemeState *theme_state)
{

View File

@@ -767,7 +767,7 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op)
sizey = (scene->r.size * scene->r.ysch) / 100;
/* corrects render size with actual size, not every card supports non-power-of-two dimensions */
DRW_opengl_context_enable(); /* Offscreen creation needs to be done in DRW context. */
DRW_opengl_context_enable(); /* Off-screen creation needs to be done in DRW context. */
ofs = GPU_offscreen_create(sizex, sizey, true, true, err_out);
DRW_opengl_context_disable();

View File

@@ -270,7 +270,7 @@ typedef struct ProjPaintState {
float stencil_value;
/* projection painting only */
/** for multithreading, the first item is sometimes used for non threaded cases too. */
/** For multi-threading, the first item is sometimes used for non threaded cases too. */
MemArena *arena_mt[BLENDER_MAX_THREADS];
/** screen sized 2D array, each pixel has a linked list of ProjPixel's */
LinkNode **bucketRect;
@@ -4449,7 +4449,7 @@ static void project_paint_begin(const bContext *C,
ProjPaintFaceLookup face_lookup;
const MLoopUV *mloopuv_base = NULL;
/* at the moment this is just ps->arena_mt[0], but use this to show were not multithreading */
/* At the moment this is just ps->arena_mt[0], but use this to show were not multi-threading. */
MemArena *arena;
const int diameter = 2 * BKE_brush_size_get(ps->scene, ps->brush);

View File

@@ -2125,7 +2125,7 @@ void node_draw_space(const bContext *C, ARegion *region)
SpaceNode *snode = CTX_wm_space_node(C);
View2D *v2d = &region->v2d;
/* Setup offscreen buffers. */
/* Setup off-screen buffers. */
GPUViewport *viewport = WM_draw_region_get_viewport(region);
GPUFrameBuffer *framebuffer_overlay = GPU_viewport_framebuffer_overlay_get(viewport);

View File

@@ -1602,7 +1602,7 @@ void view3d_main_region_draw(const bContext *C, ARegion *region)
/** \} */
/* -------------------------------------------------------------------- */
/** \name Offscreen Drawing
/** \name Off-screen Drawing
* \{ */
static void view3d_stereo3d_setup_offscreen(Depsgraph *depsgraph,

View File

@@ -34,6 +34,7 @@
#include "UI_view2d.h"
#include "SEQ_effects.h"
#include "SEQ_iterator.h"
#include "SEQ_sequencer.h"
@@ -104,11 +105,41 @@ static void seq_snap_source_points_build(const TransInfo *UNUSED(t),
/** \name Snap targets
* \{ */
static SeqCollection *query_snap_targets(const TransInfo *t)
/* Add effect strips directly or indirectly connected to `seq_reference` to `collection`. */
static void query_strip_effects_fn(Sequence *seq_reference,
ListBase *seqbase,
SeqCollection *collection)
{
const ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(t->scene, false));
if (!SEQ_collection_append_strip(seq_reference, collection)) {
return; /* Strip is already in set, so all effects connected to it are as well. */
}
/* Find all strips connected to `seq_reference`. */
LISTBASE_FOREACH (Sequence *, seq_test, seqbase) {
if (seq_test->seq1 == seq_reference || seq_test->seq2 == seq_reference ||
seq_test->seq3 == seq_reference) {
query_strip_effects_fn(seq_test, seqbase, collection);
}
}
}
static SeqCollection *seq_collection_extract_effects(SeqCollection *collection)
{
SeqCollection *effects = SEQ_collection_create(__func__);
Sequence *seq;
SEQ_ITERATOR_FOREACH (seq, collection) {
if (SEQ_effect_get_num_inputs(seq->type) > 0) {
SEQ_collection_append_strip(seq, effects);
}
}
return effects;
}
static SeqCollection *query_snap_targets(const TransInfo *t, SeqCollection *snap_sources)
{
ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(t->scene, false));
const short snap_flag = SEQ_tool_settings_snap_flag_get(t->scene);
SeqCollection *collection = SEQ_collection_create(__func__);
SeqCollection *snap_targets = SEQ_collection_create(__func__);
LISTBASE_FOREACH (Sequence *, seq, seqbase) {
if ((seq->flag & SELECT)) {
continue; /* Selected are being transformed. */
@@ -119,9 +150,18 @@ static SeqCollection *query_snap_targets(const TransInfo *t)
if (seq->type == SEQ_TYPE_SOUND_RAM && (snap_flag & SEQ_SNAP_IGNORE_SOUND)) {
continue;
}
SEQ_collection_append_strip(seq, collection);
SEQ_collection_append_strip(seq, snap_targets);
}
return collection;
/* Effects will always change position with strip to which they are connected and they don't have
* to be selected. Remove such strips from `snap_targets` collection. */
SeqCollection *snap_sources_temp = SEQ_collection_duplicate(snap_sources);
SEQ_collection_expand(seqbase, snap_sources_temp, query_strip_effects_fn);
SeqCollection *snap_sources_effects = seq_collection_extract_effects(snap_sources_temp);
SEQ_collection_exclude(snap_targets, snap_sources_effects);
SEQ_collection_free(snap_sources_temp);
return snap_targets;
}
static int seq_get_snap_target_points_count(const TransInfo *t,
@@ -178,12 +218,15 @@ static void seq_snap_target_points_build(const TransInfo *t,
if (snap_mode & SEQ_SNAP_TO_STRIP_HOLD) {
int content_start = min_ii(seq->enddisp, seq->start);
int content_end = max_ii(seq->startdisp, seq->start + seq->len);
if (seq->anim_startofs == 0) {
/* Effects and single image strips produce incorrect content length. Skip these strips. */
if ((seq->type & SEQ_TYPE_EFFECT) != 0 || seq->len == 1) {
if (seq->anim_startofs == 0 && seq->startstill == 0) {
content_start = seq->startdisp;
}
if (seq->anim_endofs == 0) {
if (seq->anim_endofs == 0 && seq->endstill == 0) {
content_end = seq->enddisp;
}
}
snap_data->target_snap_points[i] = content_start;
snap_data->target_snap_points[i + 1] = content_end;
i += 2;
@@ -214,16 +257,25 @@ TransSeqSnapData *transform_snap_sequencer_data_alloc(const TransInfo *t)
TransSeqSnapData *snap_data = MEM_callocN(sizeof(TransSeqSnapData), __func__);
ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(t->scene, false));
/* Build arrays of snap points. */
SeqCollection *snap_sources = SEQ_query_selected_strips(seqbase);
SeqCollection *snap_targets = query_snap_targets(t, snap_sources);
if (SEQ_collection_len(snap_sources) == 0 || SEQ_collection_len(snap_targets) == 0) {
SEQ_collection_free(snap_targets);
SEQ_collection_free(snap_sources);
MEM_freeN(snap_data);
return NULL;
}
/* Build arrays of snap points. */
seq_snap_source_points_alloc(snap_data, snap_sources);
seq_snap_source_points_build(t, snap_data, snap_sources);
SEQ_collection_free(snap_sources);
SeqCollection *snap_targets = query_snap_targets(t);
seq_snap_target_points_alloc(t, snap_data, snap_targets);
seq_snap_target_points_build(t, snap_data, snap_targets);
SEQ_collection_free(snap_targets);
return snap_data;
}
@@ -236,12 +288,16 @@ void transform_snap_sequencer_data_free(TransSeqSnapData *data)
bool transform_snap_sequencer_calc(TransInfo *t)
{
const TransSeqSnapData *snap_data = t->tsnap.seq_context;
if (snap_data == NULL) {
return false;
}
/* Prevent snapping when constrained to Y axis. */
if (t->con.mode & CON_APPLY && t->con.mode & CON_AXIS1) {
return false;
}
const TransSeqSnapData *snap_data = t->tsnap.seq_context;
int best_dist = MAXFRAME, best_target_frame = 0, best_source_frame = 0;
for (int i = 0; i < snap_data->source_snap_point_count; i++) {

View File

@@ -63,10 +63,10 @@
*
* The generic slider is supposed to be called during modal operations. It calculates a factor
* value based on mouse position and draws a visual representation. In order to use it, you need to
* store a reference to a tSlider in your operator which you get by calling "ED_slider_create".
* Then you need to update it during modal operations by calling "ED_slider_modal", which will
* update tSlider->factor for you to use. To remove drawing and free the memory, call
* "ED_slider_destroy".
* store a reference to a #tSlider in your operator which you get by calling #ED_slider_create.
* Then you need to update it during modal operations by calling #ED_slider_modal", which will
* update #tSlider.factor for you to use. To remove drawing and free the memory, call
* #ED_slider_destroy.
* \{ */
#define SLIDE_PIXEL_DISTANCE (300.0f * U.dpi_fac)
@@ -75,31 +75,32 @@
typedef struct tSlider {
struct Scene *scene;
struct ScrArea *area;
/* Header of the region used for drawing the slider. */
/** Header of the region used for drawing the slider. */
struct ARegion *region_header;
/* Draw callback handler. */
/** Draw callback handler. */
void *draw_handle;
/* Accumulative, unclamped and unrounded factor. */
/** Accumulative factor (not clamped or rounded). */
float raw_factor;
/** 0-1 value for determining the influence of whatever is relevant. */
float factor;
/* Last mouse cursor position used for mouse movement delta calculation. */
/** Last mouse cursor position used for mouse movement delta calculation. */
float last_cursor[2];
/* Enable range beyond 0-100%. */
/** Enable range beyond 0-100%. */
bool allow_overshoot;
/* Allow overshoot or clamp between 0% and 100%. */
/** Allow overshoot or clamp between 0% and 100%. */
bool overshoot;
/* Move factor in 10% steps. */
/** Move factor in 10% steps. */
bool increments;
/* Reduces factor delta from mouse movement. */
/** Reduces factor delta from mouse movement. */
bool precision;
} tSlider;
@@ -243,7 +244,9 @@ static void draw_backdrop(const int fontid,
UI_draw_roundbox_aa(&backdrop_rect, true, 4.0f, color_bg);
}
/* Draw an on screen Slider for a Pose Slide Operator. */
/**
* Draw an on screen Slider for a Pose Slide Operator.
*/
static void slider_draw(const struct bContext *UNUSED(C), ARegion *region, void *arg)
{
tSlider *slider = arg;
@@ -395,14 +398,18 @@ tSlider *ED_slider_create(struct bContext *C)
return slider;
}
/* For modal operations so the percentage doesn't pop on the first mouse movement. */
/**
* For modal operations so the percentage doesn't pop on the first mouse movement.
*/
void ED_slider_init(struct tSlider *slider, const wmEvent *event)
{
slider->last_cursor[0] = event->x;
slider->last_cursor[1] = event->y;
}
/* Calculate slider factor based on mouse position. */
/**
* Calculate slider factor based on mouse position.
*/
bool ED_slider_modal(tSlider *slider, const wmEvent *event)
{
bool event_handled = true;
@@ -436,7 +443,9 @@ bool ED_slider_modal(tSlider *slider, const wmEvent *event)
return event_handled;
}
/* Return string based on the current state of the slider. */
/**
* Return string based on the current state of the slider.
*/
void ED_slider_status_string_get(const struct tSlider *slider,
char *status_string,
const size_t size_of_status_string)
@@ -769,7 +778,9 @@ static float metadata_box_height_get(ImBuf *ibuf, int fontid, const bool is_top)
return 0;
}
/* Should be kept in sync with BKE_image_stamp_buf */
/**
* \note Keep in sync with #BKE_image_stamp_buf.
*/
void ED_region_image_metadata_draw(
int x, int y, ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy)
{

View File

@@ -163,7 +163,7 @@ class CPPType : NonCopyable, NonMovable {
* Required memory in bytes for an instance of this type.
*
* C++ equivalent:
* sizeof(T);
* `sizeof(T);`
*/
int64_t size() const
{

View File

@@ -346,7 +346,7 @@ static void gpencil_modifier_panel_header(const bContext *UNUSED(C), Panel *pane
uiItemMenuF(row, "", ICON_DOWNARROW_HLT, gpencil_modifier_ops_extra_draw, md);
/* Remove button. */
sub = uiLayoutRow(row, true);
sub = uiLayoutRow(row, false);
uiLayoutSetEmboss(sub, UI_EMBOSS_NONE);
uiItemO(sub, "", ICON_X, "OBJECT_OT_gpencil_modifier_remove");

View File

@@ -320,13 +320,8 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
}
uiLayout *row = uiLayoutRow(layout, true);
uiLayoutSetRedAlert(row, !material_valid);
uiItemPointerR(row,
ptr,
"target_material",
&obj_data_ptr,
"materials",
NULL,
material_valid ? ICON_SHADING_TEXTURE : ICON_ERROR);
uiItemPointerR(
row, ptr, "target_material", &obj_data_ptr, "materials", NULL, ICON_SHADING_TEXTURE);
gpencil_modifier_panel_end(layout, ptr);
}
@@ -440,10 +435,8 @@ static bool anything_showing_through(PointerRNA *ptr)
if (use_multiple_levels) {
return (MAX2(level_start, level_end) > 0);
}
else {
return (level_start > 0);
}
}
static void material_mask_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
{
@@ -626,7 +619,7 @@ static void vgroup_panel_draw(const bContext *UNUSED(C), Panel *panel)
}
}
static void baking_panel_draw(const bContext *UNUSED(C), Panel *panel)
static void bake_panel_draw(const bContext *UNUSED(C), Panel *panel)
{
uiLayout *layout = panel->layout;
PointerRNA ob_ptr;
@@ -682,7 +675,7 @@ static void panelRegister(ARegionType *region_type)
gpencil_modifier_subpanel_register(
region_type, "vgroup", "Vertex Weight Transfer", NULL, vgroup_panel_draw, panel_type);
gpencil_modifier_subpanel_register(
region_type, "baking", "Baking", NULL, baking_panel_draw, panel_type);
region_type, "bake", "Bake", NULL, bake_panel_draw, panel_type);
}
GpencilModifierTypeInfo modifierType_Gpencil_Lineart = {

View File

@@ -268,7 +268,7 @@ void GPU_batch_draw_advanced(
}
if (i_count == 0) {
i_count = (batch->inst[0]) ? batch->inst_(0)->vertex_len : 1;
/* Meh. This is to be able to use different numbers of verts in instance vbos. */
/* Meh. This is to be able to use different numbers of verts in instance VBO's. */
if (batch->inst[1] != nullptr) {
i_count = min_ii(i_count, batch->inst_(1)->vertex_len);
}

View File

@@ -56,7 +56,7 @@ struct GPUSelectQueryState {
Vector<uint> *ids;
/* Cache on initialization. */
uint (*buffer)[4];
/* Buffer size (stores number of integers, for actual size multiply by sizeof integer). */
/* Buffer size (stores number of integers, for actual size multiply by `sizeof(int)`). */
uint bufsize;
/* Mode of operation. */
char mode;

View File

@@ -93,7 +93,7 @@ GLContext::GLContext(void *ghost_window, GLSharedOrphanLists &shared_orphan_list
}
}
else {
/* For offscreen contexts. Default framebuffer is NULL. */
/* For off-screen contexts. Default frame-buffer is NULL. */
back_left = new GLFrameBuffer("back_left", this, GL_NONE, 0, 0, 0);
}

View File

@@ -101,7 +101,6 @@
.noise_time_anim = 0.1f, \
.res_noise = {0, 0, 0}, \
.noise_scale = 2, \
.noise_type = FLUID_NOISE_TYPE_WAVELET, \
.particle_randomness = 0.1f, \
.particle_number = 2, \
.particle_minimum = 8, \

View File

@@ -198,11 +198,6 @@ enum {
FLUID_DOMAIN_TYPE_LIQUID = 1,
};
/* Smoke noise types. */
enum {
FLUID_NOISE_TYPE_WAVELET = (1 << 0),
};
/* Mesh levelset generator types. */
enum {
FLUID_DOMAIN_MESH_IMPROVED = 0,
@@ -580,8 +575,7 @@ typedef struct FluidDomainSettings {
float noise_time_anim;
int res_noise[3];
int noise_scale;
short noise_type; /* Noise type: wave, curl, anisotropic. */
char _pad3[2]; /* Unused. */
char _pad3[4]; /* Unused. */
/* Liquid domain options. */
float particle_randomness;

View File

@@ -24,7 +24,7 @@
extern "C" {
#endif
/** Settings for offscreen rendering */
/** Settings for off-screen rendering. */
typedef enum eV3DOffscreenDrawFlag {
V3D_OFSDRAW_NONE = (0),
V3D_OFSDRAW_SHOW_ANNOTATION = (1 << 0),

View File

@@ -1268,11 +1268,6 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
{FLUID_DOMAIN_TYPE_LIQUID, "LIQUID", 0, "Liquid", "Create domain for liquids"},
{0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem prop_noise_type_items[] = {
{FLUID_NOISE_TYPE_WAVELET, "NOISEWAVE", 0, "Wavelet", ""},
{0, NULL, 0, NULL, NULL},
};
static const EnumPropertyItem prop_compression_items[] = {
{VDB_COMPRESSION_ZIP, "ZIP", 0, "Zip", "Effective but slow compression"},
# ifdef WITH_OPENVDB_BLOSC
@@ -1813,14 +1808,6 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_noise_reset");
prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noise_type");
RNA_def_property_enum_items(prop, prop_noise_type_items);
RNA_def_property_ui_text(
prop, "Noise Method", "Noise method which is used during the high-res simulation");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_noise_reset");
prop = RNA_def_property(srna, "use_noise", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", FLUID_DOMAIN_USE_NOISE);
RNA_def_property_ui_text(prop, "Use Noise", "Enable fluid noise (using amplification)");

View File

@@ -3033,15 +3033,14 @@ static void rna_def_modifier_gpencillineart(BlenderRNA *brna)
prop = RNA_def_property(srna, "source_object", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(
prop, "Source Object", "Source object that this modifier uses data from");
RNA_def_property_ui_text(prop, "Object", "Generate strokes from this object");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update");
prop = RNA_def_property(srna, "source_collection", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
RNA_def_property_struct_type(prop, "Collection");
RNA_def_property_ui_text(
prop, "Source Collection", "Source collection that this modifier uses data from");
prop, "Collection", "Generate strokes from the objects in this collection");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update");
/* types */
@@ -3105,12 +3104,11 @@ static void rna_def_modifier_gpencillineart(BlenderRNA *brna)
NULL,
"rna_GpencilModifier_material_poll");
RNA_def_property_ui_text(
prop, "Target Material", "Grease Pencil material assigned to the generated strokes");
prop, "Material", "Grease Pencil material assigned to the generated strokes");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "target_layer", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(
prop, "Target Layer", "Grease Pencil layer assigned to the generated strokes");
RNA_def_property_ui_text(prop, "Layer", "Grease Pencil layer assigned to the generated strokes");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "source_vertex_group", PROP_STRING, PROP_NONE);
@@ -3275,7 +3273,7 @@ void RNA_def_greasepencil_modifier(BlenderRNA *brna)
/* data */
srna = RNA_def_struct(brna, "GpencilModifier", NULL);
RNA_def_struct_ui_text(srna, "GpencilModifier", "Modifier affecting the grease pencil object");
RNA_def_struct_ui_text(srna, "GpencilModifier", "Modifier affecting the Grease Pencil object");
RNA_def_struct_refine_func(srna, "rna_GpencilModifier_refine");
RNA_def_struct_path_func(srna, "rna_GpencilModifier_path");
RNA_def_struct_sdna(srna, "GpencilModifierData");

View File

@@ -266,7 +266,7 @@ inline bool try_dispatch_float_math_fl3_fl3_to_fl3(const NodeVectorMathOperation
return dispatch([](float3 a, float3 b) { return float3::cross_high_precision(a, b); });
case NODE_VECTOR_MATH_PROJECT:
return dispatch([](float3 a, float3 b) {
float length_squared = float3::dot(a, b);
float length_squared = b.length_squared();
return (length_squared != 0.0) ? (float3::dot(a, b) / length_squared) * b : float3(0.0f);
});
case NODE_VECTOR_MATH_REFLECT:

View File

@@ -71,11 +71,13 @@ bool SEQ_iterator_ensure(SeqCollection *collection,
struct Sequence *SEQ_iterator_yield(SeqIterator *iterator);
SeqCollection *SEQ_collection_create(const char *name);
SeqCollection *SEQ_collection_duplicate(SeqCollection *collection);
uint SEQ_collection_len(const SeqCollection *collection);
bool SEQ_collection_append_strip(struct Sequence *seq, SeqCollection *data);
bool SEQ_collection_remove_strip(struct Sequence *seq, SeqCollection *data);
void SEQ_collection_free(SeqCollection *collection);
void SEQ_collection_merge(SeqCollection *collection_dst, SeqCollection *collection_src);
void SEQ_collection_exclude(SeqCollection *collection, SeqCollection *exclude_elements);
void SEQ_collection_expand(struct ListBase *seqbase,
SeqCollection *collection,
void query_func(struct Sequence *seq_reference,

View File

@@ -183,6 +183,22 @@ void SEQ_collection_merge(SeqCollection *collection_dst, SeqCollection *collecti
SEQ_collection_free(collection_src);
}
/**
* Remove strips from collection that are also in `exclude_elements`. Source collection will be
* freed.
*
* \param collection: collection from which strips are removed
* \param exclude_elements: collection of strips to be removed
*/
void SEQ_collection_exclude(SeqCollection *collection, SeqCollection *exclude_elements)
{
Sequence *seq;
SEQ_ITERATOR_FOREACH (seq, exclude_elements) {
SEQ_collection_remove_strip(seq, collection);
}
SEQ_collection_free(exclude_elements);
}
/**
* Expand collection by running SEQ_query() for each strip, which will be used as reference.
* Results of these queries will be merged into provided collection.
@@ -213,6 +229,22 @@ void SEQ_collection_expand(ListBase *seqbase,
}
}
/**
* Duplicate collection
*
* \param collection: collection to be duplicated
* \return duplicate of collection
*/
SeqCollection *SEQ_collection_duplicate(SeqCollection *collection)
{
SeqCollection *duplicate = SEQ_collection_create(__func__);
Sequence *seq;
SEQ_ITERATOR_FOREACH (seq, collection) {
SEQ_collection_append_strip(seq, duplicate);
}
return duplicate;
}
/** \} */
/**

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