Fix #106430: Index the right UVmap in BMesh #106537
|
@ -24,9 +24,7 @@ BMUVOffsets BM_uv_map_get_offsets_n(const BMesh *bm, int layer)
|
||||||
{
|
{
|
||||||
using namespace blender;
|
using namespace blender;
|
||||||
using namespace blender::bke;
|
using namespace blender::bke;
|
||||||
const int layer_index = layer == -1 ?
|
const int layer_index = CustomData_get_layer_index_n(&bm->ldata, CD_PROP_FLOAT2, layer);
|
||||||
HooglyBoogly marked this conversation as resolved
Outdated
|
|||||||
CustomData_get_active_layer_index(&bm->ldata, CD_PROP_FLOAT2) :
|
|
||||||
CustomData_get_layer_index_n(&bm->ldata, CD_PROP_FLOAT2, layer);
|
|
||||||
if (layer_index == -1) {
|
if (layer_index == -1) {
|
||||||
return {-1, -1, -1, -1};
|
return {-1, -1, -1, -1};
|
||||||
}
|
}
|
||||||
|
@ -48,7 +46,7 @@ BMUVOffsets BM_uv_map_get_offsets_n(const BMesh *bm, int layer)
|
||||||
|
|
||||||
BMUVOffsets BM_uv_map_get_offsets(const BMesh *bm)
|
BMUVOffsets BM_uv_map_get_offsets(const BMesh *bm)
|
||||||
{
|
{
|
||||||
return BM_uv_map_get_offsets_n(bm, -1);
|
return BM_uv_map_get_offsets_n(bm, CustomData_get_active_layer_index(&bm->ldata, CD_PROP_FLOAT2));
|
||||||
HooglyBoogly marked this conversation as resolved
Outdated
Hans Goudey
commented
Missing clang format here (line is 101 characters long) Missing clang format here (line is 101 characters long)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void uv_aspect(const BMLoop *l,
|
static void uv_aspect(const BMLoop *l,
|
||||||
|
|
Loading…
Reference in New Issue
It might be simper/clearer if
BM_uv_map_get_offsets
calledCustomData_get_active_layer_index
directly. ThenBM_uv_map_get_offsets_n
wouldn't have to have a special case for -1.