Compare commits
65 Commits
node-group
...
soc-2021-g
Author | SHA1 | Date | |
---|---|---|---|
dff47e3b94 | |||
cf74cd9367 | |||
![]() |
6eb94d8df2 | ||
22b03e1c68 | |||
fd32fe6b02 | |||
abf3ce811f | |||
cee67f3be2 | |||
a14ee85ccd | |||
231b313c55 | |||
![]() |
3059853732 | ||
a9121640be | |||
14f94fd1ca | |||
0708e605d5 | |||
1b53fde9fc | |||
5fc1779b65 | |||
71d7505487 | |||
a0cba9fb95 | |||
faa65f151d | |||
c17a266e29 | |||
![]() |
1a3cb90e4e | ||
12afb19959 | |||
![]() |
6abf63f463 | ||
501bca9f5b | |||
828c66f393 | |||
471d4b105a | |||
a77d203932 | |||
0cb25a51de | |||
6a673b6000 | |||
8fda1f363a | |||
4886ed2863 | |||
0aad8100ae | |||
b8f3df9817 | |||
ad3afa02af | |||
c54b53fa14 | |||
8e41ce4959 | |||
25e388c8b1 | |||
5040638dbf | |||
53fc2ca51f | |||
af0743c47d | |||
d066f16a6c | |||
3d18b2d9f7 | |||
faae72e8ee | |||
09566e510a | |||
a5baa450d1 | |||
82aa700fe6 | |||
43fd05d8d8 | |||
16f7672513 | |||
984ad47d93 | |||
c400f79582 | |||
7e45a760b4 | |||
3c996fe7e2 | |||
2edc2136a1 | |||
fec564b321 | |||
70e8acf0ba | |||
2778211cea | |||
24a401c36d | |||
959fe77e9c | |||
6f699690ee | |||
f52c674991 | |||
5dc85773eb | |||
825081a2d0 | |||
10ace20bcf | |||
8b151c5cdb | |||
fd25c2c59a | |||
225f638afd |
@@ -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()
|
||||
|
||||
|
@@ -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
|
||||
string(APPEND CMAKE_CXX_FLAGS " -ftemplate-depth=1024")
|
||||
endif()
|
||||
# Clang has too low template depth of 128 for libmv.
|
||||
string(APPEND CMAKE_CXX_FLAGS " -ftemplate-depth=1024")
|
||||
|
||||
# Avoid conflicts with Luxrender, and other plug-ins that may use the same
|
||||
# libraries as Blender with a different version or build options.
|
||||
|
@@ -41,7 +41,7 @@
|
||||
},
|
||||
"cuda11":
|
||||
{
|
||||
"version": "11.3"
|
||||
"version": "11.4"
|
||||
}
|
||||
},
|
||||
"cmake":
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
|
@@ -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).
|
||||
|
@@ -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 {
|
||||
|
@@ -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;
|
||||
|
@@ -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.
|
||||
*/
|
||||
|
@@ -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};
|
||||
|
@@ -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. */
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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).
|
||||
*/
|
||||
|
@@ -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).
|
||||
*/
|
||||
|
@@ -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).
|
||||
|
@@ -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)
|
||||
|
@@ -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);
|
||||
|
@@ -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) {
|
||||
|
@@ -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
|
||||
|
@@ -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")
|
||||
|
||||
|
@@ -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 = (
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
|
@@ -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) {
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
|
@@ -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),
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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];
|
||||
|
@@ -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);
|
||||
|
@@ -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
|
||||
|
@@ -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,10 +340,8 @@ 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);
|
||||
}
|
||||
return mesh_render_data_mat_tri_len_build_threaded(
|
||||
mr, mr->poly_len, mesh_render_data_mat_tri_len_mesh_range_fn);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
@@ -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
|
||||
* \{ */
|
||||
|
@@ -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. */
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
|
||||
/**
|
||||
|
@@ -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)
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -21,10 +21,10 @@
|
||||
* \ingroup draw
|
||||
*/
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
@@ -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 {
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
@@ -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
|
||||
|
@@ -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 {
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
@@ -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)
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "GPU_capabilities.h"
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -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 {
|
||||
|
@@ -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 {
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "BKE_mesh.h"
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "BKE_mesh.h"
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -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 {
|
||||
|
@@ -21,7 +21,7 @@
|
||||
* \ingroup draw
|
||||
*/
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
* \ingroup draw
|
||||
*/
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
* \ingroup draw
|
||||
*/
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
* \ingroup draw
|
||||
*/
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -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 {
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
* \ingroup draw
|
||||
*/
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "BKE_paint.h"
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
* \ingroup draw
|
||||
*/
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
* \ingroup draw
|
||||
*/
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -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 {
|
||||
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "BLI_string.h"
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "BLI_string.h"
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "BKE_deform.h"
|
||||
|
||||
#include "draw_cache_extract_mesh_private.h"
|
||||
#include "extract_mesh.h"
|
||||
|
||||
namespace blender::draw {
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -36,12 +36,13 @@ 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,
|
||||
const struct bContext *C,
|
||||
const struct AssetLibraryReference *asset_library,
|
||||
ID_Type id_type,
|
||||
struct Main *bmain,
|
||||
struct ReportList *reports);
|
||||
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,
|
||||
struct Main *bmain,
|
||||
struct ReportList *reports);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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,
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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();
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -2125,7 +2125,7 @@ void node_draw_space(const bContext *C, ARegion *region)
|
||||
SpaceNode *snode = CTX_wm_space_node(C);
|
||||
View2D *v2d = ®ion->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);
|
||||
|
@@ -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,
|
||||
|
@@ -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,11 +218,14 @@ 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) {
|
||||
content_start = seq->startdisp;
|
||||
}
|
||||
if (seq->anim_endofs == 0) {
|
||||
content_end = seq->enddisp;
|
||||
/* 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 && seq->endstill == 0) {
|
||||
content_end = seq->enddisp;
|
||||
}
|
||||
}
|
||||
snap_data->target_snap_points[i] = content_start;
|
||||
snap_data->target_snap_points[i + 1] = content_end;
|
||||
@@ -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++) {
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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");
|
||||
|
||||
|
@@ -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,9 +435,7 @@ static bool anything_showing_through(PointerRNA *ptr)
|
||||
if (use_multiple_levels) {
|
||||
return (MAX2(level_start, level_end) > 0);
|
||||
}
|
||||
else {
|
||||
return (level_start > 0);
|
||||
}
|
||||
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 = {
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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, \
|
||||
|
@@ -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;
|
||||
|
@@ -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),
|
||||
|
@@ -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)");
|
||||
|
@@ -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");
|
||||
|
@@ -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:
|
||||
|
@@ -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,
|
||||
|
@@ -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
Reference in New Issue
Block a user