vrdTexture¶
-
class
vrdTexture
¶
(Inherits vrdSceneObject
)
This class is used for all texture properties.
Summary¶
- Functions:
- getAnisotropy() → float
- getComponentName() → string
- getConnectRepeatModes() → bool
- getFrameOffset() → integer
- getGamma() → float
- getImage() → vrdImage
- getImageNumber() → integer
- getInfiniteTilingContrast() → float
- getInfiniteTilingGridSize() → integer
- getInfiniteTilingHueWeight() → float
- getInfiniteTilingMaxRotation() → float
- getInfiniteTilingSaturationWeight() → float
- getInfiniteTilingValueWeight() → float
- getInlineImageSequence() → bool
- getInvertTexture() → bool
- getLinkTextureSettings() → bool
- getManipulate() → bool
- getMappingType() → vrTextureTypes.MappingType
- getOffset() → QVector2D
- getPlanarProjectionCenter() → QVector3D
- getPlanarProjectionKeepAspectRatio() → bool
- getPlanarProjectionOrientation() → QVector2D
- getPlanarProjectionSingleSided() → bool
- getPlanarProjectionSize() → QVector3D
- getRepeat() → QVector2D
- getRepeatModeU() → vrTextureTypes.RepeatMode
- getRepeatModeV() → vrTextureTypes.RepeatMode
- getRotate() → float
- getTextureSize() → QVector2D
- getTriplanarBlend() → float
- getTriplanarXOffset() → QVector2D
- getTriplanarXRepeat() → QVector2D
- getTriplanarXRotation() → float
- getTriplanarYOffset() → QVector2D
- getTriplanarYRepeat() → QVector2D
- getTriplanarYRotation() → float
- getTriplanarZOffset() → QVector2D
- getTriplanarZRepeat() → QVector2D
- getTriplanarZRotation() → float
- getUniformRepeat() → bool
- getUseAlpha() → bool
- getUseCutout() → bool
- getUseImageSequence() → bool
- getUseInfiniteTiling() → bool
- getUseTexture() → bool
- getUseTextureSize() → bool
- setAnisotropy(anisotropy)
- setConnectRepeatModes(s)
- setFrameOffset(frameOffset)
- setGamma(gamma)
- setImage(img)
- setImageNumber(imageNumber)
- setInfiniteTilingContrast(contrast)
- setInfiniteTilingGridSize(gridSize)
- setInfiniteTilingHueWeight(hueWeight)
- setInfiniteTilingMaxRotation(maxRotation)
- setInfiniteTilingSaturationWeight(saturationWeight)
- setInfiniteTilingValueWeight(valueWeight)
- setInlineImageSequence(s)
- setInvertTexture(invertTexture)
- setLinkTextureSettings(s)
- setManipulate(s)
- setMappingType(type)
- setOffset(offset)
- setPlanarProjectionCenter(center)
- setPlanarProjectionFitSize()
- setPlanarProjectionKeepAspectRatio(s)
- setPlanarProjectionObjectCenter()
- setPlanarProjectionOrientation(orientation)
- setPlanarProjectionPlane(center, direction)
- setPlanarProjectionSingleSided(s)
- setPlanarProjectionSize(size)
- setRepeat(repeat)
- setRepeatModeU(mode)
- setRepeatModeV(mode)
- setRotate(rotate)
- setTextureSize(size)
- setTriplanarBlend(blend)
- setTriplanarXOffset(offset)
- setTriplanarXRepeat(repeat)
- setTriplanarXRotation(rotation)
- setTriplanarYOffset(offset)
- setTriplanarYRepeat(repeat)
- setTriplanarYRotation(rotation)
- setTriplanarZOffset(offset)
- setTriplanarZRepeat(repeat)
- setTriplanarZRotation(rotation)
- setUniformRepeat(s)
- setUseAlpha(s)
- setUseCutout(s)
- setUseImageSequence(s)
- setUseInfiniteTiling(s)
- setUseTexture(s)
- setUseTextureSize(s)
- supportsGamma() → bool
- supportsInvertTexture() → bool
- supportsMappingType() → bool
- supportsUseAlpha() → bool
- supportsUseCutout() → bool
Functions¶
-
vrdTexture.
getAnisotropy
()¶ Returns the current anisotropy value.
Returns: Anisotropy value Return type: float
-
vrdTexture.
getComponentName
()¶ Returns: The name of the component, this texture belongs to Return type: string
-
vrdTexture.
getConnectRepeatModes
()¶ Returns whether the U and V repeat modes are linked.
Returns: True if the repeat modes are linked, False otherwise Return type: bool
-
vrdTexture.
getFrameOffset
()¶ Returns the current frame offset.
Returns: The current frame offset Return type: integer
-
vrdTexture.
getGamma
()¶ Returns the texture image gamma correction.
Returns: Currently used value for the texture image gamma correction. Return type: float
-
vrdTexture.
getImage
()¶ Returns the image used by the texture.
Returns: The image used as a texture Return type: vrdImage
-
vrdTexture.
getImageNumber
()¶ Returns the current frame number of the image sequence.
Returns: The current frame number Return type: integer
-
vrdTexture.
getInfiniteTilingContrast
()¶ Returns the contrast adjustment of the blending region between tiles when using infinite tiling.
Returns: Contrast value between 0 and 1 Return type: float
-
vrdTexture.
getInfiniteTilingGridSize
()¶ Returns the base grid size of the infinite tiling.
Returns: Positive integer value Return type: integer
-
vrdTexture.
getInfiniteTilingHueWeight
()¶ Returns the weight of the random hue offset for each tile when using infinite tiling.
Returns: The weight of the random hue offset between 0 and 1 Return type: float
-
vrdTexture.
getInfiniteTilingMaxRotation
()¶ Returns the maximum rotation applied to a single tile when using infinite tiling.
Returns: Rotation value Return type: float
-
vrdTexture.
getInfiniteTilingSaturationWeight
()¶ Returns the weight of the random saturation offset for each tile when using infinite tiling.
Returns: The weight of the random saturation offset between 0 and 1 Return type: float
-
vrdTexture.
getInfiniteTilingValueWeight
()¶ Returns the weight of the random value offset for each tile when using infinite tiling.
Returns: The weight of the random value offset between 0 and 1 Return type: float
-
vrdTexture.
getInlineImageSequence
()¶ Returns whether the image sequence is embedded to the file or not.
Returns: True if the image sequence is inlined, False otherwise Return type: bool
-
vrdTexture.
getInvertTexture
()¶ Returns whether in texture inversion is enabled or not.
Returns: True if the texture is inverted, False otherwise Return type: bool
-
vrdTexture.
getLinkTextureSettings
()¶ Returns the current state of the texture link option.
Returns: True if the texture is linked to other textures, False if the texture uses independent settings Return type: bool
-
vrdTexture.
getManipulate
()¶ Returns whether the texture manipulator is active or not.
Returns: True if the manipulator is active, False otherwise Return type: bool
-
vrdTexture.
getMappingType
()¶ Returns the texture mapping type currently used for this texture.
Returns: Current mapping type Return type: vrTextureTypes.MappingType
-
vrdTexture.
getOffset
()¶ Returns the current UV texture coordinate offset.
Returns: UV texture coordinate offset Return type: QVector2D
-
vrdTexture.
getPlanarProjectionCenter
()¶ Returns the planar projection center in object space.
Returns: 3d object space position Return type: QVector3D
-
vrdTexture.
getPlanarProjectionKeepAspectRatio
()¶ Returns whether the aspect ratio of the texture is to be preserved.
Returns: True if aspect ratio should be preserved, False otherwise Return type: bool
-
vrdTexture.
getPlanarProjectionOrientation
()¶ Returns the planar projection orientation.
Returns: Euler angle rotation Return type: QVector2D
-
vrdTexture.
getPlanarProjectionSingleSided
()¶ Returns whether the planar projection is single sided or not.
Returns: True if the planar projection is single sided, False otherwise Return type: bool
-
vrdTexture.
getPlanarProjectionSize
()¶ Returns the planar projection size.
Returns: 3d size Return type: QVector3D
-
vrdTexture.
getRepeat
()¶ Returns the UV texture repeat factor.
Returns: UV texture repeat factor Return type: QVector2D
-
vrdTexture.
getRepeatModeU
()¶ Returns the current texture repeat mode along the U axis.
Returns: Current texture repeat mode along the U axis Return type: vrTextureTypes.RepeatMode
-
vrdTexture.
getRepeatModeV
()¶ Returns the current texture repeat mode along the V axis.
Returns: Current texture repeat mode along the V axis Return type: vrTextureTypes.RepeatMode
-
vrdTexture.
getRotate
()¶ Returns the current UV texture coordinate rotation.
Returns: UV texture coordinate rotation Return type: float
-
vrdTexture.
getTextureSize
()¶ Returns the size of the texture in scene units.
Returns: Size in scene units (usually mm) Return type: QVector2D
-
vrdTexture.
getTriplanarBlend
()¶ Returns the edge blending factor for the triplanar texture projection.
Returns: Blending factor between 0 and 1 Return type: float
-
vrdTexture.
getTriplanarXOffset
()¶ Returns the UV offset for the x-axis of the triplanar texture projection.
Returns: UV offset Return type: QVector2D
-
vrdTexture.
getTriplanarXRepeat
()¶ Returns the UV repeat factors of the x-axis of the triplanar texture projection.
Returns: UV repeat factors Return type: QVector2D
-
vrdTexture.
getTriplanarXRotation
()¶ Returns the rotation value of the x-axis texture coordinates of the triplanar texture projection.
Returns: Rotation value Return type: float
-
vrdTexture.
getTriplanarYOffset
()¶ Returns the UV offset for the y-axis of the triplanar texture projection.
Returns: UV offset Return type: QVector2D
-
vrdTexture.
getTriplanarYRepeat
()¶ Returns the UV repeat factors of the y-axis of the triplanar texture projection.
Returns: UV repeat factors Return type: QVector2D
-
vrdTexture.
getTriplanarYRotation
()¶ Returns the rotation value of the y-axis texture coordinates of the triplanar texture projection.
Returns: Rotation value Return type: float
-
vrdTexture.
getTriplanarZOffset
()¶ Returns the UV offset for the z-axis of the triplanar texture projection.
Returns: UV offset Return type: QVector2D
-
vrdTexture.
getTriplanarZRepeat
()¶ Returns the UV repeat factors of the z-axis of the triplanar texture projection.
Returns: UV repeat factors Return type: QVector2D
-
vrdTexture.
getTriplanarZRotation
()¶ Returns the rotation value of the z-axis texture coordinates of the triplanar texture projection.
Returns: Rotation value Return type: float
-
vrdTexture.
getUniformRepeat
()¶ Returns whether the repeat factors for the triplanar texture projection are linked or not.
Returns: True if the repeat values are linked, False otherwise Return type: bool
-
vrdTexture.
getUseAlpha
()¶ Returns whehter the texture image’s alpha channel is use for transparency or not.
Returns: True if the alpha channel is used, False otherwise Return type: bool
-
vrdTexture.
getUseCutout
()¶ Returns whether cutout transparency is used or not.
Returns: True if cutout transparency is enabled, False otherwise. Return type: bool
-
vrdTexture.
getUseImageSequence
()¶ Returns the current image sequence usage state.
Returns: True if the use of an image sequence is enabled, False otherwise Return type: bool
-
vrdTexture.
getUseInfiniteTiling
()¶ Returns whether infinite tiling is used for the texture or not.
Returns: True if infinite tiling is enabled, False otherwise Return type: bool
-
vrdTexture.
getUseTexture
()¶ Returns the current texture usage state.
Returns: True if texture usage is enabled, False otherwise Return type: bool
-
vrdTexture.
getUseTextureSize
()¶ Returns whether real world texture size should be used or not.
Returns: True if real world texture size is used, False otherwise Return type: bool
-
vrdTexture.
setAnisotropy
(anisotropy)¶ Sets the anisotropy value for texture filtering. The ranges are defined as A value of 0.0 reverts to bilinear filtering A value in the (0.0, 1.0] range uses simple trilinear filtering A value above 1 uses an anisotropic filtering.
Parameters: anisotropy (float) – Anisotropy value to use for texture filtering
-
vrdTexture.
setConnectRepeatModes
(s)¶ If enabled the U repeat mode will be used for the V direction as well.
Parameters: s (bool) – Set to True if the repeat modes in U and V direction should be the same, False otherwise
-
vrdTexture.
setFrameOffset
(frameOffset)¶ Sets an offset to be added to the current frame number of the image sequence.
Parameters: frameOffset (integer) – Offset to be added to the frame number of the image sequence
-
vrdTexture.
setGamma
(gamma)¶ Sets the texture image gamma correction. For a value of 0.0 an sRGB gamma is used on LDR textures. For HDR textures the gamma is ignored, these are always assumed to have a linear gamma of 1.0 Call supportsGamma to query if the texture supports gamma correction.
Parameters: gamma (float) – Value for the texture image gamma correction.
-
vrdTexture.
setImage
(img)¶ Sets an image to the texture.
Parameters: img (vrdImage) – The image to set as a texture
-
vrdTexture.
setImageNumber
(imageNumber)¶ When an image sequence is used this sets the current frame used as a texture.
Parameters: imageNumber (integer) – The frame number to use from the image sequence
-
vrdTexture.
setInfiniteTilingContrast
(contrast)¶ Sets the contrast adjustment of the blending region between tiles when using infinite tiling.
Parameters: contrast (float) – Contrast value between 0 and 1
-
vrdTexture.
setInfiniteTilingGridSize
(gridSize)¶ Sets the base grid size to use for infinite tiling.
Parameters: gridSize (integer) – positive integer value
-
vrdTexture.
setInfiniteTilingHueWeight
(hueWeight)¶ Sets the weight of the random hue offset for each tile when using infinite tiling.
Parameters: hueWeight (float) – The weight of the random hue offset between 0 and 1
-
vrdTexture.
setInfiniteTilingMaxRotation
(maxRotation)¶ Sets the maximum rotation applied to a single tile when using infinite tiling.
Parameters: maxRotation (float) – Rotation value
-
vrdTexture.
setInfiniteTilingSaturationWeight
(saturationWeight)¶ Sets the weight of the random saturation offset for each tile when using infinite tiling.
Parameters: saturationWeight (float) – The weight of the random saturation offset between 0 and 1
-
vrdTexture.
setInfiniteTilingValueWeight
(valueWeight)¶ Sets the weight of the random value offset for each tile when using infinite tiling.
Parameters: valueWeight (float) – The weight of the random value offset between 0 and 1
-
vrdTexture.
setInlineImageSequence
(s)¶ If enabled the image sequence will be embedded in the file instead of being read from disk for each frame.
Parameters: s (bool) – Set to True if the image sequence should be inlined, False to remove inlined image sequence data.
-
vrdTexture.
setInvertTexture
(invertTexture)¶ When enabled the values of the texture are inverted. Call supportsInvertTexture to query if texture inversion is supported for this texture.
Parameters: invertTexture (bool) – New enable state of the the invert texture approach
-
vrdTexture.
setLinkTextureSettings
(s)¶ Links the settings for this texture to the settings of other linked textures in this material.
Parameters: s (bool) – Set to True if the texture should use the same settings as other linked textures, set to False for independent settings
-
vrdTexture.
setManipulate
(s)¶ Set to True to enable the texture manipulator.
Parameters: s (bool) – True enables the texture manipulator, False disables it
-
vrdTexture.
setMappingType
(type)¶ Sets the type of the texture projection to use for this texture. Call vrdTexture.supportsMappingType() to check if mapping types are supported for this texture.
Parameters: type (vrTextureTypes.MappingType) – Texture mapping type to set. Available types are UVMapping, PlanarMapping or TriplanarMapping if supported.
-
vrdTexture.
setOffset
(offset)¶ Sets an offset added to the UV texture coordinates.
Parameters: offset (QVector2D) – The offset to use
-
vrdTexture.
setPlanarProjectionCenter
(center)¶ Sets the projection center for planar texture projection in object space.
Parameters: center (QVector3D) – 3d objects space position
-
vrdTexture.
setPlanarProjectionFitSize
()¶ Automatically adjusts the size of the planar projection based on the selected geometries.
-
vrdTexture.
setPlanarProjectionKeepAspectRatio
(s)¶ Sets whether the aspect ratio of the texture should be preserved for the projection or not.
Parameters: s (bool) – True for aspect ratio to be preserved for the projection, False otherwise
-
vrdTexture.
setPlanarProjectionObjectCenter
()¶ Automatically adjusts the planar projection center based on the selected geometries.
-
vrdTexture.
setPlanarProjectionOrientation
(orientation)¶ Sets the projection orientation for planar texture projection in object space.
Parameters: orientation (QVector2D) – Euler angle rotation
-
vrdTexture.
setPlanarProjectionPlane
(center, direction)¶ Sets the center and orientation of the planar projection.
Parameters: - center (QVector3D) – Local center coordinates
- direction (QVector3D) – Local direction of the plane
-
vrdTexture.
setPlanarProjectionSingleSided
(s)¶ Sets whether the planar projection should be for one side of the geometry or both. Only available with repeat mode Decal.
Parameters: s (bool) – If True, the projection is only applied if the surface normal faces the projection, otherwise the texture will be visible on both sides
-
vrdTexture.
setPlanarProjectionSize
(size)¶ Sets the size of the planar texture projection in object space. The z-Coordinate of the size can be used limit the projection to depth range.
Parameters: size (QVector3D) – 3d size
-
vrdTexture.
setRepeat
(repeat)¶ Sets the UV texture repeat factor.
Parameters: repeat (QVector2D) – UV texture repeat factor to set
-
vrdTexture.
setRepeatModeU
(mode)¶ Sets the texture repeat mode along the U axis.
Parameters: mode (vrTextureTypes.RepeatMode) – Texture repeat mode to set. Available modes are Repeat, Mirrored, Decal and Clamp
-
vrdTexture.
setRepeatModeV
(mode)¶ Sets the texture repeat mode along the V axis.
Parameters: mode (vrTextureTypes.RepeatMode) – Texture repeat mode to set. Available modes are Repeat, Mirrored, Decal and Clamp
-
vrdTexture.
setRotate
(rotate)¶ Sets a rotation value for the UV-texture coordinates.
Parameters: rotate (float) – The rotation value to use
-
vrdTexture.
setTextureSize
(size)¶ Sets the size of the texture in scene units.
Parameters: size (QVector2D) – Size in scene units (usually mm)
-
vrdTexture.
setTriplanarBlend
(blend)¶ Sets the edge blending factor for the triplanar texture projection.
Parameters: blend (float) – Blending factor between 0 and 1
-
vrdTexture.
setTriplanarXOffset
(offset)¶ Sets the UV offset for the x-axis of the triplanar texture projection.
Parameters: offset (QVector2D) – UV offset
-
vrdTexture.
setTriplanarXRepeat
(repeat)¶ Sets the UV repeat factors for the x-axis of the triplanar texture projection.
Parameters: repeat (QVector2D) – UV repeat factors
-
vrdTexture.
setTriplanarXRotation
(rotation)¶ Sets the rotation value for the x-axis texture coordinates of the triplanar texture projection.
Parameters: rotation (float) – Rotation value
-
vrdTexture.
setTriplanarYOffset
(offset)¶ Sets the UV offset for the y-axis of the triplanar texture projection.
Parameters: offset (QVector2D) – UV offset
-
vrdTexture.
setTriplanarYRepeat
(repeat)¶ Sets the UV repeat factors for the y-axis of the triplanar texture projection.
Parameters: repeat (QVector2D) – UV repeat factor
-
vrdTexture.
setTriplanarYRotation
(rotation)¶ Sets the rotation value for the y-axis texture coordinates of the triplanar texture projection.
Parameters: rotation (float) – Rotation value
-
vrdTexture.
setTriplanarZOffset
(offset)¶ Sets the UV offset for the z-axis of the triplanar texture projection.
Parameters: offset (QVector2D) – UV offset
-
vrdTexture.
setTriplanarZRepeat
(repeat)¶ Sets the UV repeat factors for the z-axis of the triplanar texture projection.
Parameters: repeat (QVector2D) – UV repeat factor
-
vrdTexture.
setTriplanarZRotation
(rotation)¶ Sets the rotation value for the z-axis texture coordinates of the triplanar texture projection.
Parameters: rotation (float) – Rotation value
-
vrdTexture.
setUniformRepeat
(s)¶ If set to True the repeat factors of the xyz axes of the triplanar texture projection are linked.
Parameters: s (bool) – True if the axes should be linked, False otherwise
-
vrdTexture.
setUseAlpha
(s)¶ When set to True and the texture image has an alpha channel embedded it is used to make parts of the texture transparent. Call supportsUseAlpha to query if the texture supports an alpha channel.
Parameters: s (bool) – True if the alpha channel should be used, False otherwise
-
vrdTexture.
setUseCutout
(s)¶ When set to True the transparency if interpreted as either True or False. Values below 0.5 are considered to be transparent while values above 0.5 are opaque. Enabling Cutout allows transparent objects to cast shadows in the rasterizer and can improve performance in raytracing when rendering foliage or similar scenes. This is a per material setting. Call supportsUseCutout to query if the texture supports cutout transparency.
Parameters: s (bool) – True to enable cutout transparency, False otherwise.
-
vrdTexture.
setUseImageSequence
(s)¶ When set to True an image sequence can be used as a texture.
Parameters: s (bool) – Set to True if an image sequence should be used as a texture, False otherwise
-
vrdTexture.
setUseInfiniteTiling
(s)¶ Set whether to use infinite tiling on the texture to hide visible repeats.
Parameters: s (bool) – True to enable infinite tiling, False otherwise
-
vrdTexture.
setUseTexture
(s)¶ When set to True an image can be used as a texture.
Parameters: s (bool) – New state for the usage of an image as a texture
-
vrdTexture.
setUseTextureSize
(s)¶ If enabled, the texture size property is used instead of repeat values when using UV mapping, see vrdTexture.getTextureSize(), vrdTexture.setTextureSize(size).
The UV coordinates of the geometry must be properly scaled as well for this option to work correctly, see vrUVService.applyWorldScale(nodes, uvSet).
Parameters: s (bool) – True if the real world texture size is used, False otherwise
-
vrdTexture.
supportsGamma
()¶ Returns: True if gamma correction is supported, False otherwise Return type: bool
-
vrdTexture.
supportsInvertTexture
()¶ Returns: True if texture inversion is supported, False otherwise Return type: bool
-
vrdTexture.
supportsMappingType
()¶ Returns: True if mapping type can be changed for this texture, False otherwise Return type: bool
-
vrdTexture.
supportsUseAlpha
()¶ Returns: True if alpha channel of this texture can be used, False otherwise Return type: bool
-
vrdTexture.
supportsUseCutout
()¶ Returns: True if cutout transparency is supported, False otherwise Return type: bool