WIP: Volume grid attribute support in geometry nodes #110044
|
@ -171,8 +171,8 @@ class GeometryFieldInput : public fn::FieldInput {
|
|||
virtual volume::GGrid get_volume_grid_for_context(const fn::FieldContext &context,
|
||||
const volume::GGrid &mask,
|
||||
ResourceScope &scope) const override;
|
||||
virtual volume::GGrid get_volume_grid_for_context(const GeometryFieldContext & /*context*/,
|
||||
const volume::GGrid & /*mask*/) const = 0;
|
||||
virtual volume::GGrid get_volume_grid_for_context(const GeometryFieldContext &context,
|
||||
const volume::GGrid &mask) const = 0;
|
||||
virtual std::optional<eAttrDomain> preferred_domain(const GeometryComponent &component) const;
|
||||
};
|
||||
|
||||
|
@ -334,6 +334,11 @@ class IDAttributeFieldInput : public GeometryFieldInput {
|
|||
|
||||
GVArray get_varray_for_context(const GeometryFieldContext &context,
|
||||
const IndexMask &mask) const override;
|
||||
volume::GGrid get_volume_grid_for_context(const GeometryFieldContext & /*context*/,
|
||||
const volume::GGrid & /*mask*/) const override
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
std::string socket_inspection_name() const override;
|
||||
|
||||
|
|
|
@ -178,8 +178,7 @@ class GFieldRef : public GFieldBase<const FieldNode *> {
|
|||
|
||||
namespace detail {
|
||||
/* Utility class to make #is_field_v work. */
|
||||
struct TypedFieldBase {
|
||||
};
|
||||
struct TypedFieldBase {};
|
||||
} // namespace detail
|
||||
|
||||
/**
|
||||
|
@ -700,6 +699,12 @@ class IndexFieldInput final : public FieldInput {
|
|||
GVArray get_varray_for_context(const FieldContext &context,
|
||||
const IndexMask &mask,
|
||||
ResourceScope &scope) const final;
|
||||
volume::GGrid get_volume_grid_for_context(const FieldContext & /*context*/,
|
||||
const volume::GGrid & /*mask*/,
|
||||
ResourceScope & /*scope*/) const final
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
uint64_t hash() const override;
|
||||
bool is_equal_to(const fn::FieldNode &other) const override;
|
||||
|
|
|
@ -134,6 +134,11 @@ class EvaluateAtIndexInput final : public bke::GeometryFieldInput {
|
|||
|
||||
GVArray get_varray_for_context(const bke::GeometryFieldContext &context,
|
||||
const IndexMask &mask) const final;
|
||||
volume::GGrid get_volume_grid_for_context(const bke::GeometryFieldContext & /*context*/,
|
||||
const volume::GGrid & /*mask*/) const final
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
std::optional<eAttrDomain> preferred_domain(const GeometryComponent & /*component*/) const final
|
||||
{
|
||||
|
|
|
@ -284,7 +284,7 @@ class AccumulateFieldInput final : public bke::GeometryFieldInput {
|
|||
return attributes.adapt_domain(std::move(g_output), source_domain_, context.domain());
|
||||
}
|
||||
|
||||
volume::GGrid get_volume_grid_for_context(const bke::GeometryFieldContext &context,
|
||||
volume::GGrid get_volume_grid_for_context(const bke::GeometryFieldContext & /*context*/,
|
||||
const volume::GGrid & /*mask*/) const final
|
||||
{
|
||||
/* XXX Grids don't have a simple axis over which to accumulate. */
|
||||
|
|
|
@ -120,6 +120,12 @@ class EvaluateOnDomainInput final : public bke::GeometryFieldInput {
|
|||
GVArray::ForGArray(std::move(values)), src_domain_, context.domain());
|
||||
}
|
||||
|
||||
volume::GGrid get_volume_grid_for_context(const bke::GeometryFieldContext & /*context*/,
|
||||
const volume::GGrid & /*mask*/) const final
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
void for_each_field_input_recursive(FunctionRef<void(const FieldInput &)> fn) const override
|
||||
{
|
||||
src_field_.node().for_each_field_input_recursive(fn);
|
||||
|
|
|
@ -132,6 +132,12 @@ class IndexOfNearestFieldInput final : public bke::GeometryFieldInput {
|
|||
return VArray<int>::ForContainer(std::move(result));
|
||||
}
|
||||
|
||||
volume::GGrid get_volume_grid_for_context(const bke::GeometryFieldContext & /*context*/,
|
||||
const volume::GGrid & /*mask*/) const final
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
public:
|
||||
void for_each_field_input_recursive(FunctionRef<void(const FieldInput &)> fn) const
|
||||
{
|
||||
|
@ -201,6 +207,12 @@ class HasNeighborFieldInput final : public bke::GeometryFieldInput {
|
|||
return VArray<bool>::ForContainer(std::move(result));
|
||||
}
|
||||
|
||||
volume::GGrid get_volume_grid_for_context(const bke::GeometryFieldContext & /*context*/,
|
||||
const volume::GGrid & /*mask*/) const final
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
public:
|
||||
void for_each_field_input_recursive(FunctionRef<void(const FieldInput &)> fn) const
|
||||
{
|
||||
|
|
|
@ -84,6 +84,12 @@ class MaterialSelectionFieldInput final : public bke::GeometryFieldInput {
|
|||
return mesh->attributes().adapt_domain<bool>(std::move(selection), ATTR_DOMAIN_FACE, domain);
|
||||
}
|
||||
|
||||
volume::GGrid get_volume_grid_for_context(const bke::GeometryFieldContext & /*context*/,
|
||||
const volume::GGrid & /*mask*/) const final
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
uint64_t hash() const override
|
||||
{
|
||||
return get_default_hash(material_);
|
||||
|
|
|
@ -46,6 +46,11 @@ class ToolSelectionFieldInput final : public bke::GeometryFieldInput {
|
|||
return {};
|
||||
}
|
||||
}
|
||||
volume::GGrid get_volume_grid_for_context(const bke::GeometryFieldContext & /*context*/,
|
||||
const volume::GGrid & /*mask*/) const final
|
||||
{
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
static void node_geo_exec(GeoNodeExecParams params)
|
||||
|
|
Loading…
Reference in New Issue