diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake index 23e1f5385d2..47f4bc1a1ee 100644 --- a/build_files/build_environment/cmake/versions.cmake +++ b/build_files/build_environment/cmake/versions.cmake @@ -219,9 +219,9 @@ set(TIFF_HOMEPAGE http://www.simplesystems.org/libtiff/) # Recent commit from 1.13.5.0 under development, which includes string table # changes that make the Cycles OptiX implementation work. Official 1.12 OSL # releases should also build but without OptiX support. -set(OSL_VERSION 3d52f3906b12d38ad0f4b991a8f9ea678171bd28) -set(OSL_URI https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/archive/${OSL_VERSION}.tar.gz) -set(OSL_HASH dfe5d69f48930badc1ad39a4e11e2e98) +set(OSL_VERSION 1.13.7.0) +set(OSL_URI https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/archive/refs/tags/v${OSL_VERSION}.tar.gz) +set(OSL_HASH 769ae444a7df0e6561b3e745fd2eb50d) set(OSL_HASH_TYPE MD5) set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz) @@ -529,9 +529,9 @@ set(MATERIALX_HASH fad8f4e19305fb2ee920cbff638f3560) set(MATERIALX_HASH_TYPE MD5) set(MATERIALX_FILE materialx-v${MATERIALX_VERSION}.tar.gz) -set(OIDN_VERSION 2.2.0-rc2) +set(OIDN_VERSION 2.2.1) set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.tar.gz) -set(OIDN_HASH 14b261af3a719c49ab10e71583f1a61a) +set(OIDN_HASH a1c5299b2b640a0e0569afcf405c82bf) set(OIDN_HASH_TYPE MD5) set(OIDN_FILE oidn-${OIDN_VERSION}.src.tar.gz) diff --git a/source/blender/blenkernel/intern/attribute.cc b/source/blender/blenkernel/intern/attribute.cc index 78bd04e6f30..ffe2d40f0f9 100644 --- a/source/blender/blenkernel/intern/attribute.cc +++ b/source/blender/blenkernel/intern/attribute.cc @@ -165,6 +165,36 @@ static bool bke_id_attribute_rename_if_exists(ID *id, return BKE_id_attribute_rename(id, old_name, new_name, reports); } +static bool mesh_edit_mode_attribute_valid(const blender::StringRef name, + const AttrDomain domain, + const eCustomDataType data_type, + ReportList *reports) +{ + if (ELEM(name, + "position", + ".edge_verts", + ".corner_vert", + ".corner_edge", + "sharp_edge", + "sharp_face", + "material_index")) + { + BKE_report(reports, RPT_ERROR, "Unable to create builtin attribute in edit mode"); + return false; + } + if (name == "id") { + if (domain != AttrDomain::Point) { + BKE_report(reports, RPT_ERROR, "Domain unsupported for \"id\" attribute"); + return false; + } + if (data_type != CD_PROP_INT32) { + BKE_report(reports, RPT_ERROR, "Type unsupported for \"id\" attribute"); + return false; + } + } + return true; +} + bool BKE_id_attribute_rename(ID *id, const char *old_name, const char *new_name, @@ -200,6 +230,17 @@ bool BKE_id_attribute_rename(ID *id, return false; } + if (GS(id->name) == ID_ME) { + Mesh *mesh = reinterpret_cast(id); + if (mesh->edit_mesh) { + if (!mesh_edit_mode_attribute_valid( + new_name, BKE_id_attribute_domain(id, layer), eCustomDataType(layer->type), reports)) + { + return false; + } + } + } + std::string result_name = BKE_id_attribute_calc_unique_name(*id, new_name); if (layer->type == CD_PROP_FLOAT2 && GS(id->name) == ID_ME) { @@ -286,6 +327,9 @@ CustomDataLayer *BKE_id_attribute_new(ID *id, if (GS(id->name) == ID_ME) { Mesh *mesh = reinterpret_cast(id); if (BMEditMesh *em = mesh->edit_mesh) { + if (!mesh_edit_mode_attribute_valid(name, domain, type, reports)) { + return nullptr; + } BM_data_layer_add_named(em->bm, customdata, type, uniquename.c_str()); const int index = CustomData_get_named_layer_index(customdata, type, uniquename); return (index == -1) ? nullptr : &(customdata->layers[index]); diff --git a/source/blender/bmesh/intern/bmesh_mesh_convert.cc b/source/blender/bmesh/intern/bmesh_mesh_convert.cc index fd9bd4d0e13..a199a0b0975 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_convert.cc +++ b/source/blender/bmesh/intern/bmesh_mesh_convert.cc @@ -1257,6 +1257,7 @@ static void bm_to_mesh_verts(const BMesh &bm, MutableSpan select_vert, MutableSpan hide_vert) { + CustomData_free_layer_named(&mesh.vert_data, "position", mesh.verts_num); CustomData_add_layer_named( &mesh.vert_data, CD_PROP_FLOAT3, CD_CONSTRUCT, mesh.verts_num, "position"); const Vector info = bm_to_mesh_copy_info_calc(bm.vdata, mesh.vert_data); @@ -1299,6 +1300,7 @@ static void bm_to_mesh_edges(const BMesh &bm, MutableSpan sharp_edge, MutableSpan uv_seams) { + CustomData_free_layer_named(&mesh.edge_data, ".edge_verts", mesh.edges_num); CustomData_add_layer_named( &mesh.edge_data, CD_PROP_INT32_2D, CD_CONSTRUCT, mesh.edges_num, ".edge_verts"); const Vector info = bm_to_mesh_copy_info_calc(bm.edata, mesh.edge_data); @@ -1385,10 +1387,12 @@ static void bm_to_mesh_faces(const BMesh &bm, static void bm_to_mesh_loops(const BMesh &bm, const Span bm_loops, Mesh &mesh) { + CustomData_free_layer_named(&mesh.corner_data, ".corner_vert", mesh.corners_num); + CustomData_free_layer_named(&mesh.corner_data, ".corner_edge", mesh.corners_num); CustomData_add_layer_named( - &mesh.corner_data, CD_PROP_INT32, CD_CONSTRUCT, bm.totloop, ".corner_vert"); + &mesh.corner_data, CD_PROP_INT32, CD_CONSTRUCT, mesh.corners_num, ".corner_vert"); CustomData_add_layer_named( - &mesh.corner_data, CD_PROP_INT32, CD_CONSTRUCT, bm.totloop, ".corner_edge"); + &mesh.corner_data, CD_PROP_INT32, CD_CONSTRUCT, mesh.corners_num, ".corner_edge"); const Vector info = bm_to_mesh_copy_info_calc(bm.ldata, mesh.corner_data); MutableSpan dst_corner_verts = mesh.corner_verts_for_write(); MutableSpan dst_corner_edges = mesh.corner_edges_for_write(); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc index 715bc7972b5..9cd56d411eb 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc @@ -40,8 +40,10 @@ static void sh_node_tex_noise_declare(NodeDeclarationBuilder &b) .max(1000.0f) .default_value(2.0f) .description("The scale of a Perlin noise octave relative to that of the previous octave"); - b.add_input("Offset").min(-1000.0f).max(1000.0f).default_value(0.0f); - b.add_input("Gain").min(0.0f).max(1000.0f).default_value(1.0f); + b.add_input("Offset").min(-1000.0f).max(1000.0f).default_value(0.0f).make_available( + [](bNode &node) { node_storage(node).type = SHD_NOISE_RIDGED_MULTIFRACTAL; }); + b.add_input("Gain").min(0.0f).max(1000.0f).default_value(1.0f).make_available( + [](bNode &node) { node_storage(node).type = SHD_NOISE_RIDGED_MULTIFRACTAL; }); b.add_input("Distortion").min(-1000.0f).max(1000.0f).default_value(0.0f); b.add_output("Fac").no_muted_links(); b.add_output("Color").no_muted_links();