24 const bool apply_subdiv)
28 &
const_cast<Object &
>(
object));
30 if (
mesh !=
nullptr) {
37 if (
mesh !=
nullptr) {
49 if (
object.runtime->geometry_set_eval !=
nullptr) {
51 geometry_set = *
object.runtime->geometry_set_eval;
56 if (
object.runtime->geometry_set_eval !=
nullptr) {
57 GeometrySet geometry_set = *
object.runtime->geometry_set_eval;
71 if (
object.type ==
OB_EMPTY &&
object.instance_collection !=
nullptr) {
72 Collection &collection = *
object.instance_collection;
73 std::unique_ptr<Instances> instances = std::make_unique<Instances>();
74 const int handle = instances->add_reference(collection);
87 switch (reference.type()) {
89 const Object &
object = reference.object();
91 callback(object_geometry_set);
95 Collection &collection = reference.collection();
98 callback(object_geometry_set);
104 const GeometrySet &instance_geometry_set = reference.geometry_set();
105 callback(instance_geometry_set);
118 new_references.
reserve(references_.size());
120 switch (reference.type()) {
127 new_references.
append(reference);
133 Object &
object = reference.object();
143 new_references.
append(std::move(object_geometry_set));
149 std::unique_ptr<Instances> instances = std::make_unique<Instances>();
150 Collection &collection = reference.collection();
158 instances->resize(objects.
size());
162 handles[
i] = instances->add_reference(*objects[
i]);
166 instances->ensure_geometry_instances();
169 new_references.
append(std::move(geometry_set));
174 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)