diff --git a/src/scene/cache/properties.rs b/src/scene/cache/properties.rs index af98523bc..36f6d3c57 100644 --- a/src/scene/cache/properties.rs +++ b/src/scene/cache/properties.rs @@ -39,6 +39,18 @@ pub fn general_section(entity: &EntityType) -> PropSection { field: "linetype_scale", value: PropValue::EditText(format!("{:.4}", common.linetype_scale)), }, + Property { + label: "Plot style".into(), + field: "plot_style", + value: PropValue::ReadOnly( + match common.plotstyle_flags { + 0 => "ByLayer", + 1 => "ByBlock", + _ => "ByColor", + } + .into(), + ), + }, Property { label: "Lineweight".into(), field: "lineweight", @@ -49,6 +61,11 @@ pub fn general_section(entity: &EntityType) -> PropSection { field: "transparency", value: PropValue::EditText(format!("{transp_pct}")), }, + Property { + label: "Hyperlink".into(), + field: "hyperlink", + value: PropValue::ReadOnly(String::new()), + }, Property { label: "Invisible".into(), field: "invisible", @@ -61,6 +78,48 @@ pub fn general_section(entity: &EntityType) -> PropSection { } } +/// The "3D Visualization" group (Material + Shadow display), common to every +/// graphical object. Material / plot-style / shadow source is flag-based; a +/// custom material handle is shown as "Custom" (name resolution needs the doc). +pub fn visualization_section(entity: &EntityType) -> Option { + if matches!( + entity, + EntityType::Block(_) + | EntityType::BlockEnd(_) + | EntityType::Seqend(_) + | EntityType::Unknown(_) + ) { + return None; + } + let common = entity.common(); + let material = match common.material_flags { + 0 => "ByLayer", + 1 => "ByBlock", + _ => "Custom", + }; + let shadow = match common.shadow_flags { + 0 => "Casts and Receives Shadows", + 1 => "Casts Shadows", + 2 => "Receives Shadows", + _ => "Ignores Shadows", + }; + Some(PropSection { + title: "3D Visualization".into(), + props: vec![ + Property { + label: "Material".into(), + field: "material", + value: PropValue::ReadOnly(material.into()), + }, + Property { + label: "Shadow display".into(), + field: "shadow_display", + value: PropValue::ReadOnly(shadow.into()), + }, + ], + }) +} + pub fn fallback_properties(_handle: Handle, entity: &EntityType) -> PropSection { PropSection { title: "Geometry".into(), diff --git a/src/scene/view/dispatch.rs b/src/scene/view/dispatch.rs index 15eacd34b..6ab1e8ed7 100644 --- a/src/scene/view/dispatch.rs +++ b/src/scene/view/dispatch.rs @@ -18,6 +18,9 @@ pub fn properties_sectioned( text_style_names: &[String], ) -> Vec { let mut sections = vec![properties::general_section(entity)]; + if let Some(viz) = properties::visualization_section(entity) { + sections.push(viz); + } let groups = entity.geometry_properties(text_style_names); if groups.is_empty() { sections.push(properties::fallback_properties(handle, entity));