Gets or sets if Reader3ds.MissingTextureExeprion is thrown if the texture is not found. If false then if the MissingTextureFileName is set it is used, if not set the simple SolidColorBrush material is used instead of texture (color is read from material). Default value is false.

Namespace:  Ab3d
Assembly:  Ab3d.Reader3ds (in Ab3d.Reader3ds)
Version: 4.2.0.0 (4.2.0.0)

Syntax

C#
public bool ThrowMissingTextureException { get; set; }
Visual Basic (Declaration)
Public Property ThrowMissingTextureException As Boolean
Visual C++
public:
property bool ThrowMissingTextureException {
	bool get ();
	void set (bool value);
}

Remarks

This property can be used in a viewer application when an exception must be shown if the texture file is not found. The exception is of type MissingTextureException that has the MissingTextureFileName property with missing file name. The following code is a sample of using ThrowMissingTextureException (the same code can also be found in my Viewer3d):

CopyC#
Ab3d.Reader3ds newReader3ds;
Model3DGroup buttonModel3DGroup;

newReader3ds = new Ab3d.Reader3ds();
newReader3ds.ThrowMissingTextureException = true;

try
{
    buttonModel3DGroup = newReader3ds.ReadFile("c:\\models\\button.3ds");
}
catch (Reader3ds.MissingTextureException e)
{
    MessageBox.Show("Missing texture: " + e.MissingTextureFileName);
    newReader3ds.ThrowMissingTextureException = false;
    buttonModel3DGroup = newReader3ds.ReadFile("c:\\models\\button.3ds");
}

The first time the Reader3ds is used the ThrowMissingTextureException is set to true. If the 3ds file has a missing texture the MissingTextureException is caught in catch. The missing file name is read and user can be informed about it. Then the ThrowMissingTextureException is set to false and the file is read again. This time the exception is not thrown and the model can be read.

Materials with textures have its Brush property set to the ImageBrush. But if the texture is not found a SolidColorBrush is used instead.

See Also