[Bf-blender-cvs] [68c3c1e519a] refactor-mesh-uv-map-generic: Merge branch 'master' into refactor-mesh-uv-map-generic

Hans Goudey noreply at git.blender.org
Fri Aug 26 04:34:49 CEST 2022


Commit: 68c3c1e519a5d908bd866b5bb000697b31f5cbf8
Author: Hans Goudey
Date:   Wed Aug 17 18:14:01 2022 -0400
Branches: refactor-mesh-uv-map-generic
https://developer.blender.org/rB68c3c1e519a5d908bd866b5bb000697b31f5cbf8

Merge branch 'master' into refactor-mesh-uv-map-generic

===================================================================



===================================================================

diff --cc source/blender/blenkernel/intern/subdiv_mesh.cc
index 3320d84ca74,d914318b8a5..7960d3677b3
--- a/source/blender/blenkernel/intern/subdiv_mesh.cc
+++ b/source/blender/blenkernel/intern/subdiv_mesh.cc
@@@ -11,8 -11,8 +11,9 @@@
  #include "DNA_mesh_types.h"
  #include "DNA_meshdata_types.h"
  
- #include "BLI_alloca.h"
+ #include "BLI_array.hh"
  #include "BLI_bitmap.h"
++#include "BLI_math_vec_types.hh"
  #include "BLI_math_vector.h"
  
  #include "BKE_customdata.h"
@@@ -25,6 -25,6 +26,8 @@@
  
  #include "MEM_guardedalloc.h"
  
++using blender::float2;
++
  /* -------------------------------------------------------------------- */
  /** \name Subdivision Context
   * \{ */
@@@ -42,8 -41,7 +44,8 @@@ struct SubdivMeshContext 
    int *poly_origindex;
    /* UV layers interpolation. */
    int num_uv_layers;
-   uvtype *uv_layers[MAX_MTFACE];
 -  MLoopUV *uv_layers[MAX_MTFACE];
++  blender::float2 *uv_layers[MAX_MTFACE];
 +
    /* Original coordinates (ORCO) interpolation. */
    float (*orco)[3];
    float (*cloth_orco)[3];
@@@ -56,10 -53,10 +58,10 @@@
  static void subdiv_mesh_ctx_cache_uv_layers(SubdivMeshContext *ctx)
  {
    Mesh *subdiv_mesh = ctx->subdiv_mesh;
 -  ctx->num_uv_layers = CustomData_number_of_layers(&subdiv_mesh->ldata, CD_MLOOPUV);
 +  ctx->num_uv_layers = CustomData_number_of_layers(&subdiv_mesh->ldata, CD_PROP_FLOAT2);
    for (int layer_index = 0; layer_index < ctx->num_uv_layers; layer_index++) {
-     ctx->uv_layers[layer_index] = CustomData_get_layer_n(
-         &subdiv_mesh->ldata, CD_PROP_FLOAT2, layer_index);
 -    ctx->uv_layers[layer_index] = static_cast<MLoopUV *>(
 -        CustomData_get_layer_n(&subdiv_mesh->ldata, CD_MLOOPUV, layer_index));
++    ctx->uv_layers[layer_index] = static_cast<blender::float2 *>(
++        CustomData_get_layer_n(&subdiv_mesh->ldata, CD_PROP_FLOAT2, layer_index));
    }
  }
  
@@@ -853,8 -856,8 +861,8 @@@ static void subdiv_eval_uv_layer(Subdiv
    Subdiv *subdiv = ctx->subdiv;
    const int mloop_index = subdiv_loop - ctx->subdiv_mesh->mloop;
    for (int layer_index = 0; layer_index < ctx->num_uv_layers; layer_index++) {
-     float(*subdiv_loopuv)[2] = &ctx->uv_layers[layer_index][mloop_index];
-     BKE_subdiv_eval_face_varying(subdiv, layer_index, ptex_face_index, u, v, *subdiv_loopuv);
 -    MLoopUV *subdiv_loopuv = &ctx->uv_layers[layer_index][mloop_index];
 -    BKE_subdiv_eval_face_varying(subdiv, layer_index, ptex_face_index, u, v, subdiv_loopuv->uv);
++    BKE_subdiv_eval_face_varying(
++        subdiv, layer_index, ptex_face_index, u, v, ctx->uv_layers[layer_index][mloop_index]);
    }
  }



More information about the Bf-blender-cvs mailing list