面拉伸的白模,想更改选中模型的材质颜色。代码设置没效果。
Selection3D select3D = layer.Selection;
Recordset recordset = select3D.ToRecordset();
GeoModel3D geometry = recordset.GetGeometry() as GeoModel3D;
Model model = geometry.Model;
DatasetVector da = layer.Dataset as DatasetVector;
ModelEntityManager man = new ModelEntityManager(da);
List<string> matertSkeles = man.GetSkeletonNames();
foreach (string item in matertSkeles)
{
if (model.GetSkeleton(item) != null)
{
Skeleton ske = model.GetSkeleton(item);
ske.Material.MaterialColor = color;
man.Update(ske);
}
}
man.UpdateDataset();