本文整理汇总了C++中bl::Object::parent方法的典型用法代码示例。如果您正苦于以下问题:C++ Object::parent方法的具体用法?C++ Object::parent怎么用?C++ Object::parent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bl::Object
的用法示例。
在下文中一共展示了Object::parent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: object_render_hide
static bool object_render_hide(BL::Object b_ob, bool top_level, bool parent_hide, bool& hide_triangles)
{
/* check if we should render or hide particle emitter */
BL::Object::particle_systems_iterator b_psys;
bool hair_present = false;
bool show_emitter = false;
bool hide = false;
for(b_ob.particle_systems.begin(b_psys); b_psys != b_ob.particle_systems.end(); ++b_psys) {
if((b_psys->settings().render_type() == BL::ParticleSettings::render_type_PATH) &&
(b_psys->settings().type()==BL::ParticleSettings::type_HAIR))
hair_present = true;
if(b_psys->settings().use_render_emitter()) {
hide = false;
show_emitter = true;
}
}
/* duplicators hidden by default, except dupliframes which duplicate self */
if(b_ob.is_duplicator())
if(top_level || b_ob.dupli_type() != BL::Object::dupli_type_FRAMES)
hide = true;
/* hide original object for duplis */
BL::Object parent = b_ob.parent();
if(parent && object_render_hide_original(parent.dupli_type()))
if(parent_hide)
hide = true;
hide_triangles = (hair_present && !show_emitter);
return hide && !show_emitter;
}
示例2: key
Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
BL::ViewLayer &b_view_layer,
BL::DepsgraphObjectInstance &b_instance,
float motion_time,
bool show_self,
bool show_particles,
BlenderObjectCulling &culling,
bool *use_portal)
{
const bool is_instance = b_instance.is_instance();
BL::Object b_ob = b_instance.object();
BL::Object b_parent = is_instance ? b_instance.parent() : b_instance.object();
BL::Object b_ob_instance = is_instance ? b_instance.instance_object() : b_ob;
const bool motion = motion_time != 0.0f;
/*const*/ Transform tfm = get_transform(b_ob.matrix_world());
int *persistent_id = NULL;
BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id_array;
if (is_instance) {
persistent_id_array = b_instance.persistent_id();
persistent_id = persistent_id_array.data;
}
/* light is handled separately */
if (!motion && object_is_light(b_ob)) {
/* TODO: don't use lights for excluded layers used as mask layer,
* when dynamic overrides are back. */
#if 0
if (!((layer_flag & view_layer.holdout_layer) && (layer_flag & view_layer.exclude_layer)))
#endif
{
sync_light(b_parent,
persistent_id,
b_ob,
b_ob_instance,
is_instance ? b_instance.random_id() : 0,
tfm,
use_portal);
}
return NULL;
}
/* only interested in object that we can create meshes from */
if (!object_is_mesh(b_ob)) {
return NULL;
}
/* Perform object culling. */
if (culling.test(scene, b_ob, tfm)) {
return NULL;
}
/* Visibility flags for both parent and child. */
PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles");
bool use_holdout = get_boolean(cobject, "is_holdout") ||
b_parent.holdout_get(PointerRNA_NULL, b_view_layer);
uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY;
if (b_parent.ptr.data != b_ob.ptr.data) {
visibility &= object_ray_visibility(b_parent);
}
/* TODO: make holdout objects on excluded layer invisible for non-camera rays. */
#if 0
if (use_holdout && (layer_flag & view_layer.exclude_layer)) {
visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA);
}
#endif
/* Clear camera visibility for indirect only objects. */
bool use_indirect_only = b_parent.indirect_only_get(PointerRNA_NULL, b_view_layer);
if (use_indirect_only) {
visibility &= ~PATH_RAY_CAMERA;
}
/* Don't export completely invisible objects. */
if (visibility == 0) {
return NULL;
}
/* key to lookup object */
ObjectKey key(b_parent, persistent_id, b_ob_instance);
Object *object;
/* motion vector case */
if (motion) {
object = object_map.find(key);
if (object && object->use_motion()) {
/* Set transform at matching motion time step. */
int time_index = object->motion_step(motion_time);
if (time_index >= 0) {
object->motion[time_index] = tfm;
}
/* mesh deformation */
if (object->mesh)
sync_mesh_motion(b_depsgraph, b_ob, object, motion_time);
}
//.........这里部分代码省略.........
示例3: object_render_hide_duplis
static bool object_render_hide_duplis(BL::Object b_ob)
{
BL::Object parent = b_ob.parent();
return (parent && object_render_hide_original(b_ob.type(), parent.dupli_type()));
}