Surface Definition
Class full path: NemAll_Python_BasisElements.SurfaceDefinition
Surface resource definition
Attributes
AbsolutePath: str
property
writable
get the absolute path of the surface, outside from the design path
AlphaFromTextureStatus: bool
property
writable
get the flag for using alpha channel from the color bitmap
BumpAmplitude: float
property
writable
get bump mapping amplitude
ColorKey: ARGB
property
writable
get the color key color
ColorKeyStatus: bool
property
writable
get the flag for using color key
ColorKeyTolerance: int
property
writable
get the color key tolerance 0-255
ColorMixingFactor: int
property
writable
get the color mixing factor, 0 - 100
ColorMixingMode: int
property
writable
get the color mixing mode.
DiffuseColor: ARGB
property
writable
get the diffuse color
DiffuseReflectivity: int
property
writable
get the diffuse color intensity
Emission: float
property
writable
get the color emission intensity
MetricStatus: bool
property
writable
get the flag for texture scale dependency from the object size. true - texture is scaled independently from the object size
MultiToneFactor: float
property
writable
get the coating reflection intensity
NormalMapStatus: bool
property
writable
get the flag for using normal map texture in bump map, otherwise it will be height map
NotFound: bool
property
writable
get the flag for not found surface file
ParallaxOffset: float
property
writable
get the parallax offset
ParallaxSamples: int
property
writable
get parallax samples
Reflection: int
property
writable
get the reflection amplitude
Refraction: float
property
writable
get the IOR
RelativeName: str
property
writable
get the relative path and name of the surface, under the design folder
RepeatStatus: bool
property
writable
get the flag for texture repeating
Rotation: float
property
writable
get the texture rotation angle in degrees
Roughness: float
property
writable
get the roughness amplitude
Transparency: int
property
writable
get the transparency intensity
Classes
eSurfaceTextureID
Bases: IntEnum
Functions
__getitem__(key)
get the item for a key
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str | int | float
|
value key |
required |
Returns:
Type | Description |
---|---|
eSurfaceTextureID
|
value for the key |
Functions
CompareData(ldef)
compare the surface properties
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ldef
|
SurfaceDefinition
|
|
required |
CopyData(pSrcSurface, bCopyName=True)
copy the data from an other surface
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pSrcSurface
|
SurfaceDefinition
|
|
required |
bCopyName
|
bool
|
|
True
|
Create()
staticmethod
Create a surface definition
Dump(deep)
Dumps content of the resource
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deep
|
bool
|
|
required |
GetDiffuseFactor()
get the diffuse factor calculated from diffuse color intensity, reflection intensity and the transparency intensity
GetHash()
get the hash of the surface definition data
GetReflectionFactor()
calculate the reflection factor from transparency and reflection intensity
GetScaleU()
get the texture u scale factor
GetScaleV()
get the texture v scale factor
GetSeasonStatus()
get the surface season flag , true - not all color texture are the same
GetSurfaceName()
get the surface name
GetTextureID(tex)
get the bitmap id of the texture
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tex
|
eSurfaceTextureID
|
|
required |
GetTranslateU()
get the texture u offset
GetTranslateV()
get the texture v offset
IsDefault()
check whether the surface properties has default values
LoadSurfaceData(surfacePath)
load surface properties only
Parameters:
Name | Type | Description | Default |
---|---|---|---|
surfacePath
|
str
|
|
required |
PreviewCalculationSkipped()
Save(surfacePath, bitmapDict)
Create a surface definition
Returns:
Type | Description |
---|---|
bool
|
Creation successful state |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
surfacePath
|
str
|
Path of the bitmap |
required |
bitmapDefinitions
|
Dict with the bitmap definitions |
required |
SetScale(u, v)
set the texture scaling factors -10000 to 10000
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u
|
float
|
|
required |
v
|
float
|
|
required |
SetTextureID(tex, bitmapID)
set the bitmapID for one texture
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tex
|
eSurfaceTextureID
|
|
required |
bitmapID
|
int
|
|
required |
SetTranslate(u, v)
set the texture offset -INT_MAX to INT_MAX
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u
|
float
|
|
required |
v
|
float
|
|
required |