<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLMaterial/subscript(_:)-323j3",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLMaterial(im)objectForKeyedSubscript:"
  },
  "title" : "subscript(_:)"
}
-->

# subscript(_:)

Returns the material property with the specified name, for use with subscript syntax.

```
subscript(name: String) -> MDLMaterialProperty? { get }
```

## Parameters

`name`

The [`name`](/documentation/ModelIO/MDLMaterialProperty/name) value of a material property in the material.

## Return Value

The material property with the specified name, or `nil` if the material does not contain a material property with that name.

## Discussion

This method is equivalent to the [`propertyNamed(_:)`](/documentation/ModelIO/MDLMaterial/propertyNamed(_:)) method but allows for the use of subscript syntax for reading material properties. To write material properties to the material, use the [`setProperty(_:)`](/documentation/ModelIO/MDLMaterial/setProperty(_:)) method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)