Fix #114260: Compositor sometimes produces straight alpha #114305

Merged
Omar Emara merged 6 commits from OmarEmaraDev/blender:fix-114260 into main 2023-11-06 15:15:33 +01:00
68 changed files with 433 additions and 332 deletions
Showing only changes of commit 73efc97005 - Show all commits

View File

@ -87,7 +87,7 @@ Aristotelis Dossas <teldosas>
Arnaud Degroote <arnaud.degroote@isae-supaero.fr>
Arno Mayrhofer <azrael3000>
Arto Kitula <arto.kitula@gmail.com>
Arye Ramaty <BelgaratTheGrey>
Arye Ramaty <aryeramaty@gmail.com>
Arystanbek Dyussenov <arystan.d@gmail.com>
Asad-ullah Khan <kh4n>
Asher <ThatAsherGuy>
@ -189,6 +189,7 @@ Domino Marama <domino@dominodesigns.info>
Dontsov Valentin <@blend4web.com>
Dorian <BD3D>
Doug Hammond <doughammond@hamsterfight.co.uk>
Douglas Paul <douglas.w.paul@gmail.com>
Ed Halley <ed@halley.cc>
Edgar Roman Cervantes <redvant>
Edmund Kapusniak <edmundmk>
@ -265,6 +266,7 @@ Indy Ray <ScatteredRay>
Inês Almeida <britalmeida@gmail.com>
Ish Bosamiya <ish_bosamiya>
Israel Medina <imedina>
Ivan Kosarev <mail@ivankosarev.com>
Ivan Perevala <ivpe>
Iyad Ahmed <iyadahmed430@gmail.com>
Jack Andersen <someemail@gmail.com>
@ -450,6 +452,7 @@ Mike Pan <mike.c.pan@gmail.com>
Mikhail Matrosov <ktdfly>
Mikhail Rachinskiy <alm>
Mikkel Gjoel <mikkelgjoel>
Milan Davidović <milan.davidovic@protonmail.com>
Milan Jaros <jar091>
Mitchell Stokes <mogurijin@gmail.com>
Monique Dewanchand <m.dewanchand@atmind.nl>

View File

@ -517,7 +517,9 @@ else()
set(WITH_INPUT_IME OFF)
endif()
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
if(UNIX AND NOT APPLE)
# On Windows and for the Blender application on macOS, portable install
# is the only supported installation type, so there is no option.
if(UNIX AND (NOT APPLE OR WITH_PYTHON_MODULE))
option(WITH_INSTALL_PORTABLE "\
Install redistributable runtime, otherwise install into CMAKE_INSTALL_PREFIX"
ON

View File

@ -36,14 +36,12 @@ ExternalProject_Add(external_igc_llvm
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0001-OpenCL-3.0-support.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0002-Remove-__IMAGE_SUPPORT__-macro-for-SPIR.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0003-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0004-OpenCL-support-cl_ext_float_atomics.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0005-OpenCL-Add-cl_khr_integer_dot_product.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0001-Memory-leak-fix-for-Managed-Static-Mutex.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0002-Remove-repo-name-in-LLVM-IR.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0003-Add-missing-include-limit-in-benchmark.patch
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0001-Remove-__IMAGE_SUPPORT__-macro-for-SPIR.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0002-Remove-wrong-check-of-__opencl_c_images-feature-macr.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0003-Fix-checking-mechanism-for-read_write-Image-type.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0004-OpenCL-Allow-undefining-header-only-macros.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0005-Enable-use-of-GNU-C-extension.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0006-Make-globals-used-for-array-initialization-codegen-c.patch
)
add_dependencies(
external_igc_llvm

View File

@ -705,15 +705,15 @@ set(UNIFIED_RUNTIME_FILE unified-runtime-${UNIFIED_RUNTIME_VERSION}.tar.gz)
# compiler, the versions used are taken from the following location
# https://github.com/intel/intel-graphics-compiler/releases
set(IGC_VERSION 1.0.13064.7)
set(IGC_VERSION 1.0.14828.26)
set(IGC_URI https://github.com/intel/intel-graphics-compiler/archive/refs/tags/igc-${IGC_VERSION}.tar.gz)
set(IGC_HASH a929abd4cca2b293961ec0437ee4b3b2147bd3b2c8a3c423af78c0c359b2e5ae)
set(IGC_HASH acad90b3e149cf87875e6b9100152f9e7644d6cc79ed54eaf52698abdb42076c)
set(IGC_HASH_TYPE SHA256)
set(IGC_FILE igc-${IGC_VERSION}.tar.gz)
set(IGC_LLVM_VERSION llvmorg-11.1.0)
set(IGC_LLVM_VERSION llvmorg-14.0.5)
set(IGC_LLVM_URI https://github.com/llvm/llvm-project/archive/refs/tags/${IGC_LLVM_VERSION}.tar.gz)
set(IGC_LLVM_HASH 53a0719f3f4b0388013cfffd7b10c7d5682eece1929a9553c722348d1f866e79)
set(IGC_LLVM_HASH a4a57f029cb81f04618e05853f05fc2d21b64353c760977d8e7799bf7218a23a)
set(IGC_LLVM_HASH_TYPE SHA256)
set(IGC_LLVM_FILE ${IGC_LLVM_VERSION}.tar.gz)
@ -727,33 +727,33 @@ set(IGC_LLVM_FILE ${IGC_LLVM_VERSION}.tar.gz)
#
# WARNING WARNING WARNING
set(IGC_OPENCL_CLANG_VERSION ee31812ea8b89d08c2918f045d11a19bd33525c5)
set(IGC_OPENCL_CLANG_VERSION cf95b338d14685e4f3402ab1828bef31d48f1fd6)
set(IGC_OPENCL_CLANG_URI https://github.com/intel/opencl-clang/archive/${IGC_OPENCL_CLANG_VERSION}.tar.gz)
set(IGC_OPENCL_CLANG_HASH 1db6735bbcfaa31e8a9ba39f121d6bafa806ea8919e9f56782d6aaa67771ddda)
set(IGC_OPENCL_CLANG_HASH e6191148c87ac7fdc2806b04feeb008c217344ee4dd1308b87e4c6cf3112d4bc)
set(IGC_OPENCL_CLANG_HASH_TYPE SHA256)
set(IGC_OPENCL_CLANG_FILE opencl-clang-${IGC_OPENCL_CLANG_VERSION}.tar.gz)
set(IGC_VCINTRINSICS_VERSION v0.11.0)
set(IGC_VCINTRINSICS_VERSION v0.13.0)
set(IGC_VCINTRINSICS_URI https://github.com/intel/vc-intrinsics/archive/refs/tags/${IGC_VCINTRINSICS_VERSION}.tar.gz)
set(IGC_VCINTRINSICS_HASH e5acd5626ce7fa6d41ce154c50ac805eda734ee66af94ef28e680ac2ad81bb9f)
set(IGC_VCINTRINSICS_HASH f98e265b38312cceaa3276b9800e0c5b1f167e5807d50abd9585268c7025e9b7)
set(IGC_VCINTRINSICS_HASH_TYPE SHA256)
set(IGC_VCINTRINSICS_FILE vc-intrinsics-${IGC_VCINTRINSICS_VERSION}.tar.gz)
set(IGC_SPIRV_HEADERS_VERSION sdk-1.3.204.1)
set(IGC_SPIRV_HEADERS_VERSION sdk-1.3.239.0)
set(IGC_SPIRV_HEADERS_URI https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/${IGC_SPIRV_HEADERS_VERSION}.tar.gz)
set(IGC_SPIRV_HEADERS_HASH 262864053968c217d45b24b89044a7736a32361894743dd6cfe788df258c746c)
set(IGC_SPIRV_HEADERS_HASH fdaf6670e311cd1c08ae90bf813e89dd31630205bc60030ffd25fb0af39b51fe)
set(IGC_SPIRV_HEADERS_HASH_TYPE SHA256)
set(IGC_SPIRV_HEADERS_FILE SPIR-V-Headers-${IGC_SPIRV_HEADERS_VERSION}.tar.gz)
set(IGC_SPIRV_TOOLS_VERSION sdk-1.3.204.1)
set(IGC_SPIRV_TOOLS_VERSION sdk-1.3.239.0)
set(IGC_SPIRV_TOOLS_URI https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/${IGC_SPIRV_TOOLS_VERSION}.tar.gz)
set(IGC_SPIRV_TOOLS_HASH 6e19900e948944243024aedd0a201baf3854b377b9cc7a386553bc103b087335)
set(IGC_SPIRV_TOOLS_HASH 327b2dba4515646eee28c1a5fe1332891e81c8b6ff289363f52877f3e67c2d81)
set(IGC_SPIRV_TOOLS_HASH_TYPE SHA256)
set(IGC_SPIRV_TOOLS_FILE SPIR-V-Tools-${IGC_SPIRV_TOOLS_VERSION}.tar.gz)
set(IGC_SPIRV_TRANSLATOR_VERSION d739c01d65ec00dee64dedd40deed805216a7193)
set(IGC_SPIRV_TRANSLATOR_VERSION 23f398bf369093b1fd67459db8071ffcc6b92658)
set(IGC_SPIRV_TRANSLATOR_URI https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/${IGC_SPIRV_TRANSLATOR_VERSION}.tar.gz)
set(IGC_SPIRV_TRANSLATOR_HASH ddc0cc9ccbe59dadeaf291012d59de142b2e9f2b124dbb634644d39daddaa13e)
set(IGC_SPIRV_TRANSLATOR_HASH a96447656ff6b40d9ad286524e22f4e7319d439c54136026fe72550d1162cd35)
set(IGC_SPIRV_TRANSLATOR_HASH_TYPE SHA256)
set(IGC_SPIRV_TRANSLATOR_FILE SPIR-V-Translator-${IGC_SPIRV_TRANSLATOR_VERSION}.tar.gz)
@ -767,9 +767,9 @@ set(GMMLIB_HASH c1f33e1519edfc527127baeb0436b783430dfd256c643130169a3a71dc86aff9
set(GMMLIB_HASH_TYPE SHA256)
set(GMMLIB_FILE ${GMMLIB_VERSION}.tar.gz)
set(OCLOC_VERSION 23.05.25593.18)
set(OCLOC_VERSION 23.30.26918.47)
set(OCLOC_URI https://github.com/intel/compute-runtime/archive/refs/tags/${OCLOC_VERSION}.tar.gz)
set(OCLOC_HASH 122415028e631922ae999c996954dfd98ce9a32decd564d5484c31476ec9306e)
set(OCLOC_HASH 9890f29cbf27ce7eb845f3f7711fe8f3b0c4ee2164b77871fe51102548553f8f)
set(OCLOC_HASH_TYPE SHA256)
set(OCLOC_FILE ocloc-${OCLOC_VERSION}.tar.gz)

View File

@ -1,13 +1,13 @@
diff -Naur external_igc_opencl_clang.orig/CMakeLists.txt external_igc_opencl_clang/CMakeLists.txt
--- external_igc_opencl_clang.orig/CMakeLists.txt 2022-03-16 05:51:10 -0600
+++ external_igc_opencl_clang/CMakeLists.txt 2022-05-23 10:40:09 -0600
@@ -147,22 +147,24 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e972e6..84f9674 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -147,21 +147,24 @@ if(NOT USE_PREBUILT_LLVM)
)
endif()
-
- set(SPIRV_BASE_REVISION llvm_release_110)
- set(TARGET_BRANCH "ocl-open-110")
- set(SPIRV_BASE_REVISION llvm_release_140)
- set(TARGET_BRANCH "ocl-open-140")
- get_filename_component(LLVM_MONOREPO_DIR ${LLVM_SOURCE_DIR} DIRECTORY)
- set(LLVM_PATCHES_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm
- ${CMAKE_CURRENT_SOURCE_DIR}/patches/clang)
@ -22,10 +22,10 @@ diff -Naur external_igc_opencl_clang.orig/CMakeLists.txt external_igc_opencl_cla
- ${TARGET_BRANCH}
- ret)
+ #
+ # Blender: Why apply these manually in igc.cmake
+ # Blender: We apply these manually in igc.cmake
+ #
+ #set(SPIRV_BASE_REVISION llvm_release_110)
+ #set(TARGET_BRANCH "ocl-open-110")
+ #set(SPIRV_BASE_REVISION llvm_release_140)
+ #set(TARGET_BRANCH "ocl-open-140")
+ #get_filename_component(LLVM_MONOREPO_DIR ${LLVM_SOURCE_DIR} DIRECTORY)
+ #set(LLVM_PATCHES_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm
+ # ${CMAKE_CURRENT_SOURCE_DIR}/patches/clang)

View File

@ -859,7 +859,7 @@ static const int lowest_supported_driver_version_win = 1014824;
* This information is returned by `ocloc query OCL_DRIVER_VERSION`.*/
static const int lowest_supported_driver_version_neo = 26957;
# else
static const int lowest_supported_driver_version_neo = 25812;
static const int lowest_supported_driver_version_neo = 26918;
# endif
int OneapiDevice::parse_driver_build_version(const sycl::device &device)

View File

@ -317,14 +317,16 @@ const bTheme U_theme_default = {
.vertex_select = RGBA(0xff7a00ff),
.vertex_bevel = RGBA(0x00a5ffff),
.edge = RGBA(0x000000ff),
.edge_select = RGBA(0xffa000ff),
.edge_select = RGBA(0xff9900ff),
.edge_mode_select = RGBA(0xffd800ff),
.edge_seam = RGBA(0xdb2512ff),
.edge_sharp = RGBA(0x00ffffff),
.edge_facesel = RGBA(0x4b4b4bff),
.edge_crease = RGBA(0xcc0099ff),
.edge_bevel = RGBA(0x00a5ffff),
.face = RGBA(0xffffff02),
.face_select = RGBA(0xffa5522e),
.face_select = RGBA(0xffa30033),
.face_mode_select = RGBA(0xffb70033),
.face_retopology = RGBA(0x50c8ff0f),
.face_back = RGBA(0xff0000b3),
.face_front = RGBA(0x0000ffb3),

View File

@ -368,12 +368,13 @@
light="#00000028"
speaker="#000000"
vertex="#000000"
vertex_select="#ff8500"
vertex_select="#ff7a00"
vertex_active="#000000"
vertex_size="3"
vertex_bevel="#00a5ff"
vertex_unreferenced="#000000"
edge_select="#ffa000"
edge_select="#ff9900"
edge_mode_select="#ffd800"
edge_seam="#db2512"
edge_sharp="#00ffff"
edge_crease="#cc0099"
@ -381,7 +382,8 @@
edge_facesel="#4b4b4b"
freestyle_edge_mark="#7fff7f"
face="#00000012"
face_select="#ff85004d"
face_select="#ffa30033"
face_mode_select="#ffb70033"
face_dot="#ff8500"
facedot_size="4"
freestyle_face_mark="#7fff7f33"

View File

@ -7055,9 +7055,6 @@ class VIEW3D_PT_overlay_edit_mesh(Panel):
split = col.split()
sub = split.column()
sub.active = is_any_solid_shading
sub.prop(overlay, "show_edges", text="Edges")
sub = split.column()
sub.prop(overlay, "show_faces", text="Faces")
sub = split.column()

View File

@ -339,4 +339,4 @@ bool autokeyframe_property(bContext *C,
return changed;
}
} // namespace blender::animrig
} // namespace blender::animrig

View File

@ -285,4 +285,4 @@ Vector<float> visualkey_get_values(PointerRNA *ptr, PropertyRNA *prop)
/* as the function hasn't returned yet, read value from system in the default way */
return ANIM_setting_get_rna_values(ptr, prop);
}
} // namespace blender::animrig
} // namespace blender::animrig

View File

@ -29,7 +29,7 @@ extern "C" {
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
#define BLENDER_FILE_SUBVERSION 3
#define BLENDER_FILE_SUBVERSION 4
/* Minimum Blender version that supports reading file written with the current
* version. Older Blender versions will test this and cancel loading the file, showing a warning to

View File

@ -470,8 +470,6 @@ void BKE_pbvh_face_sets_set(PBVH *pbvh, int *face_sets);
*/
void BKE_pbvh_update_hide_attributes_from_mesh(PBVH *pbvh);
void BKE_pbvh_face_sets_color_set(PBVH *pbvh, int seed, int color_default);
/* Vertex Deformer. */
void BKE_pbvh_vert_coords_apply(PBVH *pbvh, const float (*vertCos)[3], int totvert);

View File

@ -1756,8 +1756,6 @@ static void sculpt_update_object(
BKE_pbvh_face_sets_set(ss->pbvh, ss->face_sets);
BKE_pbvh_update_hide_attributes_from_mesh(ss->pbvh);
BKE_pbvh_face_sets_color_set(ss->pbvh, me->face_sets_color_seed, me->face_sets_color_default);
sculpt_attribute_update_refs(ob);
sculpt_update_persistent_base(ob);
@ -1951,28 +1949,53 @@ void BKE_sculpt_update_object_for_edit(
int *BKE_sculpt_face_sets_ensure(Object *ob)
{
SculptSession *ss = ob->sculpt;
Mesh *mesh = static_cast<Mesh *>(ob->data);
using namespace blender;
using namespace blender::bke;
MutableAttributeAccessor attributes = mesh->attributes_for_write();
if (!attributes.contains(".sculpt_face_set")) {
SpanAttributeWriter<int> face_sets = attributes.lookup_or_add_for_write_only_span<int>(
".sculpt_face_set", ATTR_DOMAIN_FACE);
face_sets.span.fill(1);
mesh->face_sets_color_default = 1;
face_sets.finish();
Mesh *mesh = static_cast<Mesh *>(ob->data);
SculptSession *ss = ob->sculpt;
PBVH *pbvh = ss->pbvh;
if (!pbvh) {
BLI_assert_unreachable();
return nullptr;
}
const StringRefNull name = ".sculpt_face_set";
switch (BKE_pbvh_type(pbvh)) {
case PBVH_FACES:
case PBVH_GRIDS: {
MutableAttributeAccessor attributes = mesh->attributes_for_write();
if (!attributes.contains(name)) {
attributes.add<int>(name,
ATTR_DOMAIN_FACE,
AttributeInitVArray(VArray<int>::ForSingle(1, mesh->faces_num)));
mesh->face_sets_color_default = 1;
}
int *face_sets = static_cast<int *>(CustomData_get_layer_named_for_write(
&mesh->face_data, CD_PROP_INT32, name.c_str(), mesh->faces_num));
BKE_pbvh_face_sets_set(pbvh, face_sets);
return face_sets;
}
case PBVH_BMESH: {
BMesh *bm = BKE_pbvh_get_bmesh(pbvh);
if (!CustomData_has_layer_named(&bm->pdata, CD_PROP_INT32, name.c_str())) {
BM_data_layer_add_named(bm, &bm->pdata, CD_PROP_INT32, name.c_str());
const int offset = CustomData_get_offset_named(&bm->pdata, CD_PROP_INT32, name.c_str());
if (offset == -1) {
return nullptr;
}
BMIter iter;
BMFace *face;
BM_ITER_MESH (face, &iter, bm, BM_FACES_OF_MESH) {
BM_ELEM_CD_SET_INT(face, offset, 1);
}
mesh->face_sets_color_default = 1;
}
break;
}
}
int *face_sets = static_cast<int *>(CustomData_get_layer_named_for_write(
&mesh->face_data, CD_PROP_INT32, ".sculpt_face_set", mesh->faces_num));
if (ss->pbvh && ELEM(BKE_pbvh_type(ss->pbvh), PBVH_FACES, PBVH_GRIDS)) {
BKE_pbvh_face_sets_set(ss->pbvh, face_sets);
}
return face_sets;
return nullptr;
}
bool *BKE_sculpt_hide_poly_ensure(Mesh *mesh)

View File

@ -665,8 +665,8 @@ static void pbvh_draw_args_init(const Mesh &mesh, PBVH *pbvh, PBVH_GPU_Args *arg
args->node = node;
args->grid_hidden = pbvh->grid_hidden;
args->face_sets_color_default = pbvh->face_sets_color_default;
args->face_sets_color_seed = pbvh->face_sets_color_seed;
args->face_sets_color_default = mesh.face_sets_color_default;
args->face_sets_color_seed = mesh.face_sets_color_seed;
args->vert_positions = pbvh->vert_positions;
if (pbvh->mesh) {
args->corner_verts = pbvh->corner_verts;
@ -851,9 +851,6 @@ void BKE_pbvh_build_mesh(PBVH *pbvh, Mesh *mesh)
pbvh->faces_num = mesh->faces_num;
pbvh->face_sets_color_seed = mesh->face_sets_color_seed;
pbvh->face_sets_color_default = mesh->face_sets_color_default;
/* For each face, store the AABB and the AABB centroid */
blender::Array<BBC> prim_bbc(looptri_num);
BB cb;
@ -2852,12 +2849,6 @@ void BKE_pbvh_update_normals(PBVH *pbvh, SubdivCCG *subdiv_ccg)
}
}
void BKE_pbvh_face_sets_color_set(PBVH *pbvh, int seed, int color_default)
{
pbvh->face_sets_color_seed = seed;
pbvh->face_sets_color_default = color_default;
}
/**
* PBVH drawing, updating draw buffers as needed and culling any nodes outside
* the specified frustum.

View File

@ -199,7 +199,7 @@ static BMVert *bm_vert_hash_lookup_chain(GHash *deleted_verts, BMVert *v)
/****************************** Building ******************************/
/* Update node data after splitting. */
/** Update node data after splitting. */
static void pbvh_bmesh_node_finalize(PBVH *pbvh,
const int node_index,
const int cd_vert_node_offset,
@ -250,7 +250,7 @@ static void pbvh_bmesh_node_finalize(PBVH *pbvh,
n->flag |= PBVH_UpdateNormals;
}
/* Recursively split the node if it exceeds the leaf_limit. */
/** Recursively split the node if it exceeds the leaf_limit. */
static void pbvh_bmesh_node_split(PBVH *pbvh, const Span<BBC> bbc_array, int node_index)
{
const int cd_vert_node_offset = pbvh->cd_vert_node_offset;
@ -360,7 +360,7 @@ static void pbvh_bmesh_node_split(PBVH *pbvh, const Span<BBC> bbc_array, int nod
n->orig_vb = n->vb;
}
/* Recursively split the node if it exceeds the leaf_limit. */
/** Recursively split the node if it exceeds the leaf_limit. */
static bool pbvh_bmesh_node_limit_ensure(PBVH *pbvh, int node_index)
{
PBVHNode &node = pbvh->nodes[node_index];
@ -441,7 +441,7 @@ static BMVert *pbvh_bmesh_vert_create(PBVH *pbvh,
BLI_assert((pbvh->nodes.size() == 1 || node_index) && node_index <= pbvh->nodes.size());
/* Avoid initializing customdata because its quite involved. */
/* Avoid initializing custom-data because its quite involved. */
BMVert *v = BM_vert_create(pbvh->header.bm, co, nullptr, BM_CREATE_NOP);
BM_data_interp_from_verts(pbvh->header.bm, v1, v2, v, 0.5f);
@ -515,7 +515,7 @@ static int pbvh_bmesh_node_vert_use_count_at_most(PBVH *pbvh,
return count;
}
/* Return a node that uses vertex 'v' other than its current owner. */
/** Return a node that uses vertex `v` other than its current owner. */
static PBVHNode *pbvh_bmesh_vert_other_node_find(PBVH *pbvh, BMVert *v)
{
PBVHNode *current_node = pbvh_bmesh_node_from_vert(pbvh, v);
@ -744,7 +744,7 @@ static bool edge_queue_tri_in_circle(const EdgeQueue *q, BMFace *f)
return len_squared_v3v3(q->center_proj, c) <= q->radius_squared;
}
/* Return true if the vertex mask is less than 1.0, false otherwise. */
/** Return true if the vertex mask is less than 1.0, false otherwise. */
static bool check_mask(EdgeQueueContext *eq_ctx, BMVert *v)
{
return BM_ELEM_CD_GET_FLOAT(v, eq_ctx->cd_vert_mask_offset) < 1.0f;
@ -774,7 +774,7 @@ static void edge_queue_insert(EdgeQueueContext *eq_ctx, BMEdge *e, float priorit
}
}
/* Return true if the edge is a boundary edge: both its vertices are on a boundary. */
/** Return true if the edge is a boundary edge: both its vertices are on a boundary. */
static bool is_boundary_edge(const BMEdge &edge)
{
if (edge.head.hflag & BM_ELEM_SEAM) {
@ -806,7 +806,7 @@ static bool is_boundary_vert(const BMVert &vertex)
return false;
}
/* Return true if at least one of the edge vertices is adjacent to a boundary. */
/** Return true if at least one of the edge vertices is adjacent to a boundary. */
static bool is_edge_adjacent_to_boundary(const BMEdge &edge)
{
return is_boundary_vert(*edge.v1) || is_boundary_vert(*edge.v2);
@ -1043,7 +1043,8 @@ static void long_edge_queue_create(EdgeQueueContext *eq_ctx,
}
}
/* Create a priority queue containing vertex pairs connected by a
/**
* Create a priority queue containing vertex pairs connected by a
* short edge as defined by PBVH.bm_min_edge_len.
*
* Only nodes marked for topology update are checked, and in those
@ -1161,8 +1162,7 @@ static void pbvh_bmesh_split_edge(EdgeQueueContext *eq_ctx, PBVH *pbvh, BMEdge *
pbvh_bmesh_vert_ownership_transfer(pbvh, &pbvh->nodes[ni], v_new);
}
/**
* The 2 new faces created and assigned to `f_new` have their
/* The 2 new faces created and assigned to `f_new` have their
* verts & edges shuffled around.
*
* - faces wind anticlockwise in this example.
@ -1297,11 +1297,11 @@ static bool vert_in_face_adjacent_to_edge(BMVert &vert, BMEdge &edge)
*
* This function is to be called before faces adjacent to \a e are deleted.
* This function only handles edge attributes and does not handle face deletion.
*
* \param del_face: Face which is adjacent to \a v_del and will form a flap when merging \a v_del
* to \a v_conn.
* to \a v_conn.
* \param flap_face: Face which is adjacent to \a v_conn and will form a flap when merging \a v_del
* to \a v_conn.
* to \a v_conn.
* \param e: An edge which is being collapsed. It connects \a v_del and \a v_conn.
* \param v_del: A vertex which will be removed after the edge collapse.
* \param l_del: A loop of del_face which is adjacent to v_del.
@ -1316,7 +1316,6 @@ static void merge_flap_edge_data(BMesh &bm,
BMVert *v_conn)
{
/*
*
* v_del
* +
* del_face . / |
@ -1335,11 +1334,11 @@ static void merge_flap_edge_data(BMesh &bm,
UNUSED_VARS_NDEBUG(del_face, flap_face);
/* Faces around `e` (which connects `v_del` to `v_conn`) are to the handled separately from this
* function. Help troubleshooting cases where these faces are mistakingly considered flaps. */
* function. Help troubleshooting cases where these faces are mistakenly considered flaps. */
BLI_assert(!BM_edge_in_face(e, del_face));
BLI_assert(!BM_edge_in_face(e, flap_face));
/* The l_del->next->v and l_del->prev->v are v1 and v2, but in an unknown order. */
/* The `l_del->next->v` and `l_del->prev->v` are v1 and v2, but in an unknown order. */
BMEdge *edge_v1_v2 = BM_edge_exists(l_del->next->v, l_del->prev->v);
if (!edge_v1_v2) {
CLOG_WARN(&LOG, "Unable to find edge shared between deleting and flap faces");
@ -1404,11 +1403,13 @@ static BMVert *find_outer_flap_vert(BMFace &face)
return flap_vert;
}
/* If the `del_face` is a flap, merge edge data from edges adjacent to "corner" vertex into the
/**
* If the `del_face` is a flap, merge edge data from edges adjacent to "corner" vertex into the
* other edge. The "corner" as it is an "outer", or a vertex which will become loose when the
* `del_face` and its edges are removed.
*
* If the face is not a flap then this function does nothing. */
* If the face is not a flap then this function does nothing.
*/
static void try_merge_flap_edge_data_before_dissolve(BMesh &bm, BMFace &face)
{
/*
@ -1448,11 +1449,11 @@ static void try_merge_flap_edge_data_before_dissolve(BMesh &bm, BMFace &face)
*
* This function is to be called before faces adjacent to \a e are deleted.
* This function only handles edge attributes. and does not handle face deletion.
*
* \param del_face: Face which is adjacent to \a v_del and will be deleted as part of merging
* \a v_del to \a v_conn.
* \a v_del to \a v_conn.
* \param new_face: A new face which is created from \a del_face by replacing \a v_del with
* \a v_conn.
* \a v_conn.
* \param v_del: A vertex which will be removed after the edge collapse.
* \param l_del: A loop of del_face which is adjacent to v_del.
* \param v_conn: A vertex which into which geometry is reconnected to after the edge collapse.

View File

@ -177,8 +177,6 @@ struct PBVH {
CustomData *loop_data;
CustomData *face_data;
int face_sets_color_seed;
int face_sets_color_default;
int *face_sets;
/* Grid Data */

View File

@ -194,14 +194,14 @@ ptrdiff_t BLI_str_utf8_invalid_byte(const char *str, size_t length)
/* Check for overlong sequences for each different length */
switch (ab) {
case 1:
/* Check for: XX00 000X. */
/* Check for: `XX00 000X`. */
if ((c & 0x3e) == 0) {
goto utf8_error;
}
continue; /* We know there aren't any more bytes to check */
case 2:
/* Check for: 1110 0000, XX0X XXXX. */
/* Check for: `1110 0000, XX0X XXXX`. */
if (c == 0xe0 && (*p & 0x20) == 0) {
goto utf8_error;
}
@ -243,21 +243,21 @@ ptrdiff_t BLI_str_utf8_invalid_byte(const char *str, size_t length)
break;
case 3:
/* Check for: 1111 0000, XX00 XXXX. */
/* Check for: `1111 0000, XX00 XXXX`. */
if (c == 0xf0 && (*p & 0x30) == 0) {
goto utf8_error;
}
break;
case 4:
/* Check for 1111 1000, XX00 0XXX. */
/* Check for `1111 1000, XX00 0XXX`. */
if (c == 0xf8 && (*p & 0x38) == 0) {
goto utf8_error;
}
break;
case 5:
/* Check for: 1111 1100, XX00 00XX. */
/* Check for: `1111 1100, XX00 00XX`. */
if (c == 0xfc && (*p & 0x3c) == 0) {
goto utf8_error;
}

View File

@ -19,7 +19,8 @@
# include "utf_winfunc.hh"
# include "utfconv.hh"
/* Pinning : Windows allows people to pin an application to their taskbar, when a user pins
/**
* Pinning: Windows allows people to pin an application to their taskbar, when a user pins
* blender, the data we set in `GHOST_WindowWin32::registerWindowAppUserModelProperties` is used
* which includes the path to the `blender-launcher.exe`. Now once that shortcut is created on
* the taskbar, this will never be updated, if people remove blender and install it again to a
@ -27,8 +28,8 @@
* shortcut on the taskbar points to a no longer existing blender installation. Now you may think,
* just un-pin and re-pin that should clear that right up! It doesn't, it'll keep using the
* outdated path till the end of time and there's no window API call we can do to update this
* information. However this shortcut is stored in the user profile in a sub-foder we can easily
* query, from there, we can iterate over all files, look for the one that has our appid in it,
* information. However this shortcut is stored in the user profile in a sub-folder we can easily
* query, from there, we can iterate over all files, look for the one that has our APP-ID in it,
* and when we find it, update the path to the blender launcher to the current installation, bit
* of a hack, but Microsoft seemingly offers no other way to deal with this problem.
*

View File

@ -78,4 +78,4 @@ TEST(BLI_string_utils, BLI_uniquename_cb)
}
}
} // namespace blender
} // namespace blender

View File

@ -4148,8 +4148,8 @@ void blo_do_versions_280(FileData *fd, Library * /*lib*/, Main *bmain)
View3D *v3d = (View3D *)sl;
v3d->overlay.edit_flag |= V3D_OVERLAY_EDIT_FACES | V3D_OVERLAY_EDIT_SEAMS |
V3D_OVERLAY_EDIT_SHARP | V3D_OVERLAY_EDIT_FREESTYLE_EDGE |
V3D_OVERLAY_EDIT_FREESTYLE_FACE | V3D_OVERLAY_EDIT_EDGES |
V3D_OVERLAY_EDIT_CREASES | V3D_OVERLAY_EDIT_BWEIGHTS;
V3D_OVERLAY_EDIT_FREESTYLE_FACE | V3D_OVERLAY_EDIT_CREASES |
V3D_OVERLAY_EDIT_BWEIGHTS;
}
}
}

View File

@ -43,6 +43,8 @@
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "BKE_anim_data.h"
#include "BKE_animsys.h"
#include "BKE_armature.h"
#include "BKE_attribute.h"
#include "BKE_curve.h"
@ -242,6 +244,60 @@ static void version_bonegroups_to_bonecollections(Main *bmain)
}
}
static void version_principled_bsdf_update_animdata(ID *owner_id, bNodeTree *ntree)
{
ID *id = &ntree->id;
AnimData *adt = BKE_animdata_from_id(id);
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
if (node->type != SH_NODE_BSDF_PRINCIPLED) {
continue;
}
char node_name_escaped[MAX_NAME * 2];
BLI_str_escape(node_name_escaped, node->name, sizeof(node_name_escaped));
std::string prefix = "nodes[\"" + std::string(node_name_escaped) + "\"].inputs";
/* Remove animdata for inputs 18 (Transmission Roughness) and 3 (Subsurface Color). */
BKE_animdata_fix_paths_remove(id, (prefix + "[18]").c_str());
BKE_animdata_fix_paths_remove(id, (prefix + "[3]").c_str());
/* Order is important here: If we e.g. want to change A->B and B->C, but perform A->B first,
* then later we don't know whether a B entry is an original B (and therefore should be
* changed to C) or used to be A and was already handled.
* In practice, going reverse mostly works, the two notable dependency chains are:
* - 8->13, then 2->8, then 9->2 (13 was changed before)
* - 1->9, then 6->1 (9 was changed before)
* - 4->10, then 21->4 (10 was changed before)
*
* 0 (Base Color) and 17 (Transmission) are fine as-is. */
std::pair<int, int> remap_table[] = {
{20, 27}, /* Emission Strength */
{19, 26}, /* Emission */
{16, 3}, /* IOR */
{15, 19}, /* Clearcoat Roughness */
{14, 18}, /* Clearcoat */
{13, 25}, /* Sheen Tint */
{12, 23}, /* Sheen */
{11, 15}, /* Anisotropic Rotation */
{10, 14}, /* Anisotropic */
{8, 13}, /* Specular Tint */
{2, 8}, /* Subsurface Radius */
{9, 2}, /* Roughness */
{7, 12}, /* Specular */
{1, 9}, /* Subsurface Scale */
{6, 1}, /* Metallic */
{5, 11}, /* Subsurface Anisotropy */
{4, 10}, /* Subsurface IOR */
{21, 4} /* Alpha */
};
for (const auto &entry : remap_table) {
BKE_animdata_fix_paths_rename(
id, adt, owner_id, prefix.c_str(), nullptr, nullptr, entry.first, entry.second, false);
}
}
}
void do_versions_after_linking_400(FileData *fd, Main *bmain)
{
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 9)) {
@ -312,6 +368,16 @@ void do_versions_after_linking_400(FileData *fd, Main *bmain)
}
}
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 24)) {
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
if (ntree->type == NTREE_SHADER) {
/* Convert animdata on the Principled BSDF sockets. */
version_principled_bsdf_update_animdata(id, ntree);
}
}
FOREACH_NODETREE_END;
}
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 34)) {
BKE_mesh_legacy_face_map_to_generic(bmain);
}

View File

@ -188,8 +188,8 @@ static void blo_update_defaults_screen(bScreen *screen,
v3d->overlay.texture_paint_mode_opacity = 1.0f;
v3d->overlay.weight_paint_mode_opacity = 1.0f;
v3d->overlay.vertex_paint_mode_opacity = 1.0f;
/* Use dimmed selected edges. */
v3d->overlay.edit_flag &= ~V3D_OVERLAY_EDIT_EDGES;
/* Clear this deprecated bit for later reuse. */
v3d->overlay.edit_flag &= ~V3D_OVERLAY_EDIT_EDGES_DEPRECATED;
/* grease pencil settings */
v3d->vertex_opacity = 1.0f;
v3d->gp_flag |= V3D_GP_SHOW_EDIT_LINES;

View File

@ -133,6 +133,13 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
memcpy(btheme, &U_theme_default, sizeof(*btheme));
}
if (!USER_VERSION_ATLEAST(401, 4)) {
FROM_DEFAULT_V4_UCHAR(space_view3d.edge_select);
FROM_DEFAULT_V4_UCHAR(space_view3d.edge_mode_select);
FROM_DEFAULT_V4_UCHAR(space_view3d.face_select);
FROM_DEFAULT_V4_UCHAR(space_view3d.face_mode_select);
}
/**
* Versioning code until next subversion bump goes here.
*

View File

@ -208,7 +208,6 @@ class ZstdWriteWrap : public WriteWrap {
int next_frame = 0;
int num_frames = 0;
int level = 0;
ListBase frames = {};
bool write_error = false;

View File

@ -9,6 +9,7 @@
#include "IMB_colormanagement.h"
#include "COM_KuwaharaClassicOperation.h"
#include "COM_SummedAreaTableOperation.h"
namespace blender::compositor {

View File

@ -159,12 +159,16 @@ float4 summed_area_table_sum_tiled(SocketReader *buffer, const rcti &area)
corrected_upper_bound[1] = math::min((int)buffer->get_height() - 1, upper_bound[1]);
float4 a, b, c, d, addend, substrahend;
buffer->read_sampled(&a.x, corrected_upper_bound[0], corrected_upper_bound[1], PixelSampler::Nearest);
buffer->read_sampled(&d.x, corrected_lower_bound[0], corrected_lower_bound[1], PixelSampler::Nearest);
buffer->read_sampled(
&a.x, corrected_upper_bound[0], corrected_upper_bound[1], PixelSampler::Nearest);
buffer->read_sampled(
&d.x, corrected_lower_bound[0], corrected_lower_bound[1], PixelSampler::Nearest);
addend = a + d;
buffer->read_sampled(&b.x, corrected_lower_bound[0], corrected_upper_bound[1], PixelSampler::Nearest);
buffer->read_sampled(&c.x, corrected_upper_bound[0], corrected_lower_bound[1], PixelSampler::Nearest);
buffer->read_sampled(
&b.x, corrected_lower_bound[0], corrected_upper_bound[1], PixelSampler::Nearest);
buffer->read_sampled(
&c.x, corrected_upper_bound[0], corrected_lower_bound[1], PixelSampler::Nearest);
substrahend = b + c;
float4 sum = addend - substrahend;

View File

@ -23,8 +23,8 @@ enum class Interpolation : uint8_t {
* Realization Options
*
* The options that describe how an input result prefer to be realized on some other domain. This
* is used by the Realize On Domain Operation to identify the appropriate method of realization.
* See the Domain class for more information. */
* is used by the Realize On Domain and Transform algorithms to identify the appropriate method of
* realization. See the Domain class for more information. */
struct RealizationOptions {
/* The interpolation method that should be used when performing realization. Since realizing a
* result involves projecting it on a different domain, which in turn, involves sampling the
@ -34,11 +34,11 @@ struct RealizationOptions {
/* If true, the result will be repeated infinitely along the horizontal axis when realizing the
* result. If false, regions outside of bounds of the result along the horizontal axis will be
* filled with zeros. */
bool repeat_x = false;
bool wrap_x = false;
/* If true, the result will be repeated infinitely along the vertical axis when realizing the
* result. If false, regions outside of bounds of the result along the vertical axis will be
* filled with zeros. */
bool repeat_y = false;
bool wrap_y = false;
};
/* ------------------------------------------------------------------------------------------------

View File

@ -198,6 +198,9 @@ class Result {
* a practical example of use. */
void steal_data(Result &source);
/* Sets the transformation of the domain of the result to the given transformation. */
void set_transformation(const float3x3 &transformation);
/* Transform the result by the given transformation. This effectively pre-multiply the given
* transformation by the current transformation of the domain of the result. */
void transform(const float3x3 &transformation);

View File

@ -12,8 +12,8 @@
namespace blender::realtime_compositor {
/* Transforms the given result based on the given transformation and interpolation, writing the
* transformed result to the given output.
/* Transforms the given result based on the given transformation and realization options, writing
* the transformed result to the given output.
*
* The rotation and scale components of the transformation are realized and the size of the result
* is increased/reduced to adapt to the new transformation. For instance, if the transformation is
@ -23,11 +23,16 @@ namespace blender::realtime_compositor {
* 16k.
*
* The translation component of the transformation is delayed and only stored in the domain of the
* result to be realized later when needed. */
* result to be realized later when needed, except if the realization options has wrapping enabled,
* in which case, the result will be translated such that it is clipped on the one side and wrapped
* on the opposite side.
*
* The empty areas around the image after rotation will either be transparent or repetitions of the
* image based on the realization options. */
void transform(Context &context,
Result &input,
Result &output,
float3x3 transformation,
Interpolation interpolation);
RealizationOptions realization_options);
} // namespace blender::realtime_compositor

View File

@ -62,6 +62,12 @@ void realize_on_domain(Context &context,
const float3x3 &input_transformation,
const RealizationOptions &realization_options)
{
const Domain input_domain = Domain(input.domain().size, input_transformation);
if (input_domain == domain) {
input.pass_through(output);
output.set_transformation(domain.transformation);
return;
}
GPUShader *shader = context.shader_manager().get(
get_realization_shader(input, realization_options));
@ -87,16 +93,14 @@ void realize_on_domain(Context &context,
realization_options.interpolation, Interpolation::Bilinear, Interpolation::Bicubic);
GPU_texture_filter_mode(input.texture(), use_bilinear);
/* If the input repeats, set a repeating wrap mode for out-of-bound texture access. Otherwise,
/* If the input wraps, set a repeating wrap mode for out-of-bound texture access. Otherwise,
* make out-of-bound texture access return zero by setting a clamp to border extend mode. */
GPU_texture_extend_mode_x(input.texture(),
realization_options.repeat_x ?
GPU_SAMPLER_EXTEND_MODE_REPEAT :
GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER);
realization_options.wrap_x ? GPU_SAMPLER_EXTEND_MODE_REPEAT :
GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER);
GPU_texture_extend_mode_y(input.texture(),
realization_options.repeat_y ?
GPU_SAMPLER_EXTEND_MODE_REPEAT :
GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER);
realization_options.wrap_y ? GPU_SAMPLER_EXTEND_MODE_REPEAT :
GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER);
input.bind_as_texture(shader, "input_tx");

View File

@ -56,32 +56,30 @@ void transform(Context &context,
Result &input,
Result &output,
float3x3 transformation,
Interpolation interpolation)
RealizationOptions realization_options)
{
math::AngleRadian rotation;
float2 translation, scale;
math::to_loc_rot_scale(transformation, translation, rotation, scale);
/* If we are wrapping, the input is translated but the target domain remains fixed, which results
* in the input clipping on one side and wrapping on the opposite side. This mask vector can be
* multiplied to the translation component of the transformation to remove it. */
const float2 wrap_mask = float2(realization_options.wrap_x ? 0.0f : 1.0f,
realization_options.wrap_y ? 0.0f : 1.0f);
/* Rotation and scale transformations are immediately realized. */
if (rotation != 0.0f || scale != float2(1.0f)) {
RealizationOptions realization_options = input.get_realization_options();
realization_options.interpolation = interpolation;
/* Compute a transformed input domain, excluding translations of wrapped axes. */
Domain input_domain = input.domain();
float3x3 domain_transformation = transformation;
domain_transformation.location() *= wrap_mask;
input_domain.transform(domain_transformation);
Domain input_domain = input.domain();
input_domain.transform(transformation);
/* Realize the input on the target domain using the full transformation. */
const Domain target_domain = compute_realized_transformation_domain(input_domain);
realize_on_domain(context,
input,
output,
target_domain,
transformation * input.domain().transformation,
realization_options);
const Domain target_domain = compute_realized_transformation_domain(input_domain);
realize_on_domain(
context, input, output, target_domain, input_domain.transformation, realization_options);
}
else {
input.pass_through(output);
const float3x3 translation_matrix = math::from_location<float3x3>(translation);
output.transform(translation_matrix);
}
output.get_realization_options().interpolation = interpolation;
output.get_realization_options().interpolation = realization_options.interpolation;
}
} // namespace blender::realtime_compositor

View File

@ -179,6 +179,11 @@ void Result::steal_data(Result &source)
source.texture_pool_ = nullptr;
}
void Result::set_transformation(const float3x3 &transformation)
{
domain_.transformation = transformation;
}
void Result::transform(const float3x3 &transformation)
{
domain_.transform(transformation);

View File

@ -125,4 +125,4 @@ void main()
// downsample_level(out_mip_10, 10);
}
}
}
}

View File

@ -220,4 +220,4 @@ ScreenTraceHitData raytrace_planar(RayTraceData rt_data,
return result;
}
#endif
#endif

View File

@ -53,6 +53,7 @@ void OVERLAY_edit_mesh_cache_init(OVERLAY_Data *vedata)
DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
const DRWContextState *draw_ctx = DRW_context_state_get();
const View3DShading *shading = &draw_ctx->v3d->shading;
ToolSettings *tsettings = draw_ctx->scene->toolsettings;
View3D *v3d = draw_ctx->v3d;
bool select_vert = pd->edit_mesh.select_vert = (tsettings->selectmode & SCE_SELECT_VERTEX) != 0;
@ -66,7 +67,6 @@ void OVERLAY_edit_mesh_cache_init(OVERLAY_Data *vedata)
float retopology_offset = RETOPOLOGY_OFFSET(v3d);
pd->edit_mesh.do_faces = true;
pd->edit_mesh.do_edges = true;
int *mask = shdata->data_mask;
mask[0] = 0xFF; /* Face Flag */
@ -85,16 +85,8 @@ void OVERLAY_edit_mesh_cache_init(OVERLAY_Data *vedata)
if ((flag & V3D_OVERLAY_EDIT_FACES) == 0) {
pd->edit_mesh.do_faces = false;
}
if ((flag & V3D_OVERLAY_EDIT_EDGES) == 0) {
if ((tsettings->selectmode & SCE_SELECT_EDGE) == 0) {
if ((v3d->shading.type < OB_SOLID) || (v3d->shading.flag & V3D_SHADING_XRAY)) {
/* Special case, when drawing wire, draw edges, see: #67637. */
}
else {
pd->edit_mesh.do_edges = false;
}
}
}
const bool is_wire_shmode = (shading->type == OB_WIRE);
float backwire_opacity = (pd->edit_mesh.do_zbufclip) ? v3d->overlay.backwire_opacity : 1.0f;
float face_alpha = (!pd->edit_mesh.do_faces) ? 0.0f : 1.0f;
@ -172,7 +164,8 @@ void OVERLAY_edit_mesh_cache_init(OVERLAY_Data *vedata)
DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
DRW_shgroup_uniform_ivec4(grp, "dataMask", mask, 1);
DRW_shgroup_uniform_float_copy(grp, "alpha", face_alpha);
DRW_shgroup_uniform_bool_copy(grp, "selectFaces", select_face);
DRW_shgroup_uniform_bool_copy(grp, "selectFace", select_face);
DRW_shgroup_uniform_bool_copy(grp, "wireShading", is_wire_shmode);
DRW_shgroup_uniform_float_copy(grp, "retopologyOffset", retopology_offset);
}
@ -191,7 +184,7 @@ void OVERLAY_edit_mesh_cache_init(OVERLAY_Data *vedata)
DRW_shgroup_uniform_ivec4(grp, "dataMask", mask, 1);
DRW_shgroup_uniform_float_copy(grp, "alpha", backwire_opacity);
DRW_shgroup_uniform_texture_ref(grp, "depthTex", depth_tex);
DRW_shgroup_uniform_bool_copy(grp, "selectEdges", pd->edit_mesh.do_edges || select_edge);
DRW_shgroup_uniform_bool_copy(grp, "selectEdge", select_edge);
DRW_shgroup_uniform_bool_copy(grp, "do_smooth_wire", do_smooth_wire);
DRW_shgroup_uniform_float_copy(grp, "retopologyOffset", retopology_offset);

View File

@ -367,7 +367,6 @@ struct OVERLAY_PrivateData {
struct {
bool do_zbufclip;
bool do_faces;
bool do_edges;
bool select_vert;
bool select_face;
bool select_edge;

View File

@ -108,7 +108,10 @@ struct ThemeColorData {
float4 color_vertex_unreferenced;
float4 color_vertex_missing_data;
float4 color_edit_mesh_active;
/** For edge selection, not edge select mode. */
float4 color_edge_select;
/** For edge mode selection. */
float4 color_edge_mode_select;
float4 color_edge_seam;
float4 color_edge_sharp;
float4 color_edge_crease;
@ -116,7 +119,10 @@ struct ThemeColorData {
float4 color_edge_face_select;
float4 color_edge_freestyle;
float4 color_face;
/** For face selection, not face select mode. */
float4 color_face_select;
/** For face mode selection. */
float4 color_face_mode_select;
float4 color_face_freestyle;
float4 color_gpencil_vertex;
float4 color_gpencil_vertex_select;

View File

@ -17,8 +17,9 @@ GPU_SHADER_CREATE_INFO(overlay_edit_mesh_common)
.define("blender_srgb_to_framebuffer_space(a)", "a")
.sampler(0, ImageType::DEPTH_2D, "depthTex")
.fragment_out(0, Type::VEC4, "fragColor")
.push_constant(Type::BOOL, "selectFaces")
.push_constant(Type::BOOL, "selectEdges")
.push_constant(Type::BOOL, "wireShading")
.push_constant(Type::BOOL, "selectFace")
.push_constant(Type::BOOL, "selectEdge")
.push_constant(Type::FLOAT, "alpha")
.push_constant(Type::FLOAT, "retopologyOffset")
.push_constant(Type::IVEC4, "dataMask")
@ -31,8 +32,9 @@ GPU_SHADER_CREATE_INFO(overlay_edit_mesh_common_no_geom)
.define("blender_srgb_to_framebuffer_space(a)", "a")
.sampler(0, ImageType::DEPTH_2D, "depthTex")
.fragment_out(0, Type::VEC4, "fragColor")
.push_constant(Type::BOOL, "selectFaces")
.push_constant(Type::BOOL, "selectEdges")
.push_constant(Type::BOOL, "wireShading")
.push_constant(Type::BOOL, "selectFace")
.push_constant(Type::BOOL, "selectEdge")
.push_constant(Type::FLOAT, "alpha")
.push_constant(Type::FLOAT, "retopologyOffset")
.push_constant(Type::IVEC4, "dataMask")

View File

@ -16,23 +16,20 @@ vec4 EDIT_MESH_edge_color_outer(uint edge_flag, uint face_flag, float crease, fl
vec4 EDIT_MESH_edge_color_inner(uint edge_flag)
{
vec4 color = colorWireEdit;
vec4 color_select = (selectEdges) ? colorEdgeSelect : mix(colorEdgeSelect, colorWireEdit, .45);
color = ((edge_flag & EDGE_SELECTED) != 0u) ? color_select : color;
vec4 selected_edge_col = (selectEdge) ? colorEdgeModeSelect : colorEdgeSelect;
color = ((edge_flag & EDGE_SELECTED) != 0u) ? selected_edge_col : color;
color = ((edge_flag & EDGE_ACTIVE) != 0u) ? colorEditMeshActive : color;
color.a = (selectEdges || (edge_flag & (EDGE_SELECTED | EDGE_ACTIVE)) != 0u) ? 1.0 : 0.7;
color.a = 1.0;
return color;
}
vec4 EDIT_MESH_edge_vertex_color(uint vertex_flag)
{
vec4 color = colorWireEdit;
vec4 color_select = (selectEdges) ? colorEdgeSelect : mix(colorEdgeSelect, colorWireEdit, .45);
/* Edge color in vextex selection mode. */
vec4 selected_edge_col = (selectEdge) ? colorEdgeModeSelect : colorEdgeSelect;
bool edge_selected = (vertex_flag & (VERT_ACTIVE | VERT_SELECTED)) != 0u;
color = (edge_selected) ? color_select : color;
color.a = (selectEdges || edge_selected) ? 1.0 : 0.7;
vec4 color = (edge_selected) ? selected_edge_col : colorWireEdit;
color.a = 1.0;
return color;
}
@ -55,15 +52,26 @@ vec4 EDIT_MESH_vertex_color(uint vertex_flag, float vertex_crease)
vec4 EDIT_MESH_face_color(uint face_flag)
{
bool face_freestyle = (face_flag & FACE_FREESTYLE) != 0u;
bool face_selected = (face_flag & FACE_SELECTED) != 0u;
bool face_active = (face_flag & FACE_ACTIVE) != 0u;
vec4 selected_face_col = (selectFace) ? colorFaceModeSelect : colorFaceSelect;
vec4 color = colorFace;
vec4 color_active = mix(colorFaceSelect, colorEditMeshActive, 0.5);
color = (retopologyOffset > 0.0) ? colorFaceRetopology : color;
color = ((face_flag & FACE_FREESTYLE) != 0u) ? colorFaceFreestyle : color;
color = ((face_flag & FACE_SELECTED) != 0u) ? colorFaceSelect : color;
color = ((face_flag & FACE_ACTIVE) != 0u) ? color_active : color;
color.a *= ((face_flag & (FACE_FREESTYLE | FACE_SELECTED | FACE_ACTIVE)) == 0u || selectFaces) ?
1.0 :
0.5;
color = face_freestyle ? colorFaceFreestyle : color;
color = face_selected ? selected_face_col : color;
if (selectFace && face_active) {
color = mix(selected_face_col, colorEditMeshActive, 0.5);
color.a = selected_face_col.a;
}
if (wireShading) {
/* Lower face selection opacity for better wireframe visibility. */
color.a = (face_selected) ? color.a * 0.6 : color.a;
}
else {
/* Don't always fill 'colorFace'. */
color.a = (selectFace || face_selected || face_active || face_freestyle) ? color.a : 0.0;
}
return color;
}

View File

@ -61,6 +61,7 @@ void DRW_globals_update()
UI_COLOR_RGBA_FROM_U8(0xB0, 0x00, 0xB0, 0xFF, gb->color_vertex_missing_data);
UI_GetThemeColor4fv(TH_EDITMESH_ACTIVE, gb->color_edit_mesh_active);
UI_GetThemeColor4fv(TH_EDGE_SELECT, gb->color_edge_select);
UI_GetThemeColor4fv(TH_EDGE_MODE_SELECT, gb->color_edge_mode_select);
UI_GetThemeColor4fv(TH_GP_VERTEX, gb->color_gpencil_vertex);
UI_GetThemeColor4fv(TH_GP_VERTEX_SELECT, gb->color_gpencil_vertex_select);
@ -71,6 +72,7 @@ void DRW_globals_update()
UI_GetThemeColor4fv(TH_EDGE_FACESEL, gb->color_edge_face_select);
UI_GetThemeColor4fv(TH_FACE, gb->color_face);
UI_GetThemeColor4fv(TH_FACE_SELECT, gb->color_face_select);
UI_GetThemeColor4fv(TH_FACE_MODE_SELECT, gb->color_face_mode_select);
UI_GetThemeColor4fv(TH_FACE_RETOPOLOGY, gb->color_face_retopology);
UI_GetThemeColor4fv(TH_FACE_BACK, gb->color_face_back);
UI_GetThemeColor4fv(TH_FACE_FRONT, gb->color_face_front);

View File

@ -40,7 +40,8 @@ struct GlobalsUboStorage {
float4 color_vertex_unreferenced;
float4 color_vertex_missing_data;
float4 color_edit_mesh_active;
float4 color_edge_select;
float4 color_edge_select; /* Stands for edge selection, not edge select mode. */
float4 color_edge_mode_select; /* Stands for edge mode selection. */
float4 color_edge_seam;
float4 color_edge_sharp;
float4 color_edge_crease;
@ -48,7 +49,8 @@ struct GlobalsUboStorage {
float4 color_edge_face_select;
float4 color_edge_freestyle;
float4 color_face;
float4 color_face_select;
float4 color_face_select; /* Stands for face selection, not face select mode. */
float4 color_face_mode_select; /* Stands for face mode selection. */
float4 color_face_retopology;
float4 color_face_freestyle;
float4 color_gpencil_vertex;
@ -160,6 +162,7 @@ BLI_STATIC_ASSERT_ALIGN(GlobalsUboStorage, 16)
# define colorVertexMissingData globalsBlock.color_vertex_missing_data
# define colorEditMeshActive globalsBlock.color_edit_mesh_active
# define colorEdgeSelect globalsBlock.color_edge_select
# define colorEdgeModeSelect globalsBlock.color_edge_mode_select
# define colorEdgeSeam globalsBlock.color_edge_seam
# define colorEdgeSharp globalsBlock.color_edge_sharp
# define colorEdgeCrease globalsBlock.color_edge_crease
@ -168,6 +171,7 @@ BLI_STATIC_ASSERT_ALIGN(GlobalsUboStorage, 16)
# define colorEdgeFreestyle globalsBlock.color_edge_freestyle
# define colorFace globalsBlock.color_face
# define colorFaceSelect globalsBlock.color_face_select
# define colorFaceModeSelect globalsBlock.color_face_mode_select
# define colorFaceRetopology globalsBlock.color_face_retopology
# define colorFaceFreestyle globalsBlock.color_face_freestyle
# define colorGpencilVertex globalsBlock.color_gpencil_vertex

View File

@ -52,6 +52,7 @@
#include "ED_asset_menu_utils.hh"
#include "ED_geometry.hh"
#include "ED_mesh.hh"
#include "ED_sculpt.hh"
#include "BLT_translation.h"
@ -163,10 +164,8 @@ static bke::GeometrySet get_original_geometry_eval_copy(Object &object)
}
}
static void store_result_geometry(Main &bmain,
Scene &scene,
Object &object,
bke::GeometrySet geometry)
static void store_result_geometry(
const wmOperator &op, Main &bmain, Scene &scene, Object &object, bke::GeometrySet geometry)
{
geometry.ensure_owns_direct_data();
switch (object.type) {
@ -204,24 +203,30 @@ static void store_result_geometry(Main &bmain,
}
case OB_MESH: {
Mesh &mesh = *static_cast<Mesh *>(object.data);
if (object.mode == OB_MODE_SCULPT) {
ED_sculpt_undo_geometry_begin(&object, &op);
}
Mesh *new_mesh = geometry.get_component_for_write<bke::MeshComponent>().release();
if (!new_mesh) {
BKE_mesh_clear_geometry(&mesh);
if (object.mode == OB_MODE_EDIT) {
EDBM_mesh_make(&object, scene.toolsettings->selectmode, true);
}
break;
}
else {
/* Anonymous attributes shouldn't be available on the applied geometry. */
new_mesh->attributes_for_write().remove_anonymous();
BKE_object_material_from_eval_data(&bmain, &object, &new_mesh->id);
BKE_mesh_nomain_to_mesh(new_mesh, &mesh, &object);
}
/* Anonymous attributes shouldn't be available on the applied geometry. */
new_mesh->attributes_for_write().remove_anonymous();
BKE_object_material_from_eval_data(&bmain, &object, &new_mesh->id);
BKE_mesh_nomain_to_mesh(new_mesh, &mesh, &object);
if (object.mode == OB_MODE_EDIT) {
EDBM_mesh_make(&object, scene.toolsettings->selectmode, true);
BKE_editmesh_looptri_and_normals_calc(mesh.edit_mesh);
}
else if (object.mode == OB_MODE_SCULPT) {
ED_sculpt_undo_geometry_end(&object);
}
break;
}
}
@ -351,7 +356,7 @@ static int run_node_group_exec(bContext *C, wmOperator *op)
user_data.log_socket_values = false;
});
store_result_geometry(*bmain, *scene, *object, std::move(new_geometry));
store_result_geometry(*op, *bmain, *scene, *object, std::move(new_geometry));
DEG_id_tag_update(static_cast<ID *>(object->data), ID_RECALC_GEOMETRY);
WM_event_add_notifier(C, NC_GEOM | ND_DATA, object->data);

View File

@ -92,11 +92,13 @@ enum ThemeColorID {
TH_OUTLINE_WIDTH,
TH_OBCENTER_DIA,
TH_EDGE,
TH_EDGE_SELECT,
TH_EDGE_SELECT, /* Stands for edge selection, not edge select mode. */
TH_EDGE_MODE_SELECT,
TH_EDGE_SEAM,
TH_EDGE_FACESEL,
TH_FACE,
TH_FACE_SELECT,
TH_FACE_SELECT, /* Stands for face selection, not face select mode. */
TH_FACE_MODE_SELECT,
TH_FACE_RETOPOLOGY,
TH_FACE_BACK,
TH_FACE_FRONT,

View File

@ -391,6 +391,9 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
case TH_EDGE_SELECT:
cp = ts->edge_select;
break;
case TH_EDGE_MODE_SELECT:
cp = ts->edge_mode_select;
break;
case TH_EDGE_SEAM:
cp = ts->edge_seam;
break;
@ -415,6 +418,9 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
case TH_FACE_SELECT:
cp = ts->face_select;
break;
case TH_FACE_MODE_SELECT:
cp = ts->face_mode_select;
break;
case TH_FACE_RETOPOLOGY:
cp = ts->face_retopology;
break;

View File

@ -108,15 +108,15 @@ static void process_prim_path(char *prim_path)
/* The absolute root "/" path indicates a no-op,
* so clear the string. */
if (prim_path[0] == '/' && strlen(prim_path) == 1) {
if (prim_path[0] == '/' && prim_path[1] == '\0') {
prim_path[0] = '\0';
}
/* If a prim path doesn't start with a "/" it
* is invalid when creating the prim. */
if (prim_path[0] != '/') {
auto new_path = "/" + std::string(prim_path);
snprintf(prim_path, FILE_MAX, "%s", new_path.c_str());
const std::string prim_path_copy = std::string(prim_path);
BLI_snprintf(prim_path, FILE_MAX, "/%s", prim_path_copy.c_str());
}
}

View File

@ -268,16 +268,13 @@ static void do_draw_face_sets_brush_bmesh(Object *ob, const Brush *brush, PBVHNo
continue;
}
bool is_face_fully_covered = true;
float3 face_center;
BM_face_calc_center_median(f, face_center);
const BMLoop *l_iter = f->l_first = BM_FACE_FIRST_LOOP(f);
do {
if (!sculpt_brush_test_sq_fn(&test, l_iter->v->co)) {
is_face_fully_covered = false;
break;
continue;
}
BMVert *vert = l_iter->v;
@ -304,17 +301,15 @@ static void do_draw_face_sets_brush_bmesh(Object *ob, const Brush *brush, PBVHNo
&automask_data);
if (fade <= FACE_SET_BRUSH_MIN_FADE) {
is_face_fully_covered = false;
break;
continue;
}
} while ((l_iter = l_iter->next) != f->l_first);
if (is_face_fully_covered) {
int &fset = *static_cast<int *>(POINTER_OFFSET(f->head.data, cd_offset));
fset = ss->cache->paint_face_set;
changed = true;
}
break;
} while ((l_iter = l_iter->next) != f->l_first);
}
if (changed) {
@ -400,12 +395,6 @@ void SCULPT_do_draw_face_sets_brush(Sculpt *sd, Object *ob, Span<PBVHNode *> nod
SculptSession *ss = ob->sculpt;
Brush *brush = BKE_paint_brush(&sd->paint);
if (ss->pbvh) {
Mesh *mesh = BKE_mesh_from_object(ob);
BKE_pbvh_face_sets_color_set(
ss->pbvh, mesh->face_sets_color_seed, mesh->face_sets_color_default);
}
BKE_curvemapping_init(brush->curve);
TaskParallelSettings settings;
@ -534,8 +523,6 @@ static int sculpt_face_set_create_exec(bContext *C, wmOperator *op)
if (all_visible) {
mesh->face_sets_color_default = next_face_set;
BKE_pbvh_face_sets_color_set(
ss->pbvh, mesh->face_sets_color_seed, mesh->face_sets_color_default);
}
for (int i = 0; i < tot_vert; i++) {
@ -1110,7 +1097,6 @@ static int sculpt_face_sets_randomize_colors_exec(bContext *C, wmOperator * /*op
max_ii(0, ss->totfaces - 1));
mesh->face_sets_color_default = ss->face_sets[random_index];
}
BKE_pbvh_face_sets_color_set(pbvh, mesh->face_sets_color_seed, mesh->face_sets_color_default);
Vector<PBVHNode *> nodes = blender::bke::pbvh::search_gather(pbvh, {});
for (PBVHNode *node : nodes) {

View File

@ -81,7 +81,7 @@ vec2 do_tria()
int vidx = gl_VertexID % 4;
bool tria2 = gl_VertexID > 7;
vec2 pos;
vec2 pos = vec2(0.0);
float size = (tria2) ? -tria2Size : tria1Size;
vec2 center = (tria2) ? tria2Center : tria1Center;

View File

@ -166,7 +166,7 @@ class VKCommandBuffers : public NonCopyable, NonMovable {
void ensure_no_compute_commands();
/**
* Ensire that no draw_commands are scheduled.
* Ensure that no draw_commands are scheduled.
*
* To ensure correct operation all draw commands should be flushed when adding a new compute
* command.

View File

@ -7,6 +7,7 @@
*/
#include <algorithm>
#include <cctype>
#include <cerrno>
#include <cstddef>
#include <cstdio>
@ -1450,10 +1451,13 @@ static int imb_exr_split_channel_name(ExrChannel *echan, char *layname, char *pa
echan->chan_id = BLI_toupper_ascii(name[0]);
layname[0] = '\0';
if (ELEM(name[0], 'R', 'G', 'B', 'A')) {
/* Notice that we are comparing with an upper-case version of the channel name, so the
* comparison is effectively not case sensitive, and would also consider lowercase versions of
* the listed channels. */
if (ELEM(echan->chan_id, 'R', 'G', 'B', 'A', 'V')) {
BLI_strncpy(passname, "Combined", passname_maxncpy);
}
else if (name[0] == 'Z') {
else if (echan->chan_id == 'Z') {
BLI_strncpy(passname, "Depth", passname_maxncpy);
}
else {
@ -1775,15 +1779,25 @@ static const char *exr_rgba_channelname(MultiPartInputFile &file, const char *ch
static int exr_has_rgb(MultiPartInputFile &file, const char *rgb_channels[3])
{
/* Common names for RGB-like channels in order. */
/* Common names for RGB-like channels in order. The V channel name is used by convention for BW
* images, which will be broadcast to RGB channel at the end. */
static const char *channel_names[] = {
"R", "Red", "G", "Green", "B", "Blue", "AR", "RA", "AG", "GA", "AB", "BA", nullptr};
"V", "R", "Red", "G", "Green", "B", "Blue", "AR", "RA", "AG", "GA", "AB", "BA", nullptr};
const Header &header = file.header(0);
int num_channels = 0;
for (int i = 0; channel_names[i]; i++) {
if (header.channels().findChannel(channel_names[i])) {
/* Also try to match lower case variant of of the channel names. */
std::string lower_case_name = std::string(channel_names[i]);
std::transform(lower_case_name.begin(),
lower_case_name.end(),
lower_case_name.begin(),
[](unsigned char c) { return std::tolower(c); });
if (header.channels().findChannel(channel_names[i]) ||
header.channels().findChannel(lower_case_name))
{
rgb_channels[num_channels++] = channel_names[i];
if (num_channels == 3) {
break;

View File

@ -287,10 +287,11 @@ typedef struct ThemeSpace {
unsigned char active[4], group[4], group_active[4], transform[4];
unsigned char vertex[4], vertex_select[4], vertex_active[4], vertex_bevel[4],
vertex_unreferenced[4];
unsigned char edge[4], edge_select[4];
unsigned char edge[4], edge_select[4], edge_mode_select[4];
unsigned char edge_seam[4], edge_sharp[4], edge_facesel[4], edge_crease[4], edge_bevel[4];
/** Solid faces. */
unsigned char face[4], face_select[4], face_retopology[4], face_back[4], face_front[4];
unsigned char face[4], face_select[4], face_mode_select[4], face_retopology[4];
unsigned char face_back[4], face_front[4];
/** Selected color. */
unsigned char face_dot[4];
unsigned char extra_edge_len[4], extra_edge_angle[4], extra_face_angle[4], extra_face_area[4];
@ -350,7 +351,6 @@ typedef struct ThemeSpace {
unsigned char node_zone_simulation[4];
unsigned char node_zone_repeat[4];
unsigned char _pad9[4];
unsigned char simulated_frames[4];
/** For sequence editor. */
@ -378,7 +378,7 @@ typedef struct ThemeSpace {
unsigned char path_keyframe_before[4], path_keyframe_after[4];
unsigned char camera_path[4];
unsigned char camera_passepartout[4];
unsigned char _pad1[6];
unsigned char _pad1[2];
unsigned char gp_vertex_size;
unsigned char gp_vertex[4], gp_vertex_select[4];

View File

@ -56,8 +56,8 @@
\
.edit_flag = V3D_OVERLAY_EDIT_FACES | V3D_OVERLAY_EDIT_SEAMS | \
V3D_OVERLAY_EDIT_SHARP | V3D_OVERLAY_EDIT_FREESTYLE_EDGE | \
V3D_OVERLAY_EDIT_FREESTYLE_FACE | V3D_OVERLAY_EDIT_EDGES | \
V3D_OVERLAY_EDIT_CREASES | V3D_OVERLAY_EDIT_BWEIGHTS, \
V3D_OVERLAY_EDIT_FREESTYLE_FACE | V3D_OVERLAY_EDIT_CREASES | \
V3D_OVERLAY_EDIT_BWEIGHTS, \
.handle_display = CURVE_HANDLE_SELECTED, \
\
.gpencil_paper_opacity = 0.5f, \

View File

@ -587,7 +587,7 @@ enum {
V3D_OVERLAY_EDIT_WEIGHT = (1 << 4),
V3D_OVERLAY_EDIT_EDGES = (1 << 5),
V3D_OVERLAY_EDIT_EDGES_DEPRECATED = (1 << 5),
V3D_OVERLAY_EDIT_FACES = (1 << 6),
V3D_OVERLAY_EDIT_FACE_DOT = (1 << 7),

View File

@ -935,19 +935,6 @@ static void rna_Sequence_audio_update(Main * /*bmain*/, Scene * /*scene*/, Point
DEG_id_tag_update(ptr->owner_id, ID_RECALC_SEQUENCER_STRIPS | ID_RECALC_AUDIO);
}
static void rna_Sequence_speed_factor_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
SEQ_cache_cleanup(scene);
rna_Sequence_audio_update(bmain, scene, ptr);
}
static void rna_Sequence_speed_factor_set(PointerRNA *ptr, float value)
{
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->owner_id;
SEQ_time_speed_factor_set(scene, seq, value);
}
static void rna_Sequence_pan_range(
PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
@ -2554,19 +2541,6 @@ static void rna_def_editor(BlenderRNA *brna)
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
}
static void rna_def_speed_factor(StructRNA *srna)
{
PropertyRNA *prop = RNA_def_property(srna, "speed_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, nullptr, "speed_factor");
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_range(prop, 0.1f, FLT_MAX);
RNA_def_property_ui_range(prop, 1.0f, 100.0f, 10.0, 3);
RNA_def_property_ui_text(prop, "Speed Factor", "Multiply playback speed");
RNA_def_property_float_funcs(
prop, nullptr, "rna_Sequence_speed_factor_set", nullptr); /* overlap test */
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_speed_factor_update");
}
static void rna_def_filter_video(StructRNA *srna)
{
PropertyRNA *prop;
@ -3071,7 +3045,6 @@ static void rna_def_sound(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, nullptr);
rna_def_input(srna);
rna_def_speed_factor(srna);
}
static void rna_def_effect(BlenderRNA *brna)

View File

@ -4610,11 +4610,6 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna)
prop, "Display Split Normals", "Display vertex-per-face normals as lines");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, nullptr);
prop = RNA_def_property(srna, "show_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_EDGES);
RNA_def_property_ui_text(prop, "Display Edges", "Highlight selected edges");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, nullptr);
prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACES);
RNA_def_property_ui_text(prop, "Display Faces", "Highlight selected faces");

View File

@ -2132,7 +2132,12 @@ static void rna_def_userdef_theme_spaces_edge(StructRNA *srna)
prop = RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Edge Select", "");
RNA_def_property_ui_text(prop, "Edge Selection", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "edge_mode_select", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Edge Mode Selection", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "edge_seam", PROP_FLOAT, PROP_COLOR_GAMMA);
@ -2178,7 +2183,12 @@ static void rna_def_userdef_theme_spaces_face(StructRNA *srna)
prop = RNA_def_property(srna, "face_select", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Face Selected", "");
RNA_def_property_ui_text(prop, "Face Selection", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "face_mode_select", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Face Mode Selection", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "face_dot", PROP_FLOAT, PROP_COLOR_GAMMA);

View File

@ -31,8 +31,8 @@ class GeoModifierLog;
namespace blender::nodes {
void find_node_tree_dependencies(const bNodeTree &tree,
Set<ID *> &r_ids,
bool &r_needs_own_transform_relation);
Set<ID *> &r_ids,
bool &r_needs_own_transform_relation);
StringRef input_use_attribute_suffix();
StringRef input_attribute_name_suffix();

View File

@ -60,7 +60,10 @@ class RotateOperation : public NodeOperation {
const math::AngleRadian rotation = get_input("Degr").get_float_value_default(0.0f);
const float3x3 transformation = math::from_rotation<float3x3>(rotation);
transform(context(), input, output, transformation, get_interpolation());
RealizationOptions realization_options = input.get_realization_options();
realization_options.interpolation = get_interpolation();
transform(context(), input, output, transformation, realization_options);
}
Interpolation get_interpolation()

View File

@ -93,8 +93,7 @@ class ScaleOperation : public NodeOperation {
const float3x3 transformation = math::from_loc_rot_scale<float3x3>(
translation, rotation, scale);
const Interpolation interpolation = input.get_realization_options().interpolation;
transform(context(), input, output, transformation, interpolation);
transform(context(), input, output, transformation, input.get_realization_options());
}
float2 get_scale()

View File

@ -108,7 +108,10 @@ class Stabilize2DOperation : public NodeOperation {
transformation = math::invert(transformation);
}
transform(context(), input, output, transformation, get_interpolation());
RealizationOptions realization_options = input.get_realization_options();
realization_options.interpolation = get_interpolation();
transform(context(), input, output, transformation, realization_options);
}
Interpolation get_interpolation()

View File

@ -75,7 +75,10 @@ class TransformOperation : public NodeOperation {
const float3x3 transformation = math::from_loc_rot_scale<float3x3>(
translation, rotation, scale);
transform(context(), input, output, transformation, get_interpolation());
RealizationOptions realization_options = input.get_realization_options();
realization_options.interpolation = get_interpolation();
transform(context(), input, output, transformation, realization_options);
}
Interpolation get_interpolation()

View File

@ -11,6 +11,7 @@
#include "UI_interface.hh"
#include "UI_resources.hh"
#include "COM_algorithm_transform.hh"
#include "COM_node_operation.hh"
#include "node_composite_util.hh"
@ -73,9 +74,11 @@ class TranslateOperation : public NodeOperation {
const float2 translation = float2(x, y);
const float3x3 transformation = math::from_location<float3x3>(translation);
result.transform(transformation);
result.get_realization_options().repeat_x = get_repeat_x();
result.get_realization_options().repeat_y = get_repeat_y();
RealizationOptions realization_options = input.get_realization_options();
realization_options.wrap_x = get_wrap_x();
realization_options.wrap_y = get_wrap_y();
transform(context(), input, result, transformation, realization_options);
}
bool get_use_relative()
@ -83,12 +86,12 @@ class TranslateOperation : public NodeOperation {
return node_storage(bnode()).relative;
}
bool get_repeat_x()
bool get_wrap_x()
{
return ELEM(node_storage(bnode()).wrap_axis, CMP_NODE_WRAP_X, CMP_NODE_WRAP_XY);
}
bool get_repeat_y()
bool get_wrap_y()
{
return ELEM(node_storage(bnode()).wrap_axis, CMP_NODE_WRAP_Y, CMP_NODE_WRAP_XY);
}

View File

@ -257,9 +257,7 @@ class IndexOnSplineFieldInput final : public bke::CurvesFieldInput {
threading::parallel_for(curves.curves_range(), 1024, [&](IndexRange range) {
for (const int i_curve : range) {
MutableSpan<int> indices = result.as_mutable_span().slice(points_by_curve[i_curve]);
for (const int i : indices.index_range()) {
indices[i] = i;
}
array_utils::fill_index_range(indices);
}
});
return VArray<int>::ForContainer(std::move(result));

View File

@ -125,8 +125,8 @@ static void process_nodes_for_depsgraph(const bNodeTree &tree,
}
void find_node_tree_dependencies(const bNodeTree &tree,
Set<ID *> &r_ids,
bool &r_needs_own_transform_relation)
Set<ID *> &r_ids,
bool &r_needs_own_transform_relation)
{
Set<const bNodeTree *> checked_groups;
process_nodes_for_depsgraph(tree, r_ids, r_needs_own_transform_relation, checked_groups);

View File

@ -45,7 +45,8 @@ NODE_SHADER_MATERIALX_BEGIN
NodeItem combine = create_node(
"combine3", NodeItem::Type::Vector3, {{"in1", hue}, {"in2", saturation}, {"in3", value}});
NodeItem hsv = create_node("hsvadjust", NodeItem::Type::Color3, {{"in", color}, {"amount", combine}});
NodeItem hsv = create_node(
"hsvadjust", NodeItem::Type::Color3, {{"in", color}, {"amount", combine}});
return fac.mix(color, hsv);
}

View File

@ -114,13 +114,6 @@ void SEQ_time_right_handle_frame_set(const struct Scene *scene,
* This can change depending on scene FPS or strip speed factor.
*/
int SEQ_time_strip_length_get(const struct Scene *scene, const struct Sequence *seq);
/**
* Set strip playback speed.
* Strip length is affected by changing speed factor.
*/
void SEQ_time_speed_factor_set(const struct Scene *scene,
struct Sequence *seq,
const float speed_factor);
/**
* Get timeline frame where strip content starts.
*/

View File

@ -463,27 +463,6 @@ bool SEQ_time_strip_intersects_frame(const Scene *scene,
(SEQ_time_right_handle_frame_get(scene, seq) > timeline_frame);
}
void SEQ_time_speed_factor_set(const Scene *scene, Sequence *seq, const float speed_factor)
{
if (seq->type == SEQ_TYPE_SOUND_RAM) {
seq->speed_factor = speed_factor;
}
else {
const float left_handle_frame = SEQ_time_left_handle_frame_get(scene, seq);
const float unity_start_offset = seq->startofs * seq->speed_factor;
const float unity_end_offset = seq->endofs * seq->speed_factor;
/* Left handle is pivot point for content scaling - it must always show same frame. */
seq->speed_factor = speed_factor;
seq->startofs = unity_start_offset / speed_factor;
seq->start = left_handle_frame - seq->startofs;
seq->endofs = unity_end_offset / speed_factor;
}
SEQ_time_update_meta_strip_range(scene, seq_sequence_lookup_meta_by_seq(scene, seq));
seq_time_update_effects_strip_range(scene, seq_sequence_lookup_effects_by_seq(scene, seq));
}
bool SEQ_time_has_left_still_frames(const Scene *scene, const Sequence *seq)
{
return SEQ_time_left_handle_frame_get(scene, seq) < SEQ_time_start_frame_get(seq);

View File

@ -92,6 +92,9 @@ def canonical_author_map() -> Dict[str, str]:
"Aras Pranckevicius <aras@nesnausk.org>": (
"Aras Pranckevicius <aras_p>",
),
"Arye Ramaty <aryeramaty@gmail.com>": (
"Arye Ramaty <BelgaratTheGrey>",
),
"Bastien Montagne <bastien@blender.org>": (
"Bastien Montagne (@mont29) <>",
"Bastien Montagne <b.mont29@gmail.com>",
@ -307,6 +310,9 @@ def canonical_author_map() -> Dict[str, str]:
"Ish Bosamiya <ishbosamiya>",
"Ish Bosamiya <ishbosamiya@gmail.com>",
),
"Ivan Kosarev <mail@ivankosarev.com>": (
"kosarev <kosarev@noreply.localhost>",
),
"Iyad Ahmed <iyadahmed430@gmail.com>": (
"Iyad Ahmed <iyadahmed2001>",
),