Blender  V2.93
blender_object.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2013 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "render/camera.h"
18 #include "render/graph.h"
19 #include "render/integrator.h"
20 #include "render/light.h"
21 #include "render/mesh.h"
22 #include "render/nodes.h"
23 #include "render/object.h"
24 #include "render/particles.h"
25 #include "render/scene.h"
26 #include "render/shader.h"
27 
29 #include "blender/blender_sync.h"
30 #include "blender/blender_util.h"
31 
32 #include "util/util_foreach.h"
33 #include "util/util_hash.h"
34 #include "util/util_logging.h"
35 #include "util/util_task.h"
36 
38 
39 /* Utilities */
40 
41 bool BlenderSync::BKE_object_is_modified(BL::Object &b_ob)
42 {
43  /* test if we can instance or if the object is modified */
44  if (b_ob.type() == BL::Object::type_META) {
45  /* multi-user and dupli metaballs are fused, can't instance */
46  return true;
47  }
48  else if (ccl::BKE_object_is_modified(b_ob, b_scene, preview)) {
49  /* modifiers */
50  return true;
51  }
52  else {
53  /* object level material links */
54  for (BL::MaterialSlot &b_slot : b_ob.material_slots) {
55  if (b_slot.link() == BL::MaterialSlot::link_OBJECT) {
56  return true;
57  }
58  }
59  }
60 
61  return false;
62 }
63 
64 bool BlenderSync::object_is_geometry(BL::Object &b_ob)
65 {
66  BL::ID b_ob_data = b_ob.data();
67 
68  if (!b_ob_data) {
69  return false;
70  }
71 
72  BL::Object::type_enum type = b_ob.type();
73 
74  if (type == BL::Object::type_VOLUME || type == BL::Object::type_HAIR) {
75  /* Will be exported attached to mesh. */
76  return true;
77  }
78  else if (type == BL::Object::type_CURVE) {
79  /* Skip exporting curves without faces, overhead can be
80  * significant if there are many for path animation. */
81  BL::Curve b_curve(b_ob_data);
82 
83  return (b_curve.bevel_object() || b_curve.extrude() != 0.0f || b_curve.bevel_depth() != 0.0f ||
84  b_curve.dimensions() == BL::Curve::dimensions_2D || b_ob.modifiers.length());
85  }
86  else {
87  return (b_ob_data.is_a(&RNA_Mesh) || b_ob_data.is_a(&RNA_Curve) ||
88  b_ob_data.is_a(&RNA_MetaBall));
89  }
90 }
91 
92 bool BlenderSync::object_is_light(BL::Object &b_ob)
93 {
94  BL::ID b_ob_data = b_ob.data();
95 
96  return (b_ob_data && b_ob_data.is_a(&RNA_Light));
97 }
98 
99 void BlenderSync::sync_object_motion_init(BL::Object &b_parent, BL::Object &b_ob, Object *object)
100 {
101  /* Initialize motion blur for object, detecting if it's enabled and creating motion
102  * steps array if so. */
103  array<Transform> motion;
104  object->set_motion(motion);
105 
106  Scene::MotionType need_motion = scene->need_motion();
107  if (need_motion == Scene::MOTION_NONE || !object->get_geometry()) {
108  return;
109  }
110 
111  Geometry *geom = object->get_geometry();
112 
113  int motion_steps = 0;
114  bool use_motion_blur = false;
115 
116  if (need_motion == Scene::MOTION_BLUR) {
117  motion_steps = object_motion_steps(b_parent, b_ob, Object::MAX_MOTION_STEPS);
118  if (motion_steps && object_use_deform_motion(b_parent, b_ob)) {
119  use_motion_blur = true;
120  }
121  }
122  else {
123  motion_steps = 3;
124  }
125 
126  geom->set_use_motion_blur(use_motion_blur);
127  geom->set_motion_steps(motion_steps);
128 
129  motion.resize(motion_steps, transform_empty());
130 
131  if (motion_steps) {
132  motion[motion_steps / 2] = object->get_tfm();
133 
134  /* update motion socket before trying to access object->motion_time */
135  object->set_motion(motion);
136 
137  for (size_t step = 0; step < motion_steps; step++) {
138  motion_times.insert(object->motion_time(step));
139  }
140  }
141 }
142 
143 Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
144  BL::ViewLayer &b_view_layer,
145  BL::DepsgraphObjectInstance &b_instance,
146  float motion_time,
147  bool use_particle_hair,
148  bool show_lights,
149  BlenderObjectCulling &culling,
150  bool *use_portal,
151  TaskPool *geom_task_pool)
152 {
153  const bool is_instance = b_instance.is_instance();
154  BL::Object b_ob = b_instance.object();
155  BL::Object b_parent = is_instance ? b_instance.parent() : b_instance.object();
156  BL::Object b_ob_instance = is_instance ? b_instance.instance_object() : b_ob;
157  const bool motion = motion_time != 0.0f;
158  /*const*/ Transform tfm = get_transform(b_ob.matrix_world());
159  int *persistent_id = NULL;
160  BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id_array;
161  if (is_instance) {
162  persistent_id_array = b_instance.persistent_id();
163  persistent_id = persistent_id_array.data;
164  }
165 
166  /* light is handled separately */
167  if (!motion && object_is_light(b_ob)) {
168  if (!show_lights) {
169  return NULL;
170  }
171 
172  /* TODO: don't use lights for excluded layers used as mask layer,
173  * when dynamic overrides are back. */
174 #if 0
175  if (!((layer_flag & view_layer.holdout_layer) && (layer_flag & view_layer.exclude_layer)))
176 #endif
177  {
178  sync_light(b_parent,
179  persistent_id,
180  b_ob,
181  b_ob_instance,
182  is_instance ? b_instance.random_id() : 0,
183  tfm,
184  use_portal);
185  }
186 
187  return NULL;
188  }
189 
190  /* only interested in object that we can create meshes from */
191  if (!object_is_geometry(b_ob)) {
192  return NULL;
193  }
194 
195  /* Perform object culling. */
196  if (culling.test(scene, b_ob, tfm)) {
197  return NULL;
198  }
199 
200  /* Visibility flags for both parent and child. */
201  PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles");
202  bool use_holdout = get_boolean(cobject, "is_holdout") ||
203  b_parent.holdout_get(PointerRNA_NULL, b_view_layer);
205 
206  if (b_parent.ptr.data != b_ob.ptr.data) {
207  visibility &= object_ray_visibility(b_parent);
208  }
209 
210  /* TODO: make holdout objects on excluded layer invisible for non-camera rays. */
211 #if 0
212  if (use_holdout && (layer_flag & view_layer.exclude_layer)) {
213  visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA);
214  }
215 #endif
216 
217  /* Clear camera visibility for indirect only objects. */
218  bool use_indirect_only = !use_holdout &&
219  b_parent.indirect_only_get(PointerRNA_NULL, b_view_layer);
220  if (use_indirect_only) {
221  visibility &= ~PATH_RAY_CAMERA;
222  }
223 
224  /* Don't export completely invisible objects. */
225  if (visibility == 0) {
226  return NULL;
227  }
228 
229  /* Use task pool only for non-instances, since sync_dupli_particle accesses
230  * geometry. This restriction should be removed for better performance. */
231  TaskPool *object_geom_task_pool = (is_instance) ? NULL : geom_task_pool;
232 
233  /* key to lookup object */
234  ObjectKey key(b_parent, persistent_id, b_ob_instance, use_particle_hair);
235  Object *object;
236 
237  /* motion vector case */
238  if (motion) {
239  object = object_map.find(key);
240 
241  if (object && object->use_motion()) {
242  /* Set transform at matching motion time step. */
243  int time_index = object->motion_step(motion_time);
244  if (time_index >= 0) {
245  array<Transform> motion = object->get_motion();
246  motion[time_index] = tfm;
247  object->set_motion(motion);
248  }
249 
250  /* mesh deformation */
251  if (object->get_geometry())
252  sync_geometry_motion(b_depsgraph,
253  b_ob_instance,
254  object,
255  motion_time,
256  use_particle_hair,
257  object_geom_task_pool);
258  }
259 
260  return object;
261  }
262 
263  /* test if we need to sync */
264  bool object_updated = object_map.add_or_update(&object, b_ob, b_parent, key) ||
265  (tfm != object->get_tfm());
266 
267  /* mesh sync */
268  /* b_ob is owned by the iterator and will go out of scope at the end of the block.
269  * b_ob_instance is the original object and will remain valid for deferred geometry
270  * sync. */
271  Geometry *geometry = sync_geometry(b_depsgraph,
272  b_ob_instance,
273  b_ob_instance,
274  object_updated,
275  use_particle_hair,
276  object_geom_task_pool);
277  object->set_geometry(geometry);
278 
279  /* special case not tracked by object update flags */
280 
281  if (sync_object_attributes(b_instance, object)) {
282  object_updated = true;
283  }
284 
285  /* holdout */
286  object->set_use_holdout(use_holdout);
287 
288  object->set_visibility(visibility);
289 
290  bool is_shadow_catcher = get_boolean(cobject, "is_shadow_catcher");
291  object->set_is_shadow_catcher(is_shadow_catcher);
292 
293  float shadow_terminator_offset = get_float(cobject, "shadow_terminator_offset");
294  object->set_shadow_terminator_offset(shadow_terminator_offset);
295 
296  /* sync the asset name for Cryptomatte */
297  BL::Object parent = b_ob.parent();
298  ustring parent_name;
299  if (parent) {
300  while (parent.parent()) {
301  parent = parent.parent();
302  }
303  parent_name = parent.name();
304  }
305  else {
306  parent_name = b_ob.name();
307  }
308  object->set_asset_name(parent_name);
309 
310  /* object sync
311  * transform comparison should not be needed, but duplis don't work perfect
312  * in the depsgraph and may not signal changes, so this is a workaround */
313  if (object->is_modified() || object_updated ||
314  (object->get_geometry() && object->get_geometry()->is_modified())) {
315  object->name = b_ob.name().c_str();
316  object->set_pass_id(b_ob.pass_index());
317  object->set_color(get_float3(b_ob.color()));
318  object->set_tfm(tfm);
319 
320  /* dupli texture coordinates and random_id */
321  if (is_instance) {
322  object->set_dupli_generated(0.5f * get_float3(b_instance.orco()) -
323  make_float3(0.5f, 0.5f, 0.5f));
324  object->set_dupli_uv(get_float2(b_instance.uv()));
325  object->set_random_id(b_instance.random_id());
326  }
327  else {
328  object->set_dupli_generated(zero_float3());
329  object->set_dupli_uv(zero_float2());
330  object->set_random_id(hash_uint2(hash_string(object->name.c_str()), 0));
331  }
332 
333  object->tag_update(scene);
334  }
335 
336  sync_object_motion_init(b_parent, b_ob, object);
337 
338  if (is_instance) {
339  /* Sync possible particle data. */
340  sync_dupli_particle(b_parent, b_instance, object);
341  }
342 
343  return object;
344 }
345 
346 /* This function mirrors drw_uniform_property_lookup in draw_instance_data.cpp */
347 static bool lookup_property(BL::ID b_id, const string &name, float4 *r_value)
348 {
349  PointerRNA ptr;
350  PropertyRNA *prop;
351 
352  if (!RNA_path_resolve(&b_id.ptr, name.c_str(), &ptr, &prop)) {
353  return false;
354  }
355 
356  if (prop == NULL) {
357  return false;
358  }
359 
361  int arraylen = RNA_property_array_length(&ptr, prop);
362 
363  if (arraylen == 0) {
364  float value;
365 
366  if (type == PROP_FLOAT)
367  value = RNA_property_float_get(&ptr, prop);
368  else if (type == PROP_INT)
369  value = RNA_property_int_get(&ptr, prop);
370  else
371  return false;
372 
373  *r_value = make_float4(value, value, value, 1.0f);
374  return true;
375  }
376  else if (type == PROP_FLOAT && arraylen <= 4) {
377  *r_value = make_float4(0.0f, 0.0f, 0.0f, 1.0f);
378  RNA_property_float_get_array(&ptr, prop, &r_value->x);
379  return true;
380  }
381 
382  return false;
383 }
384 
385 /* This function mirrors drw_uniform_attribute_lookup in draw_instance_data.cpp */
386 static float4 lookup_instance_property(BL::DepsgraphObjectInstance &b_instance,
387  const string &name,
388  bool use_instancer)
389 {
390  string idprop_name = string_printf("[\"%s\"]", name.c_str());
391  float4 value;
392 
393  /* If requesting instance data, check the parent particle system and object. */
394  if (use_instancer && b_instance.is_instance()) {
395  BL::ParticleSystem b_psys = b_instance.particle_system();
396 
397  if (b_psys) {
398  if (lookup_property(b_psys.settings(), idprop_name, &value) ||
399  lookup_property(b_psys.settings(), name, &value)) {
400  return value;
401  }
402  }
403  if (lookup_property(b_instance.parent(), idprop_name, &value) ||
404  lookup_property(b_instance.parent(), name, &value)) {
405  return value;
406  }
407  }
408 
409  /* Check the object and mesh. */
410  BL::Object b_ob = b_instance.object();
411  BL::ID b_data = b_ob.data();
412 
413  if (lookup_property(b_ob, idprop_name, &value) || lookup_property(b_ob, name, &value) ||
414  lookup_property(b_data, idprop_name, &value) || lookup_property(b_data, name, &value)) {
415  return value;
416  }
417 
418  return make_float4(0.0f);
419 }
420 
421 bool BlenderSync::sync_object_attributes(BL::DepsgraphObjectInstance &b_instance, Object *object)
422 {
423  /* Find which attributes are needed. */
424  AttributeRequestSet requests = object->get_geometry()->needed_attributes();
425 
426  /* Delete attributes that became unnecessary. */
427  vector<ParamValue> &attributes = object->attributes;
428  bool changed = false;
429 
430  for (int i = attributes.size() - 1; i >= 0; i--) {
431  if (!requests.find(attributes[i].name())) {
432  attributes.erase(attributes.begin() + i);
433  changed = true;
434  }
435  }
436 
437  /* Update attribute values. */
438  foreach (AttributeRequest &req, requests.requests) {
439  ustring name = req.name;
440 
441  std::string real_name;
443 
444  if (type != BL::ShaderNodeAttribute::attribute_type_GEOMETRY) {
445  bool use_instancer = (type == BL::ShaderNodeAttribute::attribute_type_INSTANCER);
446  float4 value = lookup_instance_property(b_instance, real_name, use_instancer);
447 
448  /* Try finding the existing attribute value. */
449  ParamValue *param = NULL;
450 
451  for (size_t i = 0; i < attributes.size(); i++) {
452  if (attributes[i].name() == name) {
453  param = &attributes[i];
454  break;
455  }
456  }
457 
458  /* Replace or add the value. */
459  ParamValue new_param(name, TypeDesc::TypeFloat4, 1, &value);
460  assert(new_param.datasize() == sizeof(value));
461 
462  if (!param) {
463  changed = true;
464  attributes.push_back(new_param);
465  }
466  else if (memcmp(param->data(), &value, sizeof(value)) != 0) {
467  changed = true;
468  *param = new_param;
469  }
470  }
471  }
472 
473  return changed;
474 }
475 
476 /* Object Loop */
477 
478 void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
479  BL::SpaceView3D &b_v3d,
480  float motion_time)
481 {
482  /* Task pool for multithreaded geometry sync. */
483  TaskPool geom_task_pool;
484 
485  /* layer data */
486  bool motion = motion_time != 0.0f;
487 
488  if (!motion) {
489  /* prepare for sync */
490  light_map.pre_sync();
491  geometry_map.pre_sync();
492  object_map.pre_sync();
493  particle_system_map.pre_sync();
494  motion_times.clear();
495  }
496  else {
497  geometry_motion_synced.clear();
498  }
499 
500  /* initialize culling */
501  BlenderObjectCulling culling(scene, b_scene);
502 
503  /* object loop */
504  bool cancel = false;
505  bool use_portal = false;
506  const bool show_lights = BlenderViewportParameters(b_v3d).use_scene_lights;
507 
508  BL::ViewLayer b_view_layer = b_depsgraph.view_layer_eval();
509  BL::Depsgraph::object_instances_iterator b_instance_iter;
510 
511  for (b_depsgraph.object_instances.begin(b_instance_iter);
512  b_instance_iter != b_depsgraph.object_instances.end() && !cancel;
513  ++b_instance_iter) {
514  BL::DepsgraphObjectInstance b_instance = *b_instance_iter;
515  BL::Object b_ob = b_instance.object();
516 
517  /* Viewport visibility. */
518  const bool show_in_viewport = !b_v3d || b_ob.visible_in_viewport_get(b_v3d);
519  if (show_in_viewport == false) {
520  continue;
521  }
522 
523  /* Load per-object culling data. */
524  culling.init_object(scene, b_ob);
525 
526  /* Ensure the object geom supporting the hair is processed before adding
527  * the hair processing task to the task pool, calling .to_mesh() on the
528  * same object in parallel does not work. */
529  const bool sync_hair = b_instance.show_particles() && object_has_particle_hair(b_ob);
530 
531  /* Object itself. */
532  if (b_instance.show_self()) {
533  sync_object(b_depsgraph,
534  b_view_layer,
535  b_instance,
536  motion_time,
537  false,
538  show_lights,
539  culling,
540  &use_portal,
541  sync_hair ? NULL : &geom_task_pool);
542  }
543 
544  /* Particle hair as separate object. */
545  if (sync_hair) {
546  sync_object(b_depsgraph,
547  b_view_layer,
548  b_instance,
549  motion_time,
550  true,
551  show_lights,
552  culling,
553  &use_portal,
554  &geom_task_pool);
555  }
556 
557  cancel = progress.get_cancel();
558  }
559 
560  geom_task_pool.wait_work();
561 
562  progress.set_sync_status("");
563 
564  if (!cancel && !motion) {
565  sync_background_light(b_v3d, use_portal);
566 
567  /* handle removed data and modified pointers */
568  light_map.post_sync();
569  geometry_map.post_sync();
570  object_map.post_sync();
571  particle_system_map.post_sync();
572  }
573 
574  if (motion)
575  geometry_motion_synced.clear();
576 }
577 
578 void BlenderSync::sync_motion(BL::RenderSettings &b_render,
579  BL::Depsgraph &b_depsgraph,
580  BL::SpaceView3D &b_v3d,
581  BL::Object &b_override,
582  int width,
583  int height,
584  void **python_thread_state)
585 {
586  if (scene->need_motion() == Scene::MOTION_NONE)
587  return;
588 
589  /* get camera object here to deal with camera switch */
590  BL::Object b_cam = b_scene.camera();
591  if (b_override)
592  b_cam = b_override;
593 
594  int frame_center = b_scene.frame_current();
595  float subframe_center = b_scene.frame_subframe();
596  float frame_center_delta = 0.0f;
597 
598  if (scene->need_motion() != Scene::MOTION_PASS &&
599  scene->camera->get_motion_position() != Camera::MOTION_POSITION_CENTER) {
600  float shuttertime = scene->camera->get_shuttertime();
601  if (scene->camera->get_motion_position() == Camera::MOTION_POSITION_END) {
602  frame_center_delta = -shuttertime * 0.5f;
603  }
604  else {
605  assert(scene->camera->get_motion_position() == Camera::MOTION_POSITION_START);
606  frame_center_delta = shuttertime * 0.5f;
607  }
608 
609  float time = frame_center + subframe_center + frame_center_delta;
610  int frame = (int)floorf(time);
611  float subframe = time - frame;
612  python_thread_state_restore(python_thread_state);
613  b_engine.frame_set(frame, subframe);
614  python_thread_state_save(python_thread_state);
615  if (b_cam) {
616  sync_camera_motion(b_render, b_cam, width, height, 0.0f);
617  }
618  sync_objects(b_depsgraph, b_v3d);
619  }
620 
621  /* Insert motion times from camera. Motion times from other objects
622  * have already been added in a sync_objects call. */
623  if (b_cam) {
624  uint camera_motion_steps = object_motion_steps(b_cam, b_cam);
625  for (size_t step = 0; step < camera_motion_steps; step++) {
626  motion_times.insert(scene->camera->motion_time(step));
627  }
628  }
629 
630  /* note iteration over motion_times set happens in sorted order */
631  foreach (float relative_time, motion_times) {
632  /* center time is already handled. */
633  if (relative_time == 0.0f) {
634  continue;
635  }
636 
637  VLOG(1) << "Synchronizing motion for the relative time " << relative_time << ".";
638 
639  /* fixed shutter time to get previous and next frame for motion pass */
640  float shuttertime = scene->motion_shutter_time();
641 
642  /* compute frame and subframe time */
643  float time = frame_center + subframe_center + frame_center_delta +
644  relative_time * shuttertime * 0.5f;
645  int frame = (int)floorf(time);
646  float subframe = time - frame;
647 
648  /* change frame */
649  python_thread_state_restore(python_thread_state);
650  b_engine.frame_set(frame, subframe);
651  python_thread_state_save(python_thread_state);
652 
653  /* Syncs camera motion if relative_time is one of the camera's motion times. */
654  sync_camera_motion(b_render, b_cam, width, height, relative_time);
655 
656  /* sync object */
657  sync_objects(b_depsgraph, b_v3d, relative_time);
658  }
659 
660  /* we need to set the python thread state again because this
661  * function assumes it is being executed from python and will
662  * try to save the thread state */
663  python_thread_state_restore(python_thread_state);
664  b_engine.frame_set(frame_center, subframe_center);
665  python_thread_state_save(python_thread_state);
666 }
667 
int BKE_object_is_modified(struct Scene *scene, struct Object *ob)
Definition: object.c:4869
unsigned int uint
Definition: BLI_sys_types.h:83
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
struct ID ID
struct Curve Curve
struct ViewLayer ViewLayer
struct Object Object
struct ParticleSystem ParticleSystem
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
StructRNA RNA_MetaBall
StructRNA RNA_Curve
StructRNA RNA_Mesh
StructRNA RNA_Light
PropertyType
Definition: RNA_types.h:72
@ PROP_FLOAT
Definition: RNA_types.h:75
@ PROP_INT
Definition: RNA_types.h:74
static float4 lookup_instance_property(BL::DepsgraphObjectInstance &b_instance, const string &name, bool use_instancer)
static bool lookup_property(BL::ID b_id, const string &name, float4 *r_value)
void python_thread_state_restore(void **python_thread_state)
void python_thread_state_save(void **python_thread_state)
BlenderAttributeType blender_attribute_name_split_type(ustring name, string *r_real_name)
static uint object_ray_visibility(BL::Object &b_ob)
Definition: blender_util.h:597
static uint object_motion_steps(BL::Object &b_parent, BL::Object &b_ob, const int max_steps=INT_MAX)
Definition: blender_util.h:489
static float get_float(PointerRNA &ptr, const char *name)
Definition: blender_util.h:359
static bool get_boolean(PointerRNA &ptr, const char *name)
Definition: blender_util.h:349
static float3 get_float3(const BL::Array< float, 2 > &array)
Definition: blender_util.h:295
CCL_NAMESPACE_BEGIN typedef BL::ShaderNodeAttribute::attribute_type_enum BlenderAttributeType
Definition: blender_util.h:43
static float2 get_float2(const BL::Array< float, 2 > &array)
Definition: blender_util.h:290
static Transform get_transform(const BL::Array< float, 16 > &array)
Definition: blender_util.h:277
static bool object_use_deform_motion(BL::Object &b_parent, BL::Object &b_ob)
Definition: blender_util.h:522
vector< AttributeRequest > requests
Definition: attribute.h:235
bool find(ustring name)
Definition: attribute.cpp:816
void init_object(Scene *scene, BL::Object &b_ob)
bool test(Scene *scene, BL::Object &b_ob, Transform &tfm)
bool get_cancel()
void set_sync_status(const string &status_, const string &substatus_="")
T * resize(size_t newsize)
Definition: util_array.h:150
bool add_or_update(T **r_data, const BL::ID &id)
void pre_sync()
T * find(const BL::ID &id)
void post_sync(bool do_delete=true)
double time
#define CCL_NAMESPACE_END
#define floorf(x)
#define make_float4(x, y, z, w)
#define make_float3(x, y, z)
@ PATH_RAY_ALL_VISIBILITY
Definition: kernel_types.h:295
@ PATH_RAY_CAMERA
Definition: kernel_types.h:266
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:2941
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
Definition: rna_access.c:3033
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6562
PropertyType RNA_property_type(PropertyRNA *prop)
Definition: rna_access.c:1155
const PointerRNA PointerRNA_NULL
Definition: rna_access.c:71
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:2607
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:1218
bool RNA_path_resolve(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
Definition: rna_access.c:5400
@ MOTION_POSITION_START
Definition: camera.h:49
@ MOTION_POSITION_CENTER
Definition: camera.h:51
@ MOTION_POSITION_END
Definition: camera.h:53
bool is_modified()
Definition: node.cpp:781
ustring name
Definition: node.h:174
int motion_step(float time) const
Definition: object.cpp:248
bool use_motion() const
Definition: object.cpp:238
static const uint MAX_MOTION_STEPS
Definition: object.h:91
struct Object * parent
float motion_time(int step) const
Definition: object.cpp:243
MotionType need_motion()
Definition: scene.cpp:358
MotionType
Definition: scene.h:280
@ MOTION_PASS
Definition: scene.h:280
@ MOTION_NONE
Definition: scene.h:280
@ MOTION_BLUR
Definition: scene.h:280
struct Object * camera
float motion_shutter_time()
Definition: scene.cpp:368
void wait_work(Summary *stats=NULL)
Definition: util_task.cpp:42
static uint hash_string(const char *str)
Definition: util_hash.h:376
ccl_device_inline uint hash_uint2(uint kx, uint ky)
Definition: util_hash.h:83
#define VLOG(severity)
Definition: util_logging.h:50
ccl_device_inline float2 zero_float2()
ccl_device_inline float3 zero_float3()
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
Definition: util_string.cpp:32
ccl_device_inline Transform transform_empty()
PointerRNA * ptr
Definition: wm_files.c:3157