Blender V5.3
object_visual_geometry_to_objects.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "BKE_context.hh"
10#include "BKE_curves.hh"
11#include "BKE_geometry_set.hh"
13#include "BKE_grease_pencil.hh"
14#include "BKE_instances.hh"
15#include "BKE_layer.hh"
16#include "BKE_lib_id.hh"
17#include "BKE_main.hh"
18#include "BKE_material.hh"
19#include "BKE_mesh.h"
20#include "BKE_mesh.hh"
21#include "BKE_multires.hh"
22#include "BKE_object.hh"
23#include "BKE_pointcloud.hh"
24
26
28#include "DNA_curves_types.h"
30#include "DNA_material_types.h"
31#include "DNA_mesh_types.h"
33
34#include "ED_object.hh"
35#include "ED_screen.hh"
36
37#include "WM_api.hh"
38#include "WM_types.hh"
39
40#include "BLI_listbase.hh"
41#include "BLI_map.hh"
42#include "BLI_math_matrix.hh"
43#include "BLI_math_matrix_c.hh"
44
45#include "object_intern.hh"
46
47namespace blender::ed::object {
48
51{
52 float3 location;
53 math::EulerXYZ rotation;
56 copy_v3_v3(ob.loc, location);
57 copy_v3_v3(ob.rot, float3(rotation.x().radian(), rotation.y().radian(), rotation.z().radian()));
60}
61
64 Object *mesh_ob = nullptr;
65 Object *curves_ob = nullptr;
69
71 {
72 Vector<Object *> objects;
73 if (mesh_ob) {
74 objects.append(mesh_ob);
75 }
76 if (curves_ob) {
77 objects.append(curves_ob);
78 }
79 if (pointcloud_ob) {
80 objects.append(pointcloud_ob);
81 }
82 if (greasepencil_ob) {
83 objects.append(greasepencil_ob);
84 }
85 for (Object *instance_object : instance_objects) {
86 objects.append(instance_object);
87 }
88 return objects;
89 }
90};
91
92static void copy_materials_to_new_geometry_object(const Object &src_ob_eval,
93 const ID &src_data_eval,
94 Object &dst_ob_orig,
95 ID &dst_data_orig)
96{
97 const int materials_num = BKE_id_material_used_eval(src_data_eval);
98 if (materials_num == 0) {
99 return;
100 }
101 *BKE_id_material_len_p(&dst_data_orig) = materials_num;
102 dst_ob_orig.totcol = materials_num;
103
104 dst_ob_orig.matbits = MEM_new_array_zeroed<char>(materials_num, __func__);
105 dst_ob_orig.mat = MEM_new_array_zeroed<Material *>(materials_num, __func__);
106 Material ***dst_materials = BKE_id_material_array_p(&dst_data_orig);
107 *dst_materials = MEM_new_array_zeroed<Material *>(materials_num, __func__);
108
109 for (int i = 0; i < materials_num; i++) {
110 const Material *material_eval = BKE_object_material_get_eval(
111 src_ob_eval, src_data_eval, i + 1);
112 Material *material_orig = const_cast<Material *>(DEG_get_original(material_eval));
113 if (material_orig) {
114 (*dst_materials)[i] = material_orig;
115 id_us_plus(&material_orig->id);
116 }
117 }
118}
119
121 /* A collection that should be instanced. */
123 /* A transform that needs to be applied to instances of that collection. */
125};
126
129 private:
130 Main &bmain_;
131 Map<const ID *, Object *> new_object_by_generated_geometry_;
133 Vector<Collection *> new_instance_collections_;
134
135 public:
136 GeometryToObjectsBuilder(Main &bmain) : bmain_(bmain) {}
137
140 {
141 ComponentObjects component_objects = this->get_objects_for_geometry(src_ob_eval, geometry);
142 const StringRefNull name = geometry.name().is_empty() ?
143 StringRefNull(BKE_id_name(src_ob_eval.id)) :
144 StringRefNull(geometry.name());
145 return this->collection_from_component_objects(component_objects, name);
146 }
147
150 {
151 const StringRefNull name = geometry.name().is_empty() ?
152 StringRefNull(BKE_id_name(src_ob_eval.id)) :
153 StringRefNull(geometry.name());
154 ComponentObjects objects;
155 if (const Mesh *mesh = geometry.get_mesh()) {
156 if (mesh->verts_num > 0) {
157 objects.mesh_ob = this->ensure_object_for_mesh(src_ob_eval, *mesh, name);
158 }
159 }
160 if (const Curves *curves = geometry.get_curves()) {
161 if (curves->geometry.curve_num > 0) {
162 objects.curves_ob = this->ensure_object_for_curves(src_ob_eval, *curves, name);
163 }
164 }
165 if (const PointCloud *pointcloud = geometry.get_pointcloud()) {
166 if (pointcloud->totpoint > 0) {
167 objects.pointcloud_ob = this->ensure_object_for_pointcloud(src_ob_eval, *pointcloud, name);
168 }
169 }
170 if (const GreasePencil *greasepencil = geometry.get_grease_pencil()) {
171 if (greasepencil->layers().size() > 0) {
172 objects.greasepencil_ob = this->ensure_object_for_grease_pencil(
173 src_ob_eval, *greasepencil, name);
174 }
175 }
176 if (const bke::Instances *instances = geometry.get_instances()) {
177 objects.instance_objects = this->create_objects_for_instances(src_ob_eval, *instances);
178 }
179 return objects;
180 }
181
183 {
184 return new_instance_collections_;
185 }
186
187 private:
188 Collection *collection_from_component_objects(const ComponentObjects &component_objects,
189 const StringRefNull name)
190 {
191 Collection *collection = BKE_collection_add(&bmain_, nullptr, name.c_str());
192 for (Object *object : component_objects.all_objects()) {
193 BKE_collection_object_add(&bmain_, collection, object);
194 }
195 return collection;
196 }
197
198 Object *ensure_object_for_mesh(const Object &src_ob_eval,
199 const Mesh &src_mesh,
200 const StringRefNull name)
201 {
202 return new_object_by_generated_geometry_.lookup_or_add_cb(&src_mesh.id, [&]() {
203 Mesh *new_mesh = BKE_id_new<Mesh>(&bmain_, name.c_str());
204 Object *new_ob = BKE_object_add_only_object(&bmain_, OB_MESH, name.c_str());
205 new_ob->data = id_cast<ID *>(new_mesh);
206
207 BKE_mesh_nomain_to_mesh(BKE_mesh_copy_for_eval(src_mesh), new_mesh, new_ob);
208 new_mesh->attributes_for_write().remove_anonymous();
209 copy_materials_to_new_geometry_object(src_ob_eval, src_mesh.id, *new_ob, new_mesh->id);
210 bke::mesh_remove_invalid_attribute_strings(*new_mesh);
211 multires_customdata_delete(new_mesh);
212 return new_ob;
213 });
214 }
215
216 Object *ensure_object_for_curves(const Object &src_ob_eval,
217 const Curves &src_curves,
218 const StringRefNull name)
219 {
220 return new_object_by_generated_geometry_.lookup_or_add_cb(&src_curves.id, [&]() {
221 Curves *new_curves = BKE_id_new<Curves>(&bmain_, name.c_str());
222 Object *new_ob = BKE_object_add_only_object(&bmain_, OB_CURVES, name.c_str());
223 new_ob->data = id_cast<ID *>(new_curves);
224
225 new_curves->geometry.wrap() = src_curves.geometry.wrap();
226 new_curves->geometry.wrap().attributes_for_write().remove_anonymous();
227 copy_materials_to_new_geometry_object(src_ob_eval, src_curves.id, *new_ob, new_curves->id);
228 return new_ob;
229 });
230 }
231
232 Object *ensure_object_for_pointcloud(const Object &src_ob_eval,
233 const PointCloud &src_pointcloud,
234 const StringRefNull name)
235 {
236 return new_object_by_generated_geometry_.lookup_or_add_cb(&src_pointcloud.id, [&]() {
237 PointCloud *new_pointcloud = BKE_id_new<PointCloud>(&bmain_, name.c_str());
238 Object *new_ob = BKE_object_add_only_object(&bmain_, OB_POINTCLOUD, name.c_str());
239 new_ob->data = id_cast<ID *>(new_pointcloud);
240
241 BKE_pointcloud_nomain_to_pointcloud(BKE_pointcloud_copy_for_eval(&src_pointcloud),
242 new_pointcloud);
243 new_pointcloud->attributes_for_write().remove_anonymous();
244 copy_materials_to_new_geometry_object(
245 src_ob_eval, src_pointcloud.id, *new_ob, new_pointcloud->id);
246 return new_ob;
247 });
248 }
249
250 Object *ensure_object_for_grease_pencil(const Object &src_ob_eval,
251 const GreasePencil &src_grease_pencil,
252 const StringRefNull name)
253 {
254 return new_object_by_generated_geometry_.lookup_or_add_cb(&src_grease_pencil.id, [&]() {
255 GreasePencil *new_grease_pencil = BKE_id_new<GreasePencil>(&bmain_, name.c_str());
256 Object *new_ob = BKE_object_add_only_object(&bmain_, OB_GREASE_PENCIL, name.c_str());
257 new_ob->data = id_cast<ID *>(new_grease_pencil);
258
259 GreasePencil *greasepencil_to_move_from = BKE_grease_pencil_copy_for_eval(
260 &src_grease_pencil);
261 BKE_grease_pencil_nomain_to_grease_pencil(greasepencil_to_move_from, new_grease_pencil);
262 new_grease_pencil->attributes_for_write().remove_anonymous();
263 for (GreasePencilDrawingBase *base : new_grease_pencil->drawings()) {
264 if (base->type != GP_DRAWING) {
265 continue;
266 }
267 bke::greasepencil::Drawing &drawing =
268 reinterpret_cast<GreasePencilDrawing *>(base)->wrap();
269 drawing.strokes_for_write().attributes_for_write().remove_anonymous();
270 }
272 src_ob_eval, src_grease_pencil.id, *new_ob, new_grease_pencil->id);
273 return new_ob;
274 });
275 }
276
277 Vector<Object *> create_objects_for_instances(const Object &src_ob_eval,
278 const bke::Instances &src_instances)
279 {
280 if (std::optional<Vector<Object *>> simple_objects = this->create_objects_for_instances_simple(
281 src_ob_eval, src_instances))
282 {
283 return *simple_objects;
284 }
285
286 bke::Instances instances = src_instances;
287 instances.remove_unused_references();
288
289 /* Each instance will be a collection instance, so we need to get the collection for each
290 * #InstanceReference that is instanced. */
291 Vector<CollectionWithTransform> data_by_handle;
292 for (const bke::InstanceReference &reference : instances.references()) {
293 data_by_handle.append(
294 this->get_or_create_collection_for_instance_reference(src_ob_eval, reference));
295 }
296
297 const Span<int> handles = instances.reference_handles();
298 const Span<float4x4> transforms = instances.transforms();
299
300 Vector<Object *> objects;
301 for (const int instance_i : IndexRange(instances.instances_num())) {
302 const int handle = handles[instance_i];
303 if (!data_by_handle.index_range().contains(handle)) {
304 continue;
305 }
306 const CollectionWithTransform &instance = data_by_handle[handle];
307 if (!instance.collection) {
308 continue;
309 }
310 /* Create an empty object that then instances the collection. */
311 Object *instance_object = BKE_object_add_only_object(
312 &bmain_, OB_EMPTY, BKE_id_name(instance.collection->id));
313 instance_object->transflag = OB_DUPLICOLLECTION;
314 instance_object->instance_collection = instance.collection;
315 id_us_plus(&instance.collection->id);
316
317 const float4x4 &transform = transforms[instance_i];
318 set_local_object_transform(*instance_object, transform * instance.transform);
319
320 objects.append(instance_object);
321 }
322 return objects;
323 }
324
330 std::optional<Vector<Object *>> create_objects_for_instances_simple(
331 const Object &src_ob_eval, const bke::Instances &src_instances)
332 {
333 const Span<float4x4> transforms = src_instances.transforms();
334 const Span<int> handles = src_instances.reference_handles();
335 const Span<bke::InstanceReference> references = src_instances.references();
336
337 Vector<Object *> objects;
338 for (const int i : IndexRange(src_instances.instances_num())) {
339 const float4x4 &transform = transforms[i];
340 if (transform != float4x4::identity()) {
341 return std::nullopt;
342 }
343 const int handle = handles[i];
344 if (handle < 0 || handle >= references.size()) {
345 return std::nullopt;
346 }
347 const bke::InstanceReference &reference = references[handle];
348 switch (reference.type()) {
350 break;
351 }
353 Object &object_eval = reference.object();
354 Object *object_orig = DEG_get_original(&object_eval);
355 if (ELEM(object_orig, &src_ob_eval, nullptr)) {
356 return std::nullopt;
357 }
358 objects.append(object_orig);
359 break;
360 }
362 return std::nullopt;
363 }
365 const ComponentObjects component_objects = this->get_objects_for_geometry(
366 src_ob_eval, reference.geometry_set());
367 objects.extend(component_objects.all_objects());
368 break;
369 }
370 }
371 }
372
373 return objects;
374 }
375
376 CollectionWithTransform get_or_create_collection_for_instance_reference(
377 const Object &src_ob_eval, const bke::InstanceReference &reference)
378 {
379 if (const CollectionWithTransform *instance = collection_by_instance_.lookup_ptr(reference)) {
380 return *instance;
381 }
383 switch (reference.type()) {
385 break;
386 }
388 /* Create a collection for the object because we can't instance objects directly. */
389 Object &object_eval = reference.object();
390 Object *object_orig = DEG_get_original(&object_eval);
391
392 if (object_orig->type == OB_EMPTY && object_orig->instance_collection) {
393 instance.collection = object_orig->instance_collection;
394 }
395 else {
396 instance.collection = BKE_collection_add(&bmain_, nullptr, BKE_id_name(object_orig->id));
397 new_instance_collections_.append(instance.collection);
398 BKE_collection_object_add(&bmain_, instance.collection, object_orig);
399
400 /* Handle the object transform because it may not be the identity matrix. The location is
401 * handled by setting the collection instance offset to it. The rotation and scale are
402 * handled by offsetting the instance using the collection by the inverse amount. */
403 float4x4 object_transform;
404 BKE_object_to_mat4(object_orig, object_transform.ptr());
405 instance.transform = float4x4(math::invert(float3x3(object_transform)));
406 copy_v3_v3(instance.collection->instance_offset, object_transform.location());
407 }
408 break;
409 }
411 /* For collections, we don't need to create a new wrapper collection, we can just create
412 * objects that instance the existing collection. */
413 Collection &collection_eval = reference.collection();
414 Collection *collection_orig = DEG_get_original(&collection_eval);
415 instance.collection = collection_orig;
416 break;
417 }
419 instance.collection = this->build_collection_for_geometry(src_ob_eval,
420 reference.geometry_set());
421 new_instance_collections_.append(instance.collection);
422 break;
423 }
424 }
425 collection_by_instance_.add(reference, instance);
426 return instance;
427 }
428};
429
431 Scene *scene,
432 Object &object)
433{
434 VectorSet<Collection *> collections;
435 FOREACH_COLLECTION_BEGIN (&bmain, scene, Collection *, collection) {
436 if (BKE_collection_has_object(collection, &object)) {
437 collections.add(collection);
438 }
439 }
441 return collections.extract_vector();
442}
443
445{
446 Main &bmain = *CTX_data_main(C);
447 Scene &scene = *CTX_data_scene(C);
448 Depsgraph &depsgraph = *CTX_data_ensure_evaluated_depsgraph(C);
449 ViewLayer &active_view_layer = *CTX_data_view_layer(C);
450
451 Vector<Object *> selected_objects_orig;
452 CTX_DATA_BEGIN (C, Object *, src_ob_orig, selected_objects) {
453 selected_objects_orig.append(src_ob_orig);
454 }
456
457 /* Create all required objects and collections and add them to bmain. However, so far nothing is
458 * linked to the scene or view layer. That happens below. */
459 GeometryToObjectsBuilder op(bmain);
460 Vector<Object *> all_new_top_level_objects;
461 for (Object *src_ob_orig : selected_objects_orig) {
462 Object *src_ob_eval = DEG_get_evaluated(&depsgraph, src_ob_orig);
463 bke::GeometrySet geometry_eval = bke::object_get_evaluated_geometry_set(*src_ob_eval);
464 const ComponentObjects new_component_objects = op.get_objects_for_geometry(*src_ob_eval,
465 geometry_eval);
466 const Vector<Object *> top_level_objects = new_component_objects.all_objects();
467 all_new_top_level_objects.extend(top_level_objects);
468 /* Find the collections that the active object is in, because we want to add the new objects
469 * in the same place. */
470 const Vector<Collection *> collections_to_add_to = find_collections_containing_object(
471 bmain, &scene, *src_ob_orig);
472
473 float4x4 src_ob_local_transform;
474 BKE_object_to_mat4(src_ob_eval, src_ob_local_transform.ptr());
475
476 for (Object *object : top_level_objects) {
477 /* Link the new objects into some collections. */
478 for (Collection *collection_to_add_to : collections_to_add_to) {
479 BKE_collection_object_add(&bmain, collection_to_add_to, object);
480 }
481 /* Transform and parent the objects so that they align with the source object. */
482 float4x4 old_transform;
483 BKE_object_to_mat4(object, old_transform.ptr());
484 set_local_object_transform(*object, src_ob_local_transform * old_transform);
485 object->parent = src_ob_orig->parent;
486 copy_m4_m4(object->parentinv, src_ob_orig->parentinv);
487 }
488 }
489
490 const Span<Collection *> new_instance_collections = op.new_instance_collections();
491 for (Collection *new_collection : new_instance_collections) {
492 /* Add the new collections to the scene collection. This makes them more visible to the user,
493 * compared to having collection instances which use collections that are not in the scene. */
494 BKE_collection_child_add(&bmain, scene.master_collection, new_collection);
495 }
496 /* Ensure that the #Base for objects and #LayerCollection for collections are created. */
498
499 /* Deselect everything so that we can select the new objects. */
500 BKE_view_layer_base_deselect_all(bmain, &scene, &active_view_layer);
501 /* Select the new objects. */
502 for (Object *object : all_new_top_level_objects) {
503 Base *base = BKE_view_layer_base_find(&active_view_layer, object);
504 base->flag |= BASE_SELECTED;
505 }
506 /* Make one of the new objects active. */
507 if (!all_new_top_level_objects.is_empty()) {
508 Base *first_base = BKE_view_layer_base_find(&active_view_layer, all_new_top_level_objects[0]);
509 BKE_view_layer_base_select_and_set_active(&active_view_layer, first_base);
510 base_active_refresh(&bmain, &scene, &active_view_layer);
511 }
512 /* Exclude the new collections. This is done because they are only instanced by other objects but
513 * should not be visible by themselves. */
514 for (ViewLayer &view_layer : scene.view_layers) {
515 for (Collection *new_collection : new_instance_collections) {
517 &view_layer, new_collection);
518 BKE_layer_collection_set_flag(new_layer_collection, LAYER_COLLECTION_EXCLUDE, true);
519 }
520 }
521 BKE_view_layer_need_resync_tag(&active_view_layer);
523
529 return OPERATOR_FINISHED;
530}
531
533{
534 ot->name = "Visual Geometry to Objects";
535 ot->description = "Convert geometry and instances into editable objects and collections";
536 ot->idname = "OBJECT_OT_visual_geometry_to_objects";
537
540
542}
543
544} // namespace blender::ed::object
#define FOREACH_COLLECTION_BEGIN(_bmain, _scene, Type, _instance)
#define FOREACH_COLLECTION_END
#define CTX_DATA_BEGIN(C, Type, instance, member)
#define CTX_DATA_END
Low-level operations for curves.
Low-level operations for grease pencil.
General operations, lookup, etc. for materials.
General operations, lookup, etc. for blender objects.
General operations for point clouds.
Object groups, one object can be in many groups at once.
#define C
Definition RandGen.cpp:29
#define ND_DRAW
Definition WM_types.hh:502
#define ND_OB_SELECT
Definition WM_types.hh:461
#define NC_SCENE
Definition WM_types.hh:391
#define ND_LAYER_CONTENT
Definition WM_types.hh:472
#define ND_LAYER
Definition WM_types.hh:469
#define NC_OBJECT
Definition WM_types.hh:392
#define ELEM(...)
constexpr int64_t size() const
Definition BLI_span.hh:256
constexpr IndexRange()=default
const Value * lookup_ptr(const Key &key) const
Definition BLI_map.hh:508
bool add(const Key &key, const Value &value)
Definition BLI_map.hh:295
Value & lookup_or_add_cb(const Key &key, const CreateValueF &create_value)
Definition BLI_map.hh:620
constexpr const char * c_str() const
constexpr StringRefNull()
bool add(const Key &key)
void append(const T &value)
bool is_empty() const
void extend(Span< T > array)
ComponentObjects get_objects_for_geometry(const Object &src_ob_eval, const bke::GeometrySet &geometry)
Collection * build_collection_for_geometry(const Object &src_ob_eval, const bke::GeometrySet &geometry)
float3x3 scale(float3x3 mat, float2 scale)
GeometrySet object_get_evaluated_geometry_set(const Object &object, bool apply_subdiv=true)
static void set_local_object_transform(Object &ob, const float4x4 &transform)
static void copy_materials_to_new_geometry_object(const Object &src_ob_eval, const ID &src_data_eval, Object &dst_ob_orig, ID &dst_data_orig)
void base_active_refresh(Main *bmain, Scene *scene, ViewLayer *view_layer)
static wmOperatorStatus visual_geometry_to_objects_exec(bContext *C, wmOperator *)
static Vector< Collection * > find_collections_containing_object(Main &bmain, Scene *scene, Object &object)
void OBJECT_OT_visual_geometry_to_objects(wmOperatorType *ot)
EulerXYZBase< float > EulerXYZ
CartesianBasis invert(const CartesianBasis &basis)
void to_loc_rot_scale_safe(const MatBase< T, 4, 4 > &mat, VecBase< T, 3 > &r_location, RotationT &r_rotation, VecBase< T, 3 > &r_scale)
void WM_main_add_notifier(uint type, void *reference)
void BKE_view_layer_base_select_and_set_active(ViewLayer *view_layer, Base *selbase)
MINLINE void copy_v3_v3(float r[3], const float a[3])
bool BKE_scene_view_layers_synced_ensure(const Main &bmain, const Scene *scene)
void id_us_plus(ID *id)
Definition lib_id.cc:433
bool BKE_collection_child_add(Main *bmain, Collection *parent, Collection *child)
short * BKE_id_material_len_p(ID *id)
Material *** BKE_id_material_array_p(ID *id)
int BKE_id_material_used_eval(const ID &id)
MatBase< float, 4, 4 > float4x4
const char * BKE_id_name(const ID &id)
void BKE_view_layer_need_resync_tag(ViewLayer *view_layer)
ViewLayer * CTX_data_view_layer(const bContext *C)
void BKE_layer_collection_set_flag(LayerCollection *lc, eLayerCollection_Flag flag, bool value)
bool BKE_collection_has_object(Collection *collection, const Object *ob)
void BKE_object_to_mat4(const Object *ob, float r_mat[4][4])
Definition object.cc:3125
void DEG_id_tag_update(ID *id, unsigned int flags)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
@ LAYER_COLLECTION_EXCLUDE
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
LayerCollection * BKE_layer_collection_first_from_scene_collection(const ViewLayer *view_layer, const Collection *collection)
bool BKE_collection_object_add(Main *bmain, Collection *collection, Object *ob)
bool ED_operator_object_active(bContext *C)
MatBase< float, 3, 3 > float3x3
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void BKE_view_layer_base_deselect_all(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
T * DEG_get_original(T *id)
Main * CTX_data_main(const bContext *C)
Material * BKE_object_material_get_eval(Object *ob, short act)
@ ID_RECALC_BASE_FLAGS
Definition DNA_ID.h:1104
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
void DEG_relations_tag_update(Main *bmain)
Scene * CTX_data_scene(const bContext *C)
@ OPTYPE_REGISTER
Definition WM_types.hh:188
@ OPTYPE_UNDO
Definition WM_types.hh:190
void copy_m4_m4(float m1[4][4], const float m2[4][4])
VecBase< float, 3 > float3
Object * BKE_object_add_only_object(Main *bmain, ObjectType type, const char *name) ATTR_RETURNS_NONNULL
Definition object.cc:2265
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
Collection * BKE_collection_add(Main *bmain, Collection *collection_parent, const char *name_custom)
float4 transform(float4 hs_position)
const NodeType * type
Definition graph/node.h:179
const c_style_mat & ptr() const
struct Material ** mat
ListBaseT< ViewLayer > view_layers
struct Collection * master_collection
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1125
const char * description
Definition WM_types.hh:1115
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1165