============= MaterialGroup ============= .. py:currentmodule:: p3dsdk .. py:class:: MaterialGroup .. py:method:: id :property: The id of the group. :type: str, read-only .. py:method:: name :property: The name of the group. :type: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: list_materials() List the materials of this group. :returns: The list of materials in the group. :rtype: list(Material) .. py:method:: duplicate() Duplicate this material group. :returns: The duplicated group. :rtype: MaterialGroup :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: remove(force = False) Delete a material group .. note:: By default, only empty groups can be deleted (:py:obj:`NotEmptyError` is raised otherwise), use ``force`` to force deletion of non empty groups. :param force: Force the deletion of the group even if it contains materials. :type force: bool :raises NotEmptyError: If ``force`` is :py:obj:`False` and the group contains materials. :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: create_standard_material(name) Create a new standard material. :param name: The name of the new material. :type name: str :returns: The newly created material. :rtype: StandardMaterial :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: create_multi_layer_material(name) Create a new multi layer material. :param name: The name of the new material. :type name: str :returns: The newly created material. :rtype: MultiLayerMaterial :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: create_mirror_material(name) Create a new mirror material. :param name: The name of the new material. :type name: str :returns: The newly created material. :rtype: MirrorMaterial :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: create_matte_material(name) Create a new matte material. :param name: The name of the new material. :type name: str :returns: The newly created material. :rtype: MatteMaterial :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: create_env_material(name) Create a new environment material. :param name: The name of the new material. :type name: str :returns: The newly created material. :rtype: EnvMaterial :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: import_kmt(filename) Import material from a KMT file. :param filename: KMT filename. :type filename: str :returns: The imported material. :rtype: Material :raises FileNotFoundError: If ``filename`` can't be opened. :raises ReadOnlyError: If :py:obj:`Database` is in read only mode.