本文整理汇总了C++中bl::Object::pass_index方法的典型用法代码示例。如果您正苦于以下问题:C++ Object::pass_index方法的具体用法?C++ Object::pass_index怎么用?C++ Object::pass_index使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bl::Object
的用法示例。
在下文中一共展示了Object::pass_index方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sync_object
void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob, Transform& tfm, uint layer_flag)
{
/* light is handled separately */
if(object_is_light(b_ob)) {
sync_light(b_parent, b_index, b_ob, tfm);
return;
}
/* only interested in object that we can create meshes from */
if(!object_is_mesh(b_ob))
return;
/* test if we need to sync */
ObjectKey key(b_parent, b_index, b_ob);
Object *object;
bool object_updated = false;
if(object_map.sync(&object, b_ob, b_parent, key))
object_updated = true;
/* holdout? */
bool holdout = (layer_flag & render_layer.holdout_layer) != 0;
/* mesh sync */
object->mesh = sync_mesh(b_ob, holdout, object_updated);
/* object sync */
if(object_updated || (object->mesh && object->mesh->need_update)) {
object->name = b_ob.name().c_str();
object->pass_id = b_ob.pass_index();
object->tfm = tfm;
/* visibility flags for both parent */
object->visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL;
if(b_parent.ptr.data != b_ob.ptr.data)
object->visibility &= object_ray_visibility(b_parent);
/* camera flag is not actually used, instead is tested
against render layer flags */
if(object->visibility & PATH_RAY_CAMERA) {
object->visibility |= layer_flag << PATH_RAY_LAYER_SHIFT;
object->visibility &= ~PATH_RAY_CAMERA;
}
object->tag_update(scene);
}
}
示例2: sync_object
void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob, Transform& tfm, uint layer_flag, int motion)
{
/* light is handled separately */
if(object_is_light(b_ob)) {
if(!motion)
sync_light(b_parent, b_index, b_ob, tfm);
return;
}
/* only interested in object that we can create meshes from */
if(!object_is_mesh(b_ob))
return;
/* key to lookup object */
ObjectKey key(b_parent, b_index, b_ob);
Object *object;
/* motion vector case */
if(motion) {
object = object_map.find(key);
if(object) {
if(tfm != object->tfm) {
if(motion == -1)
object->motion.pre = tfm;
else
object->motion.post = tfm;
object->use_motion = true;
}
sync_mesh_motion(b_ob, object->mesh, motion);
}
return;
}
/* test if we need to sync */
bool object_updated = false;
if(object_map.sync(&object, b_ob, b_parent, key))
object_updated = true;
bool use_holdout = (layer_flag & render_layer.holdout_layer) != 0;
/* mesh sync */
object->mesh = sync_mesh(b_ob, object_updated);
if(use_holdout != object->use_holdout) {
object->use_holdout = use_holdout;
scene->object_manager->tag_update(scene);
}
/* object sync */
if(object_updated || (object->mesh && object->mesh->need_update)) {
object->name = b_ob.name().c_str();
object->pass_id = b_ob.pass_index();
object->tfm = tfm;
object->motion.pre = tfm;
object->motion.post = tfm;
object->use_motion = false;
/* visibility flags for both parent */
object->visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL;
if(b_parent.ptr.data != b_ob.ptr.data)
object->visibility &= object_ray_visibility(b_parent);
/* camera flag is not actually used, instead is tested
against render layer flags */
if(object->visibility & PATH_RAY_CAMERA) {
object->visibility |= layer_flag << PATH_RAY_LAYER_SHIFT;
object->visibility &= ~PATH_RAY_CAMERA;
}
object->tag_update(scene);
}
}