3DCoat Python API
The 3DCoat Python API documentation.
Loading...
Searching...
No Matches
coat.utils Class Reference

Static Public Member Functions

vec4 dwordToVec4 (int d)
 convert DWORD (unsigned int) to vec4
 
any vec4ToDword (vec4 v)
 convert vec4 to DWORD (unsigned int)
 
 randomize (int seed)
 set the random seed for all further random value generation
 
float random01 ()
 get the random value 0..1
 
float random (float min, float max)
 get the random value in range
 
vec3 randomNormal ()
 get the normalized random vector
 
vec3 perlin3d (vec3 p, float seed=0)
 returns the perlin noise 3d vector
 
float perlin (vec3 p, float seed=0)
 generate the perlin noise value
 
str getEnumValueByIndex (str enumID, int index)
 get the value from the global strings list by index.
 
int getEnumValue (str enumID, str key)
 get the integer value that corresponds to the string value from the global strings list.
 
int getEnumValueIndex (str enumID, str key)
 get the index of the value in the global strings list.
 
int getEnumValuesCount (str enumID)
 get the count of the values in the global strings list.
 
 clearEnum (str enumID)
 clear the global strings list.
 
 addEnumValue (str enumID, str key, int value=1)
 add the value to the global strings list.
 
 quit ()
 exit the 3DCoat
 
 testSuccessful ()
 report that the test was successful.
 
 testFailed (str message)
 report that the test was successful.
 
 signal (str message)
 send some message to 3DCoat (usually used for internal purposes)
 
list last_signals ()
 get the list of last signals sent to 3DCoat
 
float getFPS ()
 get the current FPS
 
float getFrameTimeMs ()
 get the frame time in milliseconds
 
bool inRenderProcess ()
 check if the viewport is in render process in render room
 
 set (str key, str value)
 Globally set the value for the key, it is even stored between sessions of the 3DCoat.
 
str get (str key)
 Get previously stored value by the key.
 

Member Function Documentation

◆ addEnumValue()

coat.utils.addEnumValue ( str enumID,
str key,
int value = 1 )
static

add the value to the global strings list.

Parameters
enumIDthe enumerator ID
keythe string to add
valuethe integer value that corresponds to the string, -1 means that the value will be the index of the string in the list, it is default value

◆ clearEnum()

coat.utils.clearEnum ( str enumID)
static

clear the global strings list.

Parameters
enumIDthe enumerator ID

◆ dwordToVec4()

vec4 coat.utils.dwordToVec4 ( int d)
static

convert DWORD (unsigned int) to vec4

Parameters
dthe DWORD (unsigned int)
Returns
the 4d vector

◆ get()

str coat.utils.get ( str key)
static

Get previously stored value by the key.

Parameters
keythe key
Returns
the value as string, empty string if not found

◆ getEnumValue()

int coat.utils.getEnumValue ( str enumID,
str key )
static

get the integer value that corresponds to the string value from the global strings list.

Parameters
enumIDthe enumerator ID
keythe string value fo find
Returns
the integer value that corresponds to the string

◆ getEnumValueByIndex()

str coat.utils.getEnumValueByIndex ( str enumID,
int index )
static

get the value from the global strings list by index.

That lists used in dropdown boxes in UI

Parameters
enumIDthe enumerator ID
indexthe index of the value
Returns
the string

◆ getEnumValueIndex()

int coat.utils.getEnumValueIndex ( str enumID,
str key )
static

get the index of the value in the global strings list.

That lists used in dropdown boxes in UI

Parameters
enumIDthe enumerator ID
keythe value to find
Returns
the index of the value, -1 means that value not found

◆ getEnumValuesCount()

int coat.utils.getEnumValuesCount ( str enumID)
static

get the count of the values in the global strings list.

That lists used in dropdown boxes in UI

Parameters
enumIDthe enumerator ID
Returns
the count of the values

◆ getFPS()

float coat.utils.getFPS ( )
static

get the current FPS

Returns
the fps value (averaged)

◆ getFrameTimeMs()

float coat.utils.getFrameTimeMs ( )
static

get the frame time in milliseconds

Returns
the milliseconds amount

◆ inRenderProcess()

bool coat.utils.inRenderProcess ( )
static

check if the viewport is in render process in render room

Returns
true if in render

◆ last_signals()

list coat.utils.last_signals ( )
static

get the list of last signals sent to 3DCoat

Returns
the list reference

◆ perlin()

float coat.utils.perlin ( vec3 p,
float seed = 0 )
static

generate the perlin noise value

Parameters
pthe value in 3d space
seedthe seed
Returns
the perlin noise value

◆ perlin3d()

vec3 coat.utils.perlin3d ( vec3 p,
float seed = 0 )
static

returns the perlin noise 3d vector

Parameters
pthe value in 3d space
seedthe seed
Returns
the perlin noise value

◆ quit()

coat.utils.quit ( )
static

exit the 3DCoat

◆ random()

float coat.utils.random ( float min,
float max )
static

get the random value in range

Parameters
minlow bound
maxhigh bound
Returns
the random value

◆ random01()

float coat.utils.random01 ( )
static

get the random value 0..1

Returns
the random value

◆ randomize()

coat.utils.randomize ( int seed)
static

set the random seed for all further random value generation

Parameters
seedthe seed

◆ randomNormal()

vec3 coat.utils.randomNormal ( )
static

get the normalized random vector

Returns
the 3d random vector

◆ set()

coat.utils.set ( str key,
str value )
static

Globally set the value for the key, it is even stored between sessions of the 3DCoat.

Parameters
keythe key
valuethe value to store

◆ signal()

coat.utils.signal ( str message)
static

send some message to 3DCoat (usually used for internal purposes)

Parameters
messagethe message

◆ testFailed()

coat.utils.testFailed ( str message)
static

report that the test was successful.

In this case the file "InstallFolder/.installer/test_failed.txt created

Parameters
messagethe message to put into that file

◆ testSuccessful()

coat.utils.testSuccessful ( )
static

report that the test was successful.

In this case the file "InstallFolder/.installer/test_success.txt created

◆ vec4ToDword()

any coat.utils.vec4ToDword ( vec4 v)
static

convert vec4 to DWORD (unsigned int)

Parameters
vthe 4d vector
Returns
the DWORD (unsigned int)

The documentation for this class was generated from the following file: