24 const bool apply_subdiv)
28 &
const_cast<Object &
>(
object));
30 if (
mesh !=
nullptr) {
37 if (
mesh !=
nullptr) {
48 if (
object.runtime->geometry_set_eval !=
nullptr) {
49 GeometrySet geometry_set = *
object.runtime->geometry_set_eval;
63 if (
object.type ==
OB_EMPTY &&
object.instance_collection !=
nullptr) {
64 Collection &collection = *
object.instance_collection;
65 std::unique_ptr<Instances> instances = std::make_unique<Instances>();
66 const int handle = instances->add_reference(collection);
79 switch (reference.type()) {
81 const Object &
object = reference.object();
83 callback(object_geometry_set);
87 Collection &collection = reference.collection();
90 callback(object_geometry_set);
96 const GeometrySet &instance_geometry_set = reference.geometry_set();
97 callback(instance_geometry_set);
110 new_references.
reserve(references_.size());
112 switch (reference.type()) {
119 new_references.
append(reference);
125 Object &
object = reference.object();
135 new_references.
append(std::move(object_geometry_set));
141 std::unique_ptr<Instances> instances = std::make_unique<Instances>();
142 Collection &collection = reference.collection();
150 instances->resize(objects.
size());
154 handles[
i] = instances->add_reference(*objects[
i]);
158 instances->ensure_geometry_instances();
161 new_references.
append(std::move(geometry_set));
166 references_ = std::move(new_references);
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object)
const char * BKE_id_name(const ID &id)
void BKE_mesh_wrapper_ensure_mdata(Mesh *mesh)
Mesh * BKE_modifier_get_evaluated_mesh_from_evaluated_object(Object *ob_eval)
General operations, lookup, etc. for blender objects.
Mesh * BKE_object_get_evaluated_mesh_no_subsurf(const Object *object_eval)
bool DEG_object_geometry_is_evaluated(const Object &object)
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
void append(const T &value)
IndexRange index_range() const
void reserve(const int64_t min_capacity)
Span< float4x4 > transforms() const
void foreach_referenced_geometry(FunctionRef< void(const GeometrySet &geometry_set)> callback) const
void ensure_geometry_instances()
GeometrySet object_get_evaluated_geometry_set(const Object &object, bool apply_subdiv=true)
static void add_final_mesh_as_geometry_component(const Object &object, GeometrySet &geometry_set, const bool apply_subdiv)
static MatBase identity()
static GeometrySet from_instances(Instances *instances, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
Instances * get_instances_for_write()
bool has_instances() const
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)