=========== AspectLayer =========== .. py:currentmodule:: p3dsdk .. py:class:: AspectLayer .. py:method:: id :property: The id of the aspect layer. :type: str, read-only .. py:method:: name :property: The name of the aspect layer. :type: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: group :property: The group of this aspect layer or :py:obj:`None` if the aspect layer is at the root of the hierarchy. :type: AspectLayerGroup or None :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: visible :property: The aspect layer visibility. :type: bool :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: locked :property: The aspect layer locking status. :type: bool :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: active :property: The active status of the aspect layer. :type: bool, read-only .. py:method:: duplicate() Duplicate this aspect layer. :returns: The duplicated aspect layer. :rtype: AspectLayer :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: remove() Delete this aspect layer. :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. :raises ValueError: Cannot be removed if the aspect layer is the only one remaining. .. py:method:: assign_material(surface, material, uvset = 0) Assign a :py:obj:`Material` to the given :py:obj:`Surface` into the current :py:obj:`AspectLayer`. :param surface: Surface on which to assign the material. :type surface: Surface :param material: Material to assign. :type material: Material :param uvset: UV set to use for this material assignment. :type uvset: int :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: replace_material_assignment(surface, material, uvset = 0) Replace the material assignment on the given :py:obj:`Surface` with the :py:obj:`Material` while keeping the uv transformation in the current :py:obj:`AspectLayer`. :param surface: Surface on which to replace the material assignment. :type surface: Surface :param material: Material to reassign. :type material: Material :param uvset: UV set to use for this material assignment. :type uvset: int :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: material_assignment_uvset(surface) Get the uvset in for the material assignment on the given :py:obj:`Surface`. :param surface: Surface on which to get the uvset. :type surface: Surface :returns: The uvset. :rtype: int :raises ValueError: If the aspect layer is not applied on this surface. .. py:method:: material_assignment_offset_u(surface) Get the offset in the U direction of the material assignment on the given :py:obj:`Surface`, in meters. :param surface: Surface on which to get the offset in the U direction. :type surface: Surface :returns: The offset in the U direction. :rtype: float :raises ValueError: If the aspect layer is not applied on this surface. .. py:method:: set_material_assignment_offset_u(offset_u, surface) Set the offset in the U direction of the material assignment on the given :py:obj:`Surface`, in meters. :param offset_u: Offset in the U direction to set. :type offset_u: float :param surface: Surface on which to set the offset in the U direction. :type surface: Surface :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. :raises ValueError: If the aspect layer is not applied on this surface. .. py:method:: material_assignment_offset_v(surface) Get the offset in the V direction of the material assignment on the given :py:obj:`Surface`, in meters. :param surface: Surface on which to get the offset in the V direction. :type surface: Surface :returns: The offset in the V direction. :rtype: float :raises ValueError: If the aspect layer is not applied on this surface. .. py:method:: set_material_assignment_offset_v(offset_v, surface) Set the offset in the V direction of the material assignment on the given :py:obj:`Surface`, in meters. :param offset_v: Offset in the V direction to set. :type offset_v: float :param surface: Surface on which to set the offset in the V direction. :type surface: Surface :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. :raises ValueError: If the aspect layer is not applied on this surface. .. py:method:: material_assignment_rotation(surface) Get the rotation of the material assignment on the given :py:obj:`Surface`, in degrees. :param surface: Surface on which to get the rotation. :type surface: Surface :returns: The rotation. :rtype: float :raises ValueError: If the aspect layer is not applied on this surface. .. py:method:: set_material_assignment_rotation(rotation, surface) Set the rotation of the material assignment on the given :py:obj:`Surface`, in degrees. :param rotation: Rotation to set. :type rotation: float :param surface: Surface on which to set the rotation. :type surface: Surface :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. :raises ValueError: If the aspect layer is not applied on this surface. .. py:method:: remove_material_assignment(surface) Remove the material assignment on the given :py:obj:`Surface`. :param surface: Surface from which to remove the material. :type surface: Surface :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: material_assignment(surface) Get the material assignment on the given :py:obj:`Surface` if it exists. Return :py:obj:`None` if not. :param surface: Surface on which to get the material assignment. :type surface: Surface :returns: The :py:obj:`Material` assigned to the given :py:obj:`Surface`. Returns :py:obj:`None` if no material is assigned. :rtype: Material or None .. py:method:: material_assignment_per_surface() Get the map of material assignments per surface. :returns: The map with :py:obj:`Surface` as key and the assigned :py:obj:`Material` as value. :rtype: dict(Surface, Material) .. py:method:: assign_sticker(surface, material, uvset = 0) Assign a :py:obj:`Material` as a sticker to the given :py:obj:`Surface` into the current :py:obj:`AspectLayer`. :param surface: Surface on which to assign the material. :type surface: Surface :param material: Material to assign as a sticker. :type material: Material :param uvset: UV set to use for this sticker assignment. :type uvset: int :returns: The index of the :py:obj:`Material` assigned as a sticker to the given :py:obj:`Surface`. :rtype: int :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: sticker_count(surface) Get the count of stickers assigned to the given :py:obj:`Surface`. :param surface: Surface on which to get the count of assigned sticker. :type surface: Surface :returns: The count of stickers assigned to the given :py:obj:`Surface`. :rtype: int .. py:method:: sticker_assignment_offset_u(surface, sticker_index) Get the offset in the U direction of the sticker assignment on the given :py:obj:`Surface`, in meters. :param surface: Surface on which to get the offset in the U direction. :type surface: Surface :param sticker_index: Index of the sticker assignment for which the offset in the U direction will be returned. :type sticker_index: int :returns: The offset in the U direction. :rtype: float :raises ValueError: If the aspect layer is not applied on this surface. :raises ValueError: If the stickerIndex does not correspond to a sticker assigned to this surface. .. py:method:: set_sticker_assignment_offset_u(offset_u, surface, sticker_index) Set the offset in the U direction of the sticker assignment on the given :py:obj:`Surface`, in meters. :param offset_u: Offset in the U direction to set. :type offset_u: float :param surface: Surface on which to set the offset in the U direction. :type surface: Surface :param sticker_index: Index of the sticker for which the offset in the U direction will be set. :type sticker_index: int :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. :raises ValueError: If the aspect layer is not applied on this surface. :raises ValueError: If the stickerIndex does not correspond to a sticker assigned to this surface. .. py:method:: sticker_assignment_offset_v(surface, sticker_index) Get the offset in the U direction of the sticker assignment on the given :py:obj:`Surface`, in meters. :param surface: Surface on which to get the offset in the V direction. :type surface: Surface :param sticker_index: Index of the sticker for which the offset in the V direction will be returned. :type sticker_index: int :returns: The offset in the V direction. :rtype: float :raises ValueError: If the aspect layer is not applied on this surface. :raises ValueError: If the stickerIndex does not correspond to a sticker assigned to this surface. .. py:method:: set_sticker_assignment_offset_v(offset_v, surface, sticker_index) Set the offset in the V direction of the sticker assignment on the given :py:obj:`Surface`, in meters. :param offset_v: Offset in the V direction to set. :type offset_v: float :param surface: Surface on which to set the offset in the V direction. :type surface: Surface :param sticker_index: Index of the sticker for which the offset in the V direction will be set. :type sticker_index: int :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. :raises ValueError: If the aspect layer is not applied on this surface. :raises ValueError: If the stickerIndex does not correspond to a sticker assigned to this surface. .. py:method:: sticker_assignment_rotation(surface, sticker_index) Get the rotation of the sticker assignment on the given :py:obj:`Surface`, in degrees. :param surface: Surface on which to get the rotation. :type surface: Surface :param sticker_index: Index of the sticker for which the rotation will be returned. :type sticker_index: int :returns: The rotation in degrees. :rtype: float :raises ValueError: If the aspect layer is not applied on this surface. :raises ValueError: If the stickerIndex does not correspond to a sticker assigned to this surface. .. py:method:: set_sticker_assignment_rotation(rotation, surface, sticker_index) Set the rotation of the sticker assignment on the given :py:obj:`Surface`, in degrees. :param rotation: Rotation to set. :type rotation: float :param surface: Surface on which to set the rotation. :type surface: Surface :param sticker_index: Index of the sticker for which the rotation will be set. :type sticker_index: int :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. :raises ValueError: If the aspect layer is not applied on this surface. :raises ValueError: If the stickerIndex does not correspond to a sticker assigned to this surface. .. py:method:: remove_sticker_assignment(surface, sticker_index) Remove the sticker assignment of the given index on the given :py:obj:`Surface`. :param surface: Surface from which to remove the sticker. :type surface: Surface :param sticker_index: Index of the sticker to be removed. :type sticker_index: int :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. :raises ValueError: If the aspect layer is not applied on this surface. :raises ValueError: If the stickerIndex does not correspond to a sticker assigned to this surface. .. py:method:: remove_all_sticker_assignments(surface) Remove all the sticker assignments on the given :py:obj:`Surface`. :param surface: Surface from which to remove all sticker assignments. :type surface: Surface :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: sticker_assignment(surface, sticker_index) Get the sticker assignment on the given :py:obj:`Surface` at the given index if it exists. Return :py:obj:`None` if not. :param surface: Surface on which to get the sticker assignment. :type surface: Surface :param sticker_index: Index of the sticker to be returned. :type sticker_index: int :returns: The :py:obj:`Material` assigned as sticker at the given stickerIndex to the given :py:obj:`Surface`. Returns :py:obj:`None` if no material is assigned as a sticker with the given stickerIndex. :rtype: Material or None :raises ValueError: If the aspect layer is not applied on this surface. :raises ValueError: If the stickerIndex does not correspond to a sticker assigned to this surface. .. py:method:: all_sticker_assignments(surface) Get all the sticker assignment on the given :py:obj:`Surface` as a list if it exists. Return an empty list if not. :param surface: Surface on which to get the list of sticker assignment. :type surface: Surface :returns: The list of :py:obj:`Material` assigned to the given :py:obj:`Surface` as a sticker. Returns an empty list if no material is assigned as a sticker. :rtype: list(Material) .. py:method:: sticker_assignments_per_surface() Get the map of stickers assignments per surface. :returns: The map with :py:obj:`Surface` as key and the list of assigned sticker :py:obj:`Material` as value. :rtype: dict(Surface, list(Material))