Back to Filament

duplicate

docs/android/dokka/filament-android/com.google.android.filament/-material-instance/duplicate.md

1.75.0861 B
Original Source

//filament-android/com.google.android.filament/MaterialInstance/duplicate

duplicate

[main]
open fun duplicate(other: MaterialInstance, name: String): MaterialInstance

Creates a new MaterialInstance using another MaterialInstance as a template for initialization. The new MaterialInstance is an instance of the same Material of the template instance and must be destroyed just like any other MaterialInstance.

Return

A new MaterialInstance

Parameters

main

otherA MaterialInstance to use as a template for initializing a new instance
nameA name for the new MaterialInstance or nullptr to use the template's name