Blender V5.3
blender/object.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
7#include "blender/sync.h"
8#include "blender/util.h"
9
10#include "scene/camera.h"
11#include "scene/integrator.h"
12#include "scene/light.h"
13#include "scene/mesh.h"
14#include "scene/object.h"
15#include "scene/particles.h"
16#include "scene/scene.h"
17#include "scene/shader.h"
18#include "scene/shader_graph.h"
19#include "scene/shader_nodes.h"
20
21#include "util/hash.h"
22#include "util/log.h"
23#include "util/task.h"
24
25#include "BKE_duplilist.hh"
26#include "BKE_layer.hh"
27#include "BKE_material.hh"
28#include "BKE_object.hh"
29
31
32#include "RE_engine.h"
33
34using blender::Object;
35
37
38/* Utilities */
39
40bool BlenderSync::BKE_object_is_modified(blender::Object &b_ob)
41{
42 /* test if we can instance or if the object is modified */
43 if (b_ob.type == blender::OB_MBALL) {
44 /* Multi-user and dupli meta-balls are fused, can't instance. */
45 return true;
46 }
48 if ((blender::BKE_object_is_modified(b_scene, &b_ob) & settings) != 0) {
49 /* modifiers */
50 return true;
51 }
52
53 /* Object level material links. Note the geometry material slot array may not match
54 * the object matbits array, so we need to guard against out of bounds. */
55 for (const int i : blender::IndexRange(BKE_object_material_count_eval(&b_ob))) {
56 if (i < b_ob.totcol && b_ob.matbits && b_ob.matbits[i] != 0) {
57 return true;
58 }
59 }
60
61 return false;
62}
63
64bool BlenderSync::object_is_geometry(BObjectInfo &b_ob_info)
65{
66 blender::ID *b_ob_data = b_ob_info.object_data;
67
68 if (!b_ob_data) {
69 return false;
70 }
71
72 const blender::ObjectType type = b_ob_info.iter_object->type;
73
74 if (type == blender::OB_VOLUME || type == blender::OB_CURVES || type == blender::OB_POINTCLOUD ||
75 type == blender::OB_LAMP)
76 {
77 /* Will be exported as geometry. */
78 return true;
79 }
80
81 return b_ob_data->id_type() == blender::ID_ME;
82}
83
84bool BlenderSync::object_can_have_geometry(blender::Object &b_ob)
85{
86 using namespace blender;
87
88 /* Empties can generate geometry with geometry nodes modifiers. */
89 return OB_TYPE_IS_GEOMETRY(b_ob.type) || b_ob.type == OB_EMPTY;
90}
91
92bool BlenderSync::object_is_light(blender::Object &b_ob)
93{
94 blender::ID *b_ob_data = object_get_data(b_ob, true);
95
96 return (b_ob_data && b_ob_data->id_type() == blender::ID_LA);
97}
98
99bool BlenderSync::object_is_camera(blender::Object &b_ob)
100{
101 blender::ID *b_ob_data = object_get_data(b_ob, true);
102
103 return (b_ob_data && b_ob_data->id_type() == blender::ID_CA);
104}
105
106void BlenderSync::sync_object_motion_init(blender::Object &b_parent,
107 blender::Object &b_ob,
108 Object *object)
109{
110 /* Initialize motion blur for object, detecting if it's enabled and creating motion
111 * steps array if so. */
112 array<Transform> motion = object->get_motion();
113
114 Geometry *geom = object->get_geometry();
115 if (!geom) {
116 return;
117 }
118
119 int motion_steps = 0;
120 bool use_motion_blur = false;
121
122 const Scene::MotionType need_motion = scene->need_motion();
123 if (need_motion == Scene::MOTION_BLUR) {
124 motion_steps = object_motion_steps(b_parent, b_ob, Object::MAX_MOTION_STEPS);
125 if (motion_steps && object_use_deform_motion(b_parent, b_ob)) {
126 use_motion_blur = true;
127 }
128 }
129 else if (need_motion != Scene::MOTION_NONE) {
130 motion_steps = 3;
131 }
132
133 geom->set_use_motion_blur(use_motion_blur);
134
135 motion.resize(motion_steps, transform_empty());
136
137 if (motion_steps) {
138 motion[motion_steps / 2] = object->get_tfm();
139
140 /* update motion socket before trying to access object->motion_time */
141 object->set_motion(motion);
142
143 for (size_t step = 0; step < motion_steps; step++) {
144 motion_times.insert(object->motion_time(step));
145 }
146 }
147 else {
148 object->set_motion(motion);
149 }
150}
151
152Object *BlenderSync::sync_object(blender::ViewLayer &b_view_layer,
153 blender::Object &b_ob,
154 blender::DEGObjectIterData &b_deg_iter_data,
155 const float motion_time,
156 bool use_particle_hair,
157 bool show_lights,
158 BlenderObjectCulling &culling,
159 TaskPool *geom_task_pool)
160{
161 const bool is_instance = b_deg_iter_data.dupli_object_current;
162 blender::Object *b_parent = is_instance ? b_deg_iter_data.dupli_parent : &b_ob;
163 blender::Object *b_real_object = is_instance ? b_deg_iter_data.dupli_object_current->ob : &b_ob;
164 const bool use_adaptive_subdiv = object_subdivision_type(
165 *b_real_object, preview, use_adaptive_subdivision) !=
167 BObjectInfo b_ob_info{
168 &b_ob, b_real_object, object_get_data(b_ob, use_adaptive_subdiv), use_adaptive_subdiv};
169 const bool motion = motion_time != 0.0f;
170 const Transform tfm = get_transform(b_ob.object_to_world());
171 const int *persistent_id = nullptr;
172 if (is_instance) {
173 persistent_id = b_deg_iter_data.dupli_object_current->persistent_id;
174 if (!motion && !b_ob_info.is_real_object_data()) {
175 /* Remember which object data the geometry is coming from, so that we can sync it when the
176 * object has changed. */
177 instance_geometries_by_object[b_ob_info.real_object].insert(b_ob_info.object_data);
178 }
179 }
180
181 /* only interested in object that we can create geometry from */
182 if (!object_is_geometry(b_ob_info)) {
183 return nullptr;
184 }
185
186 /* Perform object culling. */
187 if (object_is_light(b_ob)) {
188 if (!show_lights) {
189 return nullptr;
190 }
191 }
192 else if (culling.test(scene, b_ob, tfm)) {
193 return nullptr;
194 }
195
196 /* Visibility flags for both parent and child. */
197 blender::PointerRNA b_ob_rna_ptr = RNA_id_pointer_create(&b_ob.id);
198 blender::PointerRNA cobject = RNA_pointer_get(&b_ob_rna_ptr, "cycles");
199 /* Note base_parent is null for objects from the background scene. */
200 const blender::Base *base_parent = BKE_view_layer_base_find(&b_view_layer, b_parent);
201 const bool use_holdout = (base_parent && (base_parent->flag & blender::BASE_HOLDOUT) != 0) ||
202 ((b_parent->visibility_flag & blender::OB_HOLDOUT) != 0);
203 PathRayVisibility visibility = object_ray_visibility(b_ob);
204
205 if (b_parent != &b_ob) {
206 visibility &= object_ray_visibility(*b_parent);
207 }
208
209 /* TODO: make holdout objects on excluded layer invisible for non-camera rays. */
210#if 0
211 if (use_holdout && (layer_flag & view_layer.exclude_layer)) {
212 visibility &= ~(PATH_RAY_VISIBILITY_OBJECT_ALL & ~PATH_RAY_VISIBILITY_CAMERA);
213 }
214#endif
215
216 /* Clear camera visibility for indirect only objects. */
217 const bool use_indirect_only = !use_holdout && base_parent &&
218 ((base_parent->flag & blender::BASE_INDIRECT_ONLY) != 0);
219 if (use_indirect_only) {
220 visibility &= ~PATH_RAY_VISIBILITY_CAMERA;
221 }
222
223 /* Don't export completely invisible objects. */
224 if (visibility == PATH_RAY_VISIBILITY_NONE) {
225 return nullptr;
226 }
227
228 /* Use task pool only for non-instances, since sync_dupli_particle accesses
229 * geometry. This restriction should be removed for better performance. */
230 TaskPool *object_geom_task_pool = (is_instance) ? nullptr : geom_task_pool;
231
232 /* key to lookup object */
233 const ObjectKey key(b_parent, persistent_id, b_ob_info.real_object, use_particle_hair);
234 Object *object;
235
236 /* motion vector case */
237 if (motion) {
238 object = object_map.find(key);
239
240 if (object && object->use_motion()) {
241 /* Set transform at matching motion time step. */
242 const int time_index = object->motion_step(motion_time);
243 if (time_index >= 0) {
244 object->set_motion_tfm(tfm, time_index);
245 }
246
247 /* mesh deformation */
248 if (object->get_geometry()) {
249 sync_geometry_motion(
250 b_ob_info, object, motion_time, use_particle_hair, object_geom_task_pool);
251 }
252 }
253
254 return object;
255 }
256
257 /* test if we need to sync */
258 bool object_updated = object_map.add_or_update(&object, &b_ob.id, &b_parent->id, key) ||
259 !object->tfm_equals(tfm);
260
261 /* mesh sync */
262 Geometry *geometry = sync_geometry(
263 b_ob_info, object_updated, use_particle_hair, object_geom_task_pool);
264 object->set_geometry(geometry);
265
266 /* special case not tracked by object update flags */
267
268 if (sync_object_attributes(b_ob, b_deg_iter_data, object)) {
269 object_updated = true;
270 }
271
272 /* holdout */
273 object->set_use_holdout(use_holdout);
274
275 object->set_visibility(visibility);
276
277 object->set_is_shadow_catcher((b_ob.visibility_flag & blender::OB_SHADOW_CATCHER) != 0 ||
279
280 object->set_shadow_terminator_shading_offset(b_ob.shadow_terminator_shading_offset);
281
282 object->set_shadow_terminator_geometry_offset(b_ob.shadow_terminator_geometry_offset);
283
284 float ao_distance = get_float(cobject, "ao_distance");
285 if (ao_distance == 0.0f && b_parent != &b_ob) {
286 blender::PointerRNA b_parent_rna_ptr = RNA_id_pointer_create(&b_parent->id);
287 blender::PointerRNA cparent = RNA_pointer_get(&b_parent_rna_ptr, "cycles");
288 ao_distance = get_float(cparent, "ao_distance");
289 }
290 object->set_ao_distance(ao_distance);
291
292 const bool is_caustics_caster = get_boolean(cobject, "is_caustics_caster");
293 object->set_is_caustics_caster(is_caustics_caster);
294
295 const bool is_caustics_receiver = get_boolean(cobject, "is_caustics_receiver");
296 object->set_is_caustics_receiver(is_caustics_receiver);
297
298 object->set_is_bake_target(b_ob_info.real_object == b_bake_target);
299
300 /* sync the asset name for Cryptomatte */
301 blender::Object *parent = b_ob.parent;
302 ustring parent_name;
303 if (parent) {
304 while (parent->parent) {
305 parent = parent->parent;
306 }
307 parent_name = BKE_id_name(parent->id);
308 }
309 else {
310 parent_name = BKE_id_name(b_ob.id);
311 }
312 object->set_asset_name(parent_name);
313
314 /* object sync
315 * transform comparison should not be needed, but duplis don't work perfect
316 * in the depsgraph and may not signal changes, so this is a workaround */
317 const bool do_sync = object->is_modified() || object_updated ||
318 (object->get_geometry() && object->get_geometry()->is_modified());
319 if (do_sync) {
320 object->name = BKE_id_name(b_ob.id);
321 object->set_pass_id(b_ob.index);
322 const float *object_color = b_ob.color;
323 object->set_color(make_float3(object_color[0], object_color[1], object_color[2]));
324 object->set_alpha(object_color[3]);
325 object->set_tfm(tfm);
326
327 /* dupli texture coordinates and random_id */
328 if (is_instance) {
329 const float *orco = b_deg_iter_data.dupli_object_current->orco;
330 object->set_dupli_generated(0.5f * make_float3(orco[0], orco[1], orco[2]) -
331 make_float3(0.5f, 0.5f, 0.5f));
332 const float *uv = b_deg_iter_data.dupli_object_current->uv;
333 object->set_dupli_uv(make_float2(uv[0], uv[1]));
334 object->set_random_id(b_deg_iter_data.dupli_object_current->random_id);
335 }
336 else {
337 object->set_dupli_generated(zero_float3());
338 object->set_dupli_uv(zero_float2());
339 object->set_random_id(hash_uint2(hash_string(object->name.c_str()), 0));
340 }
341
342 /* Light group and linking. */
343 string lightgroup = b_ob.lightgroup ? b_ob.lightgroup->name : "";
344 if (lightgroup.empty()) {
345 lightgroup = b_parent->lightgroup ? b_parent->lightgroup->name : "";
346 }
347 object->set_lightgroup(ustring(lightgroup));
348
349 object->set_light_set_membership(BlenderLightLink::get_light_set_membership(b_parent, b_ob));
350 object->set_receiver_light_set(BlenderLightLink::get_receiver_light_set(b_parent, b_ob));
351 object->set_shadow_set_membership(BlenderLightLink::get_shadow_set_membership(b_parent, b_ob));
352 object->set_blocker_shadow_set(BlenderLightLink::get_blocker_shadow_set(b_parent, b_ob));
353 }
354
355 sync_object_motion_init(*b_parent, b_ob, object);
356
357 if (do_sync || object->motion_is_modified()) {
358 object->tag_update(scene);
359 }
360
361 if (is_instance) {
362 /* Sync possible particle data. */
363 sync_dupli_particle(*b_parent, b_deg_iter_data, b_ob, object);
364 }
365
366 return object;
367}
368
370 blender::DEGObjectIterData &b_deg_iter_data,
371 const string &name,
372 bool use_instancer)
373{
374 blender::DupliObject *dupli = nullptr;
375 blender::Object *dupli_parent = nullptr;
376
377 /* If requesting instance data, check the parent particle system and object. */
378 if (use_instancer && b_deg_iter_data.dupli_object_current) {
379 dupli = b_deg_iter_data.dupli_object_current;
380 dupli_parent = b_deg_iter_data.dupli_parent;
381 }
382
383 float4 value;
384 BKE_object_dupli_find_rgba_attribute(&ob, dupli, dupli_parent, name.c_str(), &value.x);
385
386 return value;
387}
388
389bool BlenderSync::sync_object_attributes(blender::Object &b_ob,
390 blender::DEGObjectIterData &b_deg_iter_data,
391 Object *object)
392{
393 /* Find which attributes are needed. */
394 AttributeRequestSet requests = object->get_geometry()->needed_attributes();
395
396 /* Delete attributes that became unnecessary. */
397 vector<ParamValue> &attributes = object->attributes;
398 bool changed = false;
399
400 for (int i = attributes.size() - 1; i >= 0; i--) {
401 if (!requests.find(attributes[i].name())) {
402 attributes.erase(attributes.begin() + i);
403 changed = true;
404 }
405 }
406
407 /* Update attribute values. */
408 for (const AttributeRequest &req : requests.requests) {
409 const ustring name = req.name;
410
411 std::string real_name;
412 const int type = blender_attribute_name_split_type(name, &real_name);
413
415 const bool use_instancer = (type == blender::SHD_ATTRIBUTE_INSTANCER);
416 float4 value = lookup_instance_property(b_ob, b_deg_iter_data, real_name, use_instancer);
417
418 /* Try finding the existing attribute value. */
419 ParamValue *param = nullptr;
420
421 for (size_t i = 0; i < attributes.size(); i++) {
422 if (attributes[i].name() == name) {
423 param = &attributes[i];
424 break;
425 }
426 }
427
428 /* Replace or add the value. */
429 const ParamValue new_param(name, TypeFloat4, 1, &value);
430 assert(new_param.datasize() == sizeof(value));
431
432 if (!param) {
433 changed = true;
434 attributes.push_back(new_param);
435 }
436 else {
437 /* Cannot use param->get<float4>, ParamValue storage is not guaranteed to be aligned. */
438 const float *param_data = static_cast<const float *>(param->data());
439 if (make_float4(param_data[0], param_data[1], param_data[2], param_data[3]) != value) {
440 changed = true;
441 *param = new_param;
442 }
443 }
444 }
445 }
446
447 return changed;
448}
449
450/* Object Loop */
451
452void BlenderSync::sync_objects(blender::Depsgraph &b_depsgraph,
453 blender::bScreen *b_screen,
454 blender::View3D *b_v3d,
455 const float motion_time)
456{
457 /* Task pool for multithreaded geometry sync. */
458 TaskPool geom_task_pool;
459
460 /* layer data */
461 const bool motion = motion_time != 0.0f;
462
463 if (!motion) {
464 /* prepare for sync */
465 geometry_map.pre_sync();
466 object_map.pre_sync();
467 procedural_map.pre_sync();
468 particle_system_map.pre_sync();
469 motion_times.clear();
470 }
471 else {
472 geometry_motion_synced.clear();
473 }
474
475 if (!motion) {
476 /* Object to geometry instance mapping is built for the reference time, as other
477 * times just look up the corresponding geometry. */
478 instance_geometries_by_object.clear();
479 }
480
481 /* initialize culling */
482 BlenderObjectCulling culling(scene, *b_scene);
483
484 /* object loop */
485 bool cancel = false;
486 const bool show_lights =
487 BlenderViewportParameters(b_screen, b_v3d, use_developer_ui).use_scene_lights;
488
489 blender::ViewLayer &b_view_layer = *DEG_get_evaluated_view_layer(&b_depsgraph);
490
491 BKE_view_layer_synced_ensure(*b_data, b_scene, &b_view_layer);
492
493 blender::DEGObjectIterSettings deg_iter_settings{};
494 deg_iter_settings.depsgraph = &b_depsgraph;
496 blender::DEGObjectIterData deg_iter_data{};
497 deg_iter_data.settings = &deg_iter_settings;
498 deg_iter_data.graph = deg_iter_settings.depsgraph;
499 deg_iter_data.flag = deg_iter_settings.flags;
500
504 &deg_iter_data,
505 blender::Object *,
506 b_ob)
507 {
508 /* Viewport visibility. */
509 const bool show_in_viewport = !b_v3d || BKE_object_is_visible_in_viewport(b_v3d, b_ob);
510 if (show_in_viewport == false) {
511 continue;
512 }
513
514 /* Load per-object culling data. */
515 culling.init_object(scene, *b_ob);
516
517 const int ob_visibility = BKE_object_visibility(b_ob, deg_iter_data.eval_mode);
518
519 /* Ensure the object geom supporting the hair is processed before adding
520 * the hair processing task to the task pool, calling .to_mesh() on the
521 * same object in parallel does not work. */
522 const bool sync_hair = (ob_visibility & blender::OB_VISIBLE_PARTICLES) != 0 &&
523 object_has_particle_hair(b_ob);
524
525 /* Object itself. */
526 if ((ob_visibility & blender::OB_VISIBLE_SELF) != 0) {
527 sync_object(b_view_layer,
528 *b_ob,
529 deg_iter_data,
530 motion_time,
531 false,
532 show_lights,
533 culling,
534 sync_hair ? nullptr : &geom_task_pool);
535 }
536
537 /* Particle hair as separate object. */
538 if (sync_hair) {
539 sync_object(b_view_layer,
540 *b_ob,
541 deg_iter_data,
542 motion_time,
543 true,
544 show_lights,
545 culling,
546 &geom_task_pool);
547 }
548
549 cancel = progress.get_cancel();
550 if (cancel) {
551 break;
552 }
553 }
554 ITER_END;
555
556 geom_task_pool.wait_work();
557
558 progress.set_sync_status("");
559
560 if (!cancel && !motion) {
561 /* After object for world_use_portal. */
562 sync_background_light(b_screen, b_v3d);
563
564 /* Handle removed data and modified pointers, as this may free memory, delete Nodes in the
565 * right order to ensure that dependent data is freed after their users. Objects should be
566 * freed before particle systems and geometries. */
567 object_map.post_sync();
568 geometry_map.post_sync();
569 particle_system_map.post_sync();
570 procedural_map.post_sync();
571 }
572
573 if (motion) {
574 geometry_motion_synced.clear();
575 }
576}
577
578void BlenderSync::sync_objects_and_motion(blender::RenderData &b_render,
579 blender::Depsgraph &b_depsgraph,
580 blender::bScreen *b_screen,
581 blender::View3D *b_v3d,
582 blender::RegionView3D *b_rv3d,
583 const int width,
584 const int height)
585{
586 /* get camera object here to deal with camera switch */
587 blender::Object *b_cam = get_camera_object(b_v3d, b_rv3d);
588
589 const int frame_center = b_scene->r.cfra;
590 const float subframe_center = b_scene->r.subframe;
591 float frame_center_delta = 0.0f;
592
593 if (scene->need_motion() == Scene::MOTION_BLUR &&
594 scene->camera->get_motion_position() != MOTION_POSITION_CENTER)
595 {
596 const float shuttertime = scene->camera->get_shuttertime();
597 if (scene->camera->get_motion_position() == MOTION_POSITION_END) {
598 frame_center_delta = -shuttertime * 0.5f;
599 }
600 else {
601 assert(scene->camera->get_motion_position() == MOTION_POSITION_START);
602 frame_center_delta = shuttertime * 0.5f;
603 }
604
605 const float time = frame_center + subframe_center + frame_center_delta;
606 const int frame = (int)floorf(time);
607 const float subframe = time - frame;
608 RE_engine_frame_set(b_engine, frame, subframe);
609 if (b_cam) {
610 sync_camera_motion(b_render, b_cam, width, height, 0.0f);
611 }
612 }
613
614 sync_objects(b_depsgraph, b_screen, b_v3d);
615
616 /* In the viewport, only motion between previous frame and current frame is of interest, which is
617 * kept updated separately. */
618 if (b_v3d) {
619 assert(scene->need_motion() == Scene::MOTION_NONE ||
620 scene->need_motion() == Scene::MOTION_PASS_INTERACTIVE);
621 return;
622 }
623
624 if (scene->need_motion() == Scene::MOTION_NONE) {
625 return;
626 }
627
628 /* Insert motion times from camera. Motion times from other objects
629 * have already been added in a sync_objects call. */
630 if (b_cam) {
631 const uint camera_motion_steps = object_motion_steps(*b_cam, *b_cam);
632 for (size_t step = 0; step < camera_motion_steps; step++) {
633 motion_times.insert(scene->camera->motion_time(step));
634 }
635 }
636
637 /* Check which geometry already has motion blur so it can be skipped. */
638 geometry_motion_attribute_synced.clear();
639 for (Geometry *geom : scene->geometry) {
640 const Attribute *attr_P = geom->attributes.find(ATTR_STD_POSITION);
641 if (attr_P && attr_P->has_motion()) {
642 geometry_motion_attribute_synced.insert(geom);
643 }
644 }
645
646 /* note iteration over motion_times set happens in sorted order */
647 for (const float relative_time : motion_times) {
648 /* center time is already handled. */
649 if (relative_time == 0.0f) {
650 continue;
651 }
652
653 LOG_DEBUG << "Synchronizing motion for the relative time " << relative_time << ".";
654
655 /* fixed shutter time to get previous and next frame for motion pass */
656 const float shuttertime = scene->motion_shutter_time();
657
658 /* compute frame and subframe time */
659 const float time = frame_center + subframe_center + frame_center_delta +
660 relative_time * shuttertime * 0.5f;
661 const int frame = (int)floorf(time);
662 const float subframe = time - frame;
663
664 /* change frame */
665 RE_engine_frame_set(b_engine, frame, subframe);
666
667 /* Syncs camera motion if relative_time is one of the camera's motion times. */
668 sync_camera_motion(b_render, b_cam, width, height, relative_time);
669
670 /* sync object */
671 sync_objects(b_depsgraph, b_screen, b_v3d, relative_time);
672 }
673
674 geometry_motion_attribute_synced.clear();
675
676 /* Restore the frame that was current before motion synchronization. */
677 RE_engine_frame_set(b_engine, frame_center, subframe_center);
678}
679
General operations, lookup, etc. for materials.
General operations, lookup, etc. for blender objects.
#define ITER_END
#define ITER_BEGIN(callback_begin, callback_next, callback_end, _data_in, _type, _instance)
#define DEG_OBJECT_ITER_FOR_RENDER_ENGINE_FLAGS
#define OB_TYPE_IS_GEOMETRY(_type)
static float4 lookup_instance_property(blender::Object &ob, blender::DEGObjectIterData &b_deg_iter_data, const string &name, bool use_instancer)
int blender_attribute_name_split_type(ustring name, string *r_real_name)
vector< AttributeRequest > requests
bool find(ustring name) const
Attribute * find(ustring name) const
bool has_motion() const
bool test(Scene *scene, blender::Object &b_ob, const Transform &tfm)
void init_object(Scene *scene, blender::Object &b_ob)
AttributeSet attributes
@ SUBDIVISION_NONE
Definition scene/mesh.h:114
static const uint MAX_MOTION_STEPS
MotionType
Definition scene.h:207
@ MOTION_NONE
Definition scene.h:207
@ MOTION_BLUR
Definition scene.h:207
@ MOTION_PASS_INTERACTIVE
Definition scene.h:207
void wait_work(Summary *stats=nullptr)
Definition task.cpp:27
T * resize(const size_t newsize)
#define CCL_NAMESPACE_END
ccl_device_forceinline float3 make_float3(const float x, const float y, const float z)
uint hash_uint2(uint kx, uint ky)
#define assert(assertion)
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
VecBase< float, 4 > float4
ccl_device_inline float3 object_color(KernelGlobals kg, const int object)
uint32_t PathRayVisibility
@ PATH_RAY_VISIBILITY_OBJECT_ALL
@ PATH_RAY_VISIBILITY_NONE
@ MOTION_POSITION_END
@ MOTION_POSITION_START
@ MOTION_POSITION_CENTER
@ ATTR_STD_POSITION
#define LOG_DEBUG
Definition log.h:107
CCL_NAMESPACE_BEGIN ccl_device_inline float2 zero_float2()
Definition math_float2.h:13
CCL_NAMESPACE_BEGIN ccl_device_inline float3 zero_float3()
Definition math_float3.h:17
std::string time(const std::tm &date_time, TimeFormat format=TimeFormat::H24)
int BKE_object_material_count_eval(const Object *ob)
unsigned int uint
Definition BKE_text.h:55
PointerRNA RNA_id_pointer_create(ID *id)
void DEG_iterator_objects_next(BLI_Iterator *iter)
@ SHD_ATTRIBUTE_INSTANCER
@ SHD_ATTRIBUTE_OBJECT
int BKE_object_is_modified(Scene *scene, Object *ob)
Definition object.cc:4932
bool BKE_object_dupli_find_rgba_attribute(const Object *ob, const DupliObject *dupli, const Object *dupli_parent, const char *name, float r_value[4])
const char * BKE_id_name(const ID &id)
int BKE_object_visibility(const Object *ob, int dag_eval_mode)
Definition object.cc:2063
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
ViewLayer * DEG_get_evaluated_view_layer(const Depsgraph *graph)
void DEG_iterator_objects_end(BLI_Iterator *iter)
void RE_engine_frame_set(RenderEngine *engine, int frame, float subframe)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
bool BKE_object_is_visible_in_viewport(const View3D *v3d, const Object *ob)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
constexpr uint64_t hash_string(StringRef str)
Definition BLI_hash.hh:183
void DEG_iterator_objects_begin(BLI_Iterator *iter, DEGObjectIterData *data)
@ OB_VISIBLE_PARTICLES
@ OB_VISIBLE_SELF
void visibility(Visibility &srt, const ViewCulling &culling, const uint3 global_id, const uint3 local_id, const uint3 workgroup_id)
#define floorf
#define make_float2
#define make_float4
blender::Object * iter_object
bool is_real_object_data() const
blender::ID * object_data
blender::Object * real_object
DEGObjectIterSettings * settings
int persistent_id[MAX_DUPLI_RECUR]
struct Object * parent
float shadow_terminator_shading_offset
float shadow_terminator_geometry_offset
eObject_VisibilityFlag visibility_flag
struct LightgroupMembership * lightgroup
float x
Definition sky_math.h:225
ccl_device_inline Transform transform_empty()
Definition transform.h:449