Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_texture_field.hh
- This file was added.
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | |||||
| #pragma once | |||||
| #include "BKE_geometry_set.hh" | |||||
| #include "FN_field.hh" | |||||
| namespace blender::nodes { | |||||
| struct TextureBatch; | |||||
| struct GeometrySurfaceTextureBatch; | |||||
| } // namespace blender::nodes | |||||
| namespace blender::bke { | |||||
| /** | |||||
| * A field context that represents a continuous texture space. The geometric shape that the | |||||
| * texture maps to is abstracted away, it may for example be a mesh, 2D plane or 3D space. This is | |||||
| * used for texture node evaluation for cases like brush textures and baking to image textures. | |||||
| */ | |||||
| class TextureFieldContext : public fn::FieldContext { | |||||
| private: | |||||
| const blender::nodes::TextureBatch *batch_ = nullptr; | |||||
| std::unique_ptr<MeshComponent> mesh_component_; | |||||
| public: | |||||
| TextureFieldContext(); | |||||
| TextureFieldContext(const blender::nodes::GeometrySurfaceTextureBatch &batch); | |||||
| TextureFieldContext(const blender::nodes::TextureBatch &batch); | |||||
| const blender::nodes::TextureBatch *batch() const | |||||
| { | |||||
| return batch_; | |||||
| } | |||||
| std::optional<AttributeAccessor> attributes() const; | |||||
| }; | |||||
| } // namespace blender::bke | |||||