Skip to content

Commit a586a9c

Browse files
committed
Merge remote-tracking branch 'b/main'
2 parents e1bea50 + acd3368 commit a586a9c

File tree

114 files changed

+2035
-2198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2035
-2198
lines changed

intern/cycles/kernel/closure/bsdf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ ccl_device_inline int bsdf_sample(KernelGlobals kg,
275275
}
276276
}
277277
}
278-
else {
278+
else if (label != LABEL_NONE) {
279279
/* Shadow terminator offset. */
280280
const float frequency_multiplier =
281281
kernel_data_fetch(objects, sd->object).shadow_terminator_shading_offset;

source/blender/blenkernel/BKE_attribute.h

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,6 @@ bool BKE_attribute_remove(AttributeOwner &owner,
9696
blender::StringRef name,
9797
struct ReportList *reports);
9898

99-
/**
100-
* Creates a duplicate attribute layer.
101-
*/
102-
struct CustomDataLayer *BKE_attribute_duplicate(AttributeOwner &owner,
103-
blender::StringRef name,
104-
struct ReportList *reports);
105-
10699
const struct CustomDataLayer *BKE_attribute_search(const AttributeOwner &owner,
107100
blender::StringRef name,
108101
eCustomDataMask type,
@@ -134,14 +127,14 @@ int *BKE_attributes_active_index_p(AttributeOwner &owner);
134127

135128
CustomData *BKE_attributes_iterator_next_domain(AttributeOwner &owner,
136129
struct CustomDataLayer *layers);
137-
CustomDataLayer *BKE_attribute_from_index(AttributeOwner &owner,
138-
int lookup_index,
139-
AttrDomainMask domain_mask,
140-
eCustomDataMask layer_mask);
130+
std::optional<blender::StringRef> BKE_attribute_from_index(AttributeOwner &owner,
131+
int lookup_index,
132+
AttrDomainMask domain_mask,
133+
eCustomDataMask layer_mask);
141134

142135
/** Layer is allowed to be nullptr; if so -1 (layer not found) will be returned. */
143136
int BKE_attribute_to_index(const AttributeOwner &owner,
144-
const CustomDataLayer *layer,
137+
const blender::StringRef name,
145138
AttrDomainMask domain_mask,
146139
eCustomDataMask layer_mask);
147140

@@ -151,9 +144,7 @@ void BKE_id_attributes_active_color_set(struct ID *id, std::optional<blender::St
151144
void BKE_id_attributes_active_color_clear(struct ID *id);
152145
void BKE_id_attributes_default_color_set(struct ID *id, std::optional<blender::StringRef> name);
153146

154-
const struct CustomDataLayer *BKE_id_attributes_color_find(const struct ID *id,
155-
blender::StringRef name);
156-
bool BKE_color_attribute_supported(const struct Mesh &mesh, blender::StringRef name);
147+
bool BKE_id_attributes_color_find(const struct ID *id, blender::StringRef name);
157148

158149
std::string BKE_attribute_calc_unique_name(const AttributeOwner &owner, blender::StringRef name);
159150

source/blender/blenkernel/BKE_attribute_legacy_convert.hh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,17 @@ void pointcloud_convert_customdata_to_storage(PointCloud &pointcloud);
5757
/** See #mesh_convert_customdata_to_storage. */
5858
void grease_pencil_convert_customdata_to_storage(GreasePencil &grease_pencil);
5959

60+
/** Abstraction for copying #CustomData layers and #AttributeStorage attributes. */
61+
class LegacyMeshInterpolator {
62+
63+
const CustomData &cd_src_;
64+
CustomData &cd_dst_;
65+
66+
public:
67+
LegacyMeshInterpolator(const Mesh &src, Mesh &dst, AttrDomain domain);
68+
69+
void copy(int src_index, int dst_index, int count) const;
70+
void mix(Span<int> src_indices, std::optional<Span<float>> weights, int dst_index) const;
71+
};
72+
6073
} // namespace blender::bke

source/blender/blenkernel/BKE_context.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ const char *CTX_wm_operator_poll_msg_get(bContext *C, bool *r_free);
256256
*
257257
* \note even though the function name suggests this is limited to situations
258258
* when the poll function returns false, this is not the case. Even when the
259-
* operator is disabled because it is added to a disabled uiLayout, this message
259+
* operator is disabled because it is added to a disabled blender::ui::Layout, this message
260260
* will show.
261261
*/
262262
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg);

source/blender/blenkernel/BKE_mesh.hh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,12 @@ bool mesh_is_valid(const Mesh &mesh, bool verbose = true);
473473
*/
474474
bool mesh_validate_material_indices(Mesh &mesh);
475475

476+
/**
477+
* Check whether faces contain duplicate vertex indices.
478+
* \return a mask of all invalid faces.
479+
*/
480+
IndexMask mesh_find_faces_duplicate_verts(const Mesh &mesh, IndexMaskMemory &memory);
481+
476482
void mesh_apply_spatial_organization(Mesh &mesh);
477483
const AttributeAccessorFunctions &mesh_attribute_accessor_functions();
478484

source/blender/blenkernel/BKE_node.hh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ struct bNodeSocket;
5353
struct bNodeStack;
5454
struct bNodeTree;
5555
struct bNodeTreeExec;
56-
struct uiLayout;
5756

5857
namespace blender {
5958
class CPPType;
@@ -78,6 +77,10 @@ namespace compositor {
7877
class Context;
7978
class NodeOperation;
8079
} // namespace compositor
80+
81+
namespace ui {
82+
struct Layout;
83+
} // namespace ui
8184
} // namespace blender
8285

8386
namespace blender::bke {
@@ -164,7 +167,7 @@ struct bNodeSocketType {
164167
std::string subtype_label;
165168

166169
void (*draw)(bContext *C,
167-
uiLayout *layout,
170+
ui::Layout *layout,
168171
PointerRNA *ptr,
169172
PointerRNA *node_ptr,
170173
StringRef text) = nullptr;
@@ -174,7 +177,7 @@ struct bNodeSocketType {
174177
void (*interface_draw)(ID *id,
175178
bNodeTreeInterfaceSocket *socket,
176179
bContext *C,
177-
uiLayout *layout) = nullptr;
180+
ui::Layout *layout) = nullptr;
178181
void (*interface_init_socket)(ID *id,
179182
const bNodeTreeInterfaceSocket *interface_socket,
180183
bNode *node,
@@ -256,9 +259,9 @@ struct bNodeType {
256259
std::string storagename; /* struct name for DNA */
257260

258261
/* Draw the option buttons on the node */
259-
void (*draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr) = nullptr;
262+
void (*draw_buttons)(ui::Layout *, bContext *C, PointerRNA *ptr) = nullptr;
260263
/* Additional parameters in the side panel */
261-
void (*draw_buttons_ex)(uiLayout *, bContext *C, PointerRNA *ptr) = nullptr;
264+
void (*draw_buttons_ex)(ui::Layout *, bContext *C, PointerRNA *ptr) = nullptr;
262265

263266
/* Additional drawing on backdrop */
264267
void (*draw_backdrop)(SpaceNode *snode, ImBuf *backdrop, bNode *node, int x, int y) = nullptr;

source/blender/blenkernel/BKE_screen.hh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ namespace blender::asset_system {
3131
class AssetRepresentation;
3232
}
3333

34+
namespace blender::ui {
35+
struct Layout;
36+
} // namespace blender::ui
37+
3438
struct ARegion;
3539
struct AssetShelfType;
3640
struct BlendDataReader;
@@ -55,7 +59,6 @@ struct WorkSpace;
5559
struct bContext;
5660
struct bScreen;
5761
struct uiBlock;
58-
struct uiLayout;
5962
struct uiList;
6063
struct wmDrawBuffer;
6164
struct wmGizmoMap;
@@ -410,8 +413,8 @@ struct LayoutPanelBody {
410413
};
411414

412415
/**
413-
* "Layout Panels" are panels which are defined as part of the #uiLayout. As such they have a
414-
* specific place in the layout and can not be freely dragged around like top level panels.
416+
* "Layout Panels" are panels which are defined as part of the #blender::ui::Layout. As such they
417+
* have a specific place in the layout and can not be freely dragged around like top level panels.
415418
*
416419
* This struct gathers information about the layout panels created by layout code. This is then
417420
* used for example drawing the backdrop of nested panels and to support opening and closing
@@ -523,7 +526,7 @@ struct ARegionRuntime {
523526
/** Draw an item in the `ui_list`. */
524527
using uiListDrawItemFunc = void (*)(uiList *ui_list,
525528
const bContext *C,
526-
uiLayout *layout,
529+
blender::ui::Layout *layout,
527530
PointerRNA *dataptr,
528531
PointerRNA *itemptr,
529532
int icon,
@@ -533,7 +536,9 @@ using uiListDrawItemFunc = void (*)(uiList *ui_list,
533536
int flt_flag);
534537

535538
/** Draw the filtering part of an uiList. */
536-
using uiListDrawFilterFunc = void (*)(uiList *ui_list, const bContext *C, uiLayout *layout);
539+
using uiListDrawFilterFunc = void (*)(uiList *ui_list,
540+
const bContext *C,
541+
blender::ui::Layout *layout);
537542

538543
/** Filter items of an uiList. */
539544
using uiListFilterItemsFunc = void (*)(uiList *ui_list,
@@ -582,7 +587,7 @@ struct Header {
582587
/** Runtime. */
583588
HeaderType *type;
584589
/** Runtime for drawing. */
585-
uiLayout *layout;
590+
blender::ui::Layout *layout;
586591
};
587592

588593
/* Menu types. */
@@ -628,7 +633,7 @@ struct Menu {
628633
/** Runtime. */
629634
MenuType *type;
630635
/** Runtime for drawing. */
631-
uiLayout *layout;
636+
blender::ui::Layout *layout;
632637
};
633638

634639
/* Asset shelf types. */
@@ -682,7 +687,7 @@ struct AssetShelfType {
682687
void (*draw_context_menu)(const bContext *C,
683688
const AssetShelfType *shelf_type,
684689
const blender::asset_system::AssetRepresentation *asset,
685-
uiLayout *layout);
690+
blender::ui::Layout *layout);
686691

687692
const AssetWeakReference *(*get_active_asset)(const AssetShelfType *shelf_type);
688693

0 commit comments

Comments
 (0)