本文整理汇总了C++中bl::SpaceView3D::layers方法的典型用法代码示例。如果您正苦于以下问题:C++ SpaceView3D::layers方法的具体用法?C++ SpaceView3D::layers怎么用?C++ SpaceView3D::layers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bl::SpaceView3D
的用法示例。
在下文中一共展示了SpaceView3D::layers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sync_render_layers
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Get render layer (by name, or first one if name is NULL)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d, const char *layer) {
string layername;
// 3d view
if(b_v3d) {
PointerRNA oct_scene = RNA_pointer_get(&b_scene.ptr, "octane");
if(RNA_boolean_get(&oct_scene, "preview_active_layer")) {
BL::RenderLayers layers(b_scene.render().ptr);
layername = layers.active().name();
layer = layername.c_str();
}
else {
render_layer.use_localview = (b_v3d.local_view() ? true : false);
render_layer.scene_layer = get_layer(b_v3d.layers(), b_v3d.layers_local_view(), render_layer.use_localview);
render_layer.layer = render_layer.scene_layer;
render_layer.holdout_layer = 0;
render_layer.material_override = PointerRNA_NULL;
render_layer.use_background = true;
render_layer.use_viewport_visibility = true;
render_layer.samples = 0;
return;
}
}
// Render layer
BL::RenderSettings r = b_scene.render();
BL::RenderSettings::layers_iterator b_rlay;
bool first_layer = true;
uint layer_override = get_layer(b_engine.layer_override());
uint scene_layers = layer_override ? layer_override : get_layer(b_scene.layers());
for(r.layers.begin(b_rlay); b_rlay != r.layers.end(); ++b_rlay) {
if((!layer && first_layer) || (layer && b_rlay->name() == layer)) {
render_layer.name = b_rlay->name();
render_layer.holdout_layer = get_layer(b_rlay->layers_zmask());
render_layer.exclude_layer = get_layer(b_rlay->layers_exclude());
render_layer.scene_layer = scene_layers & ~render_layer.exclude_layer;
render_layer.scene_layer |= render_layer.exclude_layer & render_layer.holdout_layer;
render_layer.layer = get_layer(b_rlay->layers());
render_layer.layer |= render_layer.holdout_layer;
render_layer.material_override = b_rlay->material_override();
render_layer.use_background = b_rlay->use_sky();
render_layer.use_viewport_visibility = (b_v3d ? false : scene->use_viewport_hide);//false;
render_layer.use_localview = false;
render_layer.samples = b_rlay->samples();
}
first_layer = false;
}
} //sync_render_layers()