03-04-2026, 02:02 PM
FYI, I inherit my own class from MultiLineNode and added Wash and Paint methods that make the trick:
private readonly LineMaterial originalMaterial;
private static readonly PropertyInfo? MaterialProperty = typeof(LineBaseNode).GetProperty(nameof(DimensionLineMeshNode.Material), BindingFlags.Public | BindingFlags.Instance);
public void Paint(LineMaterial mat) => DimensionLineMeshNode.MaterialProperty?.SetValue(this, mat);
public void Wash() => DimensionLineMeshNode.MaterialProperty?.SetValue(this, this.originalMaterial);
public DimensionLineMeshNode(string name, Vector3[] positions, LineMaterial sharedMaterial)
: base(name)
{
this.originalMaterial = sharedMaterial;
this.IsHitTestVisible = true;
this.Material = sharedMaterial;
this.Positions = positions;
}
private readonly LineMaterial originalMaterial;
private static readonly PropertyInfo? MaterialProperty = typeof(LineBaseNode).GetProperty(nameof(DimensionLineMeshNode.Material), BindingFlags.Public | BindingFlags.Instance);
public void Paint(LineMaterial mat) => DimensionLineMeshNode.MaterialProperty?.SetValue(this, mat);
public void Wash() => DimensionLineMeshNode.MaterialProperty?.SetValue(this, this.originalMaterial);
public DimensionLineMeshNode(string name, Vector3[] positions, LineMaterial sharedMaterial)
: base(name)
{
this.originalMaterial = sharedMaterial;
this.IsHitTestVisible = true;
this.Material = sharedMaterial;
this.Positions = positions;
}

