Show Menu

class s7vampy.obj.SurfaceObject(parent, obj)

A surface object is an object that contains a mask and an image with encoded UV coordinates. The mask, the UV image, and the illumination map are all used to render a texture or decal on a surface object. Surface objects become flowline obects in Image Authoring.
Regular surface objects use the global illumination map that is defined in the vignette view. Overlapping surface objects use the local illumination map that is defined in the object itself. (See the illum property.)
When a surface object is created initially, the UV image is automatically generated to fit the object mask.
See also: [Object](../../../c-s7vampy-api-reference/c-classes/c-objects/ - Base class
illum [s7vampy.illum.IlluminationMaps]
Local illumination maps ( [s7vampy.illum.IlluminationMaps](../../../c-s7vampy-api-reference/c-classes/c-illumination-maps/ ).
Local illumination maps are only available for overlap objects.
mask [s7vampy.image.Image, read-only]
Mask image ( [s7vampy.image.Image](../../../c-s7vampy-api-reference/c-classes/c-classes-image/ ).
The mask image is the same size as the vignette view image.
optimal_resolution [float, read-only]
Optimal object resolution in pixels/inch.
The optimal object resolution is calculated according to the object mask and the UV image associated with the object.
origins [s7vampy.origin.OriginPoints]
Decal and texture origin points ( [s7vampy.origin.OriginPoints](../../../c-s7vampy-api-reference/c-classes/c-origin-points/ ).
rect [tuple, read-only]
Object bounding box in the view image (x, y, width, height).
resolution [float]
Object resolution in pixels/inch.
set_size_resolution ( * width *, * height *, * resolution *)
  • width( float ) .
    Object width in inches (must be greater than 0)
  • height( float )
    Object height in inches (must be greater than 0).
  • resolution( float )
    Object resolution in pixels per inch (0.001 - 500).
Modify both the object size and object resolution at the same time.
It is recommended to call this method when both the object size and resolution have to be modified. Otherwise, the object size and the object resolution are verified independently. This may cause an exception to be raised when the object size is changed and the current object resolution becomes out of range, or when the new object resolution is out of range based on the current object size.
size [tuple]
Object size in inches (float, float).
Changing the size of a surface object also adjusts the location of the origin points in the view. It is recommended to define the size and resolution of a surface object before defining the origin points.
UV image.
An UV image can be changed using either an [s7vampy.image.Image](../../../c-s7vampy-api-reference/c-classes/c-classes-image/ instance or an [s7vampy.rla.RLA](../../../c-s7vampy-api-reference/c-classes/c-rla/ instance. UV images retrieved from a vignette are always [s7vampy.image.Image](../../../c-s7vampy-api-reference/c-classes/c-classes-image/ instances.
The UV image or RLA must be the same size as the view image, or a RuntimeError exception is raised.
z_order [int]
Z-order (int, range 0 - 1000).
The z_order property is only available for overlap objects.
New overlap objects have their z_order property automatically initialized to be higher than existing overlap objects in the vignette.
No two overlap objects within a single vignette are allowed to use the same z-order value.