feat(layers): add non-printing layer support

This commit is contained in:
gianlucafiore committed 2026-08-20 20:37:27 -03:00
1 parent b1b5d31be5
commit eb5cbaeca0
7 files changed
+192 -6

No files matched your search

+46 -2
View File
@@ -1144,9 +1144,31 @@ impl Scene {
viewport,
None,
false,
false,
)
}
pub(super) fn instanced_plot_hatch_models(
&self,
layout_block: Handle,
hatch_bg: [f32; 4],
frozen: Option<&rustc_hash::FxHashSet<Handle>>,
annotation_scale_handle: Option<Handle>,
all_visible: bool,
viewport: Option<Handle>,
) -> Vec<HatchModel> {
self.instanced_hatch_models_filtered(
layout_block,
hatch_bg,
false,
frozen,
annotation_scale_handle,
all_visible,
viewport,
None,
false,
true,
)
}
/// Build live hatch overlays for INSERT grip previews. The edited INSERT
/// is intentionally hidden from the resident scene while its current
/// document entity moves, so include that hidden target and reuse the full
@@ -1183,6 +1205,7 @@ impl Scene {
self.active_viewport,
Some(&targets),
true,
false,
)
}
@@ -1197,6 +1220,7 @@ impl Scene {
viewport: Option<Handle>,
targets: Option<&rustc_hash::FxHashSet<Handle>>,
include_preview_hidden: bool,
plot_only: bool,
) -> Vec<HatchModel> {
let depth_map = self.draw_depth_map();
let graph = crate::scene::render_graph::RenderSceneGraph::new(
@@ -1213,10 +1237,21 @@ impl Scene {
graph.walk_root(
self.render_scene_root(layout_block),
|entity, context| {
let common = entity.common();
if plot_only
&& self
.document
.layers
.get(&common.layer)
.is_some_and(|layer| !layer.is_plottable)
{
return false;
}
if context.is_instanced() {
return true;
}
let common = entity.common();
if self.object_isolation.hides(common.handle)
|| (!include_preview_hidden
&& self.preview_hidden.contains(&common.handle))
@@ -1254,6 +1289,15 @@ impl Scene {
let EntityType::Hatch(source_hatch) = entity else {
return;
};
if plot_only
&& self
.document
.layers
.get(&source_hatch.common.layer)
.is_some_and(|layer| !layer.is_plottable)
{
return;
}
let style = context.style_for(&self.document, entity);
let preserve_white_mask = source_hatch.is_solid
&& matches!(