[Bf-blender-cvs] [9f9123e7c91] temp-sculpt-colors: Merge branch 'master' into temp-sculpt-colors

Joseph Eagar noreply at git.blender.org
Wed Jan 12 10:51:23 CET 2022


Commit: 9f9123e7c919fa585156f502ab892864a5bce656
Author: Joseph Eagar
Date:   Wed Jan 12 01:51:15 2022 -0800
Branches: temp-sculpt-colors
https://developer.blender.org/rB9f9123e7c919fa585156f502ab892864a5bce656

Merge branch 'master' into temp-sculpt-colors

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



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

diff --cc source/blender/io/alembic/intern/abc_reader_mesh.cc
index 5bf0e10f695,83ca3399db5..c0209f31709
--- a/source/blender/io/alembic/intern/abc_reader_mesh.cc
+++ b/source/blender/io/alembic/intern/abc_reader_mesh.cc
@@@ -463,13 -463,17 +463,17 @@@ static void read_velocity(const V3fArra
                            const CDStreamConfig &config,
                            const float velocity_scale)
  {
+   const int num_velocity_vectors = static_cast<int>(velocities->size());
+   if (num_velocity_vectors != config.mesh->totvert) {
+     /* Files containing videogrammetry data may be malformed and export velocity data on missing
+      * frames (most likely by copying the last valid data). */
+     return;
+   }
+ 
    CustomDataLayer *velocity_layer = BKE_id_attribute_new(
 -      &config.mesh->id, "velocity", CD_PROP_FLOAT3, ATTR_DOMAIN_POINT, nullptr);
 +      &config.mesh->id, "velocity", CD_PROP_FLOAT3, ATTR_DOMAIN_POINT, CD_MASK_PROP_ALL, nullptr);
    float(*velocity)[3] = (float(*)[3])velocity_layer->data;
  
-   const int num_velocity_vectors = static_cast<int>(velocities->size());
-   BLI_assert(num_velocity_vectors == config.mesh->totvert);
- 
    for (int i = 0; i < num_velocity_vectors; i++) {
      const Imath::V3f &vel_in = (*velocities)[i];
      copy_zup_from_yup(velocity[i], vel_in.getValue());
diff --cc source/blender/nodes/shader/nodes/node_shader_vertex_color.cc
index 14e394f00ef,6501527ef5d..db22466ba10
--- a/source/blender/nodes/shader/nodes/node_shader_vertex_color.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_vertex_color.cc
@@@ -27,6 -32,26 +32,19 @@@ static void node_declare(NodeDeclaratio
    b.add_output<decl::Float>(N_("Alpha"));
  }
  
+ static void node_shader_buts_vertex_color(uiLayout *layout, bContext *C, PointerRNA *ptr)
+ {
+   PointerRNA obptr = CTX_data_pointer_get(C, "active_object");
+   if (obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) {
+     PointerRNA dataptr = RNA_pointer_get(&obptr, "data");
+ 
 -    if (U.experimental.use_sculpt_vertex_colors &&
 -        RNA_collection_length(&dataptr, "sculpt_vertex_colors")) {
 -      uiItemPointerR(
 -          layout, ptr, "layer_name", &dataptr, "sculpt_vertex_colors", "", ICON_GROUP_VCOL);
 -    }
 -    else {
 -      uiItemPointerR(layout, ptr, "layer_name", &dataptr, "vertex_colors", "", ICON_GROUP_VCOL);
 -    }
++    uiItemPointerR(layout, ptr, "layer_name", &dataptr, "color_attributes", "", ICON_GROUP_VCOL);
+   }
+   else {
+     uiItemL(layout, TIP_("No mesh in active object"), ICON_ERROR);
+   }
+ }
+ 
  static void node_shader_init_vertex_color(bNodeTree *UNUSED(ntree), bNode *node)
  {
    NodeShaderVertexColor *vertexColor = MEM_cnew<NodeShaderVertexColor>("NodeShaderVertexColor");



More information about the Bf-blender-cvs mailing list