Unigine.PropertyParameter Class
This class is used to represent a property parameter.
PropertyParameter Class
Properties
string StructName#
The name of the structure, that defines the type of the struct parameter.
int ArrayDim#
The dimension of the array parameter.
Multi-dimensional arrays are represented as arrays of arrays, thus, the return value of this method will decrease with each level down the hierarchy.
string ArrayTypeName#
The type name of elements of the array parameter.
int ArrayType#
The type of elements of the array parameter.
int ArraySize#
The current size of the array parameter.
string ValueFile#
The Current file parameter value
int MaskType#
The type of elements of the mask parameter.
int SwitchNumItems#
The Number of items of the switch parameter.
int SliderMaxExpand#
The A value indicating if the maximum value of the slider parameter can be decreased. Slider parameter is a parameter of one of the following types: PARAMETER_INT, PARAMETER_FLOAT, PARAMETER_DOUBLE.
int SliderMinExpand#
The A value indicating if the minimum value of the slider parameter can be decreased. Slider parameter is a parameter of one of the following types: PARAMETER_INT, PARAMETER_FLOAT, PARAMETER_DOUBLE.
int SliderLog10#
The A value indicating if the slider parameter uses a logarithmic scale (with the base ten). The slider parameter is a parameter of one of the following types: PARAMETER_INT, PARAMETER_FLOAT, PARAMETER_DOUBLE.
double DoubleMaxValue#
The maximum double value of the property parameter.
double DoubleMinValue#
The minimum double value of the property parameter.
float FloatMaxValue#
The maximum float value of the property parameter.
float FloatMinValue#
The minimum float value of the property parameter.
int IntMaxValue#
The maximum integer value of the property parameter.
int IntMinValue#
The minimum integer value of the property parameter.
UGUID ValueGUID#
The current value of the property parameter as a UGUID.
int ValueMask#
The current value of the property parameter as an integer mask.
int ValueSwitch#
The current value of the switch parameter. If the PARAMETER_SWITCH variable isn't set for the parameter, the function will return 0.
bool ValueToggle#
The current value of the toggle parameter. If the PARAMETER_TOGGLE variable isn't set for the parameter, the function will return 0.
int ValueNodeID#
The current value of the property parameter as a node id.
Node ValueNode#
The current value of the property parameter as a Node.
Material ValueMaterial#
The current value of the property parameter as a Material.
Property ValueProperty#
The current value of the property parameter as a Property.
vec4 ValueVec4#
The current value of the property parameter as a four-component vec4 vector.
vec3 ValueVec3#
The current value of the property parameter as a three-component vec3 vector.
string ValueString#
The current value of the property parameter as a string.
vec4 ValueColor#
The current value of the property parameter as a four-component vec4 color vector (R, G, B, A).
double ValueDouble#
The current value of the property parameter as a double.
float ValueFloat#
The current value of the property parameter as a float.
int ValueInt#
The current value of the property parameter as an integer.
Curve2d ValueCurve2dOverride#
The A new Curve2d instance for the data stored in the specified property parameter overriding the default one. This method enables you to set individual curves, adjusting the value of the resulting property.
Modifications made to the curve shall not propagate to the parent and sibling properties.
Curve2d ValueCurve2d#
The current Curve2d value of the property parameter.
bool IsCurve2d#
The A value indicating if the current property parameter is a 2d curve.
bool IsStruct#
The A value indicating if the current property parameter is a structure.
bool IsArray#
The A value indicating if the current property parameter is an array.
bool IsNode#
The A value indicating if the current property parameter is a node.
bool IsMaterial#
The A value indicating if the current property parameter is a material.
bool IsProperty#
The A value indicating if the current property parameter is a property.
bool IsFile#
The A value indicating if the current property parameter is a file.
bool IsMask#
The A value indicating if the current property parameter is a mask.
bool IsIVec4#
The A value indicating if the current property parameter is a vector of 4 integer components.
bool IsIVec3#
The A value indicating if the current property parameter is a vector of 3 integer components.
bool IsIVec2#
The A value indicating if the current property parameter is a vector of 2 integer components.
bool IsDVec4#
The A value indicating if the current property parameter is a vector of 4 double components.
bool IsDVec3#
The A value indicating if the current property parameter is a vector of 3 double components.
bool IsDVec2#
The A value indicating if the current property parameter is a vector of 2 double components.
bool IsVec4#
The A value indicating if the current property parameter is a vector of 4 float components.
bool IsVec3#
The A value indicating if the current property parameter is a vector of 3 float components.
bool IsVec2#
The A value indicating if the current property parameter is a vector of 2 float components.
bool IsColor#
The A value indicating if the current property parameter is a color.
bool IsString#
The A value indicating if the current property parameter is a string.
bool IsSwitch#
The A value indicating if the current property parameter is a switch.
bool IsToggle#
The A value indicating if the current property parameter is a toggle.
bool IsDouble#
The A value indicating if the current property parameter is a double.
bool IsFloat#
The A value indicating if the current property parameter is a float.
bool IsInt#
The A value indicating if the current property parameter is an integer.
string Filter#
The filter string associated with the property parameter. this string specifies a filter for file, material or property parameter values thet will be used in the unigineeditor. for example, you can specify ".xml|.node|.txt" to filter certain types of assets, or specify a base material to filter out materials, that cannot be used in a particular case (e.g. to avoid an attempt of assigning a post material to a mesh).
string Group#
The name of the group to which the property parameter belongs.
string Tooltip#
The tooltip for the property parameter. this title is displayed in the unigineeditor's ui.
string Title#
The title of the property parameter. this title is displayed in the unigineeditor's ui.
string Name#
The name of the property parameter.
int Type#
The type identifier of the property parameter. You can get the name of the parameter type using the Property.ParameterNameByType() method:
Log.Message("Parameter type: {0}\n", my_property.ParameterNameByType(my_prop_param.Type));
bool IsOverridden#
The A value indicating if the property parameter is overridden.
bool IsInherited#
The A value indicating if the property parameter is inherited from a parent.
bool IsHidden#
The A value indicating if the property parameter is hidden.
bool IsExist#
The A value indicating if the property parameter is an existing one.
int NumChildren#
The total number of children of the property parameter.
PropertyParameter Parent#
The parent property parameter, if it exists.
UGUID PropertyGUID#
The GUID of the property that owns the parameter.
Property Property#
The property, that owns the parameter.
int ID#
The id of the property parameter.
int SwitchItem#
The
PropertyParameter.SetValue(5); // "blue" shall be selected in the corresponding combobox in the UnigineEditor
PropertyParameter.SetSwitchItem(3); // "yellow" shall be selected in the corresponding combobox in the UnigineEditor (as it is the 3-rd item, starting from 0).
// If "green" item is selected in the UnigineEditor:
PropertyParameter.GetValueInt(); // returns 0, as "green" corresponds to the value of 0.
PropertyParameter.GetSwitchItem() // returns 1, as "green" is the 1-st element in the combobox (starting from 0).
ivec4 ValueIVec4#
The current value of the property parameter as a four-component ivec4 vector.
ivec3 ValueIVec3#
The current value of the property parameter as a three-component ivec3 vector.
ivec2 ValueIVec2#
The current value of the property parameter as a two-component ivec2 vector.
dvec4 ValueDVec4#
The current value of the property parameter as a four-component dvec4 vector.
dvec3 ValueDVec3#
The current value of the property parameter as a three-component dvec3 vector.
dvec2 ValueDVec2#
The current value of the property parameter as a two-component dvec2 vector.
vec2 ValueVec2#
The current value of the property parameter as a two-component vec2 vector.
Members
bool IsChild ( PropertyParameter parameter ) #
Returns a value indicating if the specified property parameter is a child of this property parameter.Arguments
- PropertyParameter parameter - Property parameter to be checked.
Return value
true if the specified property parameter is a child of this property parameter; otherwise, false.int FindChild ( string name ) #
Returns the number of the child property parameter with the specified name.Arguments
- string name - Name of the child property parameter to be found.
Return value
Number of the child property parameter with the specified name, if it exists; otherwise, -1.PropertyParameter GetChild ( int num ) #
Returns a child property parameter by its number.Arguments
- int num - Number of the child property parameter in the range from 0 to the total number of children of this property parameter.
Return value
Child property parameter instance, if it exists; otherwise, nullptr.PropertyParameter GetChild ( string name ) #
Returns a child property parameter by its name.Arguments
- string name - Child property parameter name.
Return value
Child property parameter instance, if it exists; otherwise, nullptr.int GetChildIndex ( PropertyParameter parameter ) #
Returns the index of the specified child property parameter.Arguments
- PropertyParameter parameter - Child property parameter for which an index is to be found.
Return value
Index of the child property parameter in the range from 0 to the total number of children of this property parameter, if such a child exists; otherwise, -1.void SetValue ( int value ) #
Sets the value of the property parameter using the integer value specified.Arguments
- int value - Integer value to be set as the value of the property parameter.
void SetValue ( float value ) #
Sets the value of the property parameter using the float value specified.Arguments
- float value - Float value to be set as the value of the property parameter.
void SetValue ( double value ) #
Sets the value of the property parameter using the double value specified.Arguments
- double value - Double value to be set as the value of the property parameter.
void SetValue ( string value ) #
Sets the value of the property parameter using the string specified.Arguments
- string value - String to be set as the value of the property parameter.
void SetValue ( vec2 value ) #
Sets the value of the property parameter using the two-component vec2 vector specified.Arguments
- vec2 value - Two-component float vector to be set as the value of the property parameter.
void SetValue ( vec3 value ) #
Sets the value of the property parameter using the three-component vec3 vector specified.Arguments
- vec3 value - Three-component float vector to be set as the value of the property parameter.
void SetValue ( vec4 value ) #
Sets the value of the property parameter using the four-component vec4 vector specified.Arguments
- vec4 value - Four-component float vector to be set as the value of the property parameter.
void SetValue ( dvec2 value ) #
Sets the value of the property parameter using the two-component dvec2 vector specified.Arguments
- dvec2 value - Two-component double vector to be set as the value of the property parameter.
void SetValue ( dvec3 value ) #
Sets the value of the property parameter using the three-component dvec3 vector specified.Arguments
- dvec3 value - Three-component double vector to be set as the value of the property parameter.
void SetValue ( dvec4 value ) #
Sets the value of the property parameter using the four-component dvec4 vector specified.Arguments
- dvec4 value - Four-component double vector to be set as the value of the property parameter.
void SetValue ( ivec2 value ) #
Sets the value of the property parameter using the two-component ivec2 vector specified.Arguments
- ivec2 value - Two-component integer vector to be set as the value of the property parameter.
void SetValue ( ivec3 value ) #
Sets the value of the property parameter using the three-component ivec3 vector specified.Arguments
- ivec3 value - Three-component integer vector to be set as the value of the property parameter.
void SetValue ( ivec4 value ) #
Sets the value of the property parameter using the four-component ivec4 vector specified.Arguments
- ivec4 value - Four-component integer vector to be set as the value of the property parameter.
void SetValue ( UGUID value ) #
Sets the value of the property parameter using the UGUID value specified.Arguments
void SetValue ( Node value ) #
Sets the value of the property parameter using the Node specified.Arguments
void SetValue ( Material value ) #
Sets the value of the property parameter using the Material specified.Arguments
void SetValue ( Property value ) #
Sets the value of the property parameter using the Property specified.Arguments
bool SetValue ( Variable value ) #
Sets the value of the property parameter using the Variable specified.Arguments
Return value
true if the property value is set successfully; otherwise, false.void SetValue ( Curve2d value ) #
Sets the value of the property parameter using the Curve2d value specified.Arguments
void ResetValue ( ) #
Resets an overridden value of the property parameter.Resetting a value of the property parameter affects all its children.
Variable GetValue ( ) #
Returns the current value of the property parameter as a Variable.Return value
Value of the property parameter.bool HasSliderMinValue ( ) #
Returns a value indicating if the slider parameter has the minimum value specified. The slider parameter is a parameter of one of the following types: PARAMETER_INT, PARAMETER_FLOAT, PARAMETER_DOUBLE.Return value
true if the slider parameter has the minimum value specified; otherwise, false.bool HasSliderMaxValue ( ) #
Returns a value indicating if the slider parameter has the maximum value specified. The slider parameter is a parameter of one of the following types: PARAMETER_INT, PARAMETER_FLOAT, PARAMETER_DOUBLE.Return value
true if the slider parameter has the maximum value specified; otherwise, false.string GetSwitchItemName ( int item ) #
Returns the name of the item of the switch parameter.Arguments
- int item - Number of the item of the switch parameter.
Return value
Name of the item of the switch parameter with the specified number.int GetSwitchItemValue ( int item ) #
Returns the value of the item of the switch parameter with the specified number.Arguments
- int item - Number of the item of the switch parameter.
Return value
Value of the item of the switch parameter with the specified number.string GetValueFile ( bool fast = 0 ) #
Returns the current value of the file parameter.Arguments
- bool fast - true to use the specified number as an index in users auxiliary parameters cache; otherwise, false.
Return value
Current file parameter value depending on the flags set for the parameter:// flags = "asset"
setValueFile("guid://asset_guid"); // getValueFile() -> asset_path
setValueFile("guid://runtime_guid"); // getValueFile() -> asset_path
setValueFile("asset_path"); // getValueFile() -> asset_path
setValueFile("runtime_path"); // getValueFile() -> asset_path
// flags = "runtime" - default
setValueFile("guid://asset_guid"); // getValueFile() -> runtime_path
setValueFile("guid://runtime_guid"); // getValueFile() -> runtime_path
setValueFile("asset_path"); // getValueFile() -> runtime_path
setValueFile("runtime_path"); // getValueFile() -> runtime_path
// flags = "abspath"
setValueFile(file_path); // getValueFile() -> file_path
To get a GUID of the file, use the getValueGUID() method.
bool GetFileIsAsset ( ) #
Returns a value indicating if the file parameter stores a reference to an asset file.Return value
true if the file parameter stores a reference to an asset file; otherwise, false.bool GetFileIsRuntime ( ) #
Returns a value indicating if the file parameter stores a reference to a runtime file.Return value
true if the file parameter stores a reference to a runtime file; otherwise, false.bool GetFileIsAbsPath ( ) #
Returns a value indicating if the file parameter stores an absolute file path.Return value
true if the file parameter stores an absolute file path; otherwise, false.bool IsFileExist ( ) #
Returns a value indicating if a file corresponding to the property parameter exists.Return value
true if a file corresponding to the property parameter exists; otherwise, false.bool SaveState ( Stream stream ) #
Saves data of the property parameter into a binary stream.Example using saveState() and restoreState() methods:
// create a property parameter and set its state
propertyparam1.ValueInt = 7;
// save state
Blob blob_state = new Blob();
propertyparam1.SaveState(blob_state);
// change state
propertyparam1.ValueInt = 4;
// restore state
blob_state.SeekSet(0); // returning the carriage to the start of the blob
propertyparam1.RestoreState(blob_state, 0);
Arguments
- Stream stream - Stream into which the property parameter data will be saved.
Return value
true if the property parameter data is saved successfully; otherwise, false.bool RestoreState ( Stream stream, int restore_mode = 0 ) #
Restores the data of the property parameter from a binary stream in the specified mode.Example using saveState() and restoreState() methods:
// create a property parameter and set its state
propertyparam1.ValueInt = 7;
// save state
Blob blob_state = new Blob();
propertyparam1.SaveState(blob_state);
// change state
propertyparam1.ValueInt = 4;
// restore state
blob_state.SeekSet(0); // returning the carriage to the start of the blob
propertyparam1.RestoreState(blob_state, 0);
Arguments
- Stream stream - Stream in which the saved property parameter data is stored.
- int restore_mode - Restore mode. One of the Property.RESTORE_MODE_* values. The default value is Property.RESTORE_MODE_REPLACE.
Return value
true if the property parameter data is restored successfully; otherwise, false.bool IsValuePropertyInternal ( ) #
Checks if the property parameter flag is set to internal (flags="internal"). If it is internal, only a property assigned to some node can be assigned to it. If the property parameter is not internal, a property from the Asset Browser can be assigned to it.Return value
true if a property parameter's flag is set to "Internal"; otherwise, false.bool IsValueFitFilter ( Node value ) #
Checks if the type of the indicated node fits the current property parameter filter.Arguments
- Node value
Return value
true, if the node fits the filter; otherwise, false.bool IsValueFitFilter ( Property value ) #
Checks if the indicated property fits the current property parameter filter.Arguments
- Property value
Return value
true, if the property fits the filter; otherwise, false.bool IsValueFitFilter ( Material value ) #
Checks if the indicated material fits the current property parameter filter.Arguments
- Material value
Return value
true, if the material fits the filter; otherwise, false.bool IsValueFitFilter ( UGUID value ) #
Checks if the indicated GUID fits the current property parameter filter.Arguments
- UGUID value
Return value
true, if the GUID fits the filter; otherwise, false.bool IsCurve2d ( ) #
Returns a value indicating if the current property parameter is a 2D curve.Return value
true if the property parameter is a 2D curve; otherwise, false.Last update:
2022-12-14
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)