GPv3: Rename layer domain to just "Layer"
We had a short discussion on this change. "Grease Pencil Layer" is just a bit too long, especially in the UI. Even though "Layer" might be ambiguous, it shouldn't be in the context of geometry nodes. There are currently no other "Layers" and if there were, using the same domain name could be fine (just like we reuse the point domain for e.g. vertices in meshes and control points in curves). This also renames the internal enum to `ATTR_DOMAIN_LAYER` Pull Request: https://projects.blender.org/blender/blender/pulls/113589
This commit is contained in:
@@ -99,12 +99,11 @@ const EnumPropertyItem *domain_experimental_grease_pencil_version3_fn(bContext *
|
||||
bool *r_free)
|
||||
{
|
||||
*r_free = true;
|
||||
return enum_items_filter(rna_enum_attribute_domain_items,
|
||||
[](const EnumPropertyItem &item) -> bool {
|
||||
return (item.value == ATTR_DOMAIN_GREASE_PENCIL_LAYER) ?
|
||||
U.experimental.use_grease_pencil_version3 :
|
||||
true;
|
||||
});
|
||||
return enum_items_filter(
|
||||
rna_enum_attribute_domain_items, [](const EnumPropertyItem &item) -> bool {
|
||||
return (item.value == ATTR_DOMAIN_LAYER) ? U.experimental.use_grease_pencil_version3 :
|
||||
true;
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace enums
|
||||
|
||||
@@ -117,13 +117,11 @@ class EvaluateOnDomainInput final : public bke::GeometryFieldInput {
|
||||
const CPPType &cpp_type = src_field_.cpp_type();
|
||||
|
||||
if (context.type() == GeometryComponent::Type::GreasePencil &&
|
||||
(src_domain_ == ATTR_DOMAIN_GREASE_PENCIL_LAYER) !=
|
||||
(dst_domain == ATTR_DOMAIN_GREASE_PENCIL_LAYER))
|
||||
(src_domain_ == ATTR_DOMAIN_LAYER) != (dst_domain == ATTR_DOMAIN_LAYER))
|
||||
{
|
||||
/* Evaluate field just for the current layer. */
|
||||
if (src_domain_ == ATTR_DOMAIN_GREASE_PENCIL_LAYER) {
|
||||
const bke::GeometryFieldContext src_domain_context{context,
|
||||
ATTR_DOMAIN_GREASE_PENCIL_LAYER};
|
||||
if (src_domain_ == ATTR_DOMAIN_LAYER) {
|
||||
const bke::GeometryFieldContext src_domain_context{context, ATTR_DOMAIN_LAYER};
|
||||
const int layer_index = context.grease_pencil_layer_index();
|
||||
|
||||
const IndexMask single_layer_mask = IndexRange(layer_index, 1);
|
||||
|
||||
@@ -132,8 +132,7 @@ GeometryInfoLog::GeometryInfoLog(const bke::GeometrySet &geometry_set)
|
||||
const auto &grease_pencil_component = *static_cast<const bke::GreasePencilComponent *>(
|
||||
component);
|
||||
GreasePencilInfo &info = this->grease_pencil_info.emplace();
|
||||
info.layers_num = grease_pencil_component.attribute_domain_size(
|
||||
ATTR_DOMAIN_GREASE_PENCIL_LAYER);
|
||||
info.layers_num = grease_pencil_component.attribute_domain_size(ATTR_DOMAIN_LAYER);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user