PropertyParameter Class
This class is used to represent a property parameter.
PropertyParameter Class
Members
const char * getStructName() const#
Return value
Current name of the structure that defines the type of the struct parameter.int getArrayDim() const#
Return value
Current dimension of the array parameter.const char * getArrayTypeName() const#
Return value
Current type name of elements of the array parameter (Float, Node, Material, etc.).int getArrayType() const#
Return value
Current type of array elements, one of the PROPERTY_PARAMETER_* variables.void setArraySize ( int size ) #
Arguments
- int size - The array size (number of elements).
int getArraySize() const#
Return value
Current array size (number of elements).void setValueFile ( string file ) #
value of the file parameter. If the property is not editable, the value won't be updated.
The value stored in the file parameter depends on the flags set for the parameter.
Arguments
- string file - The value for the file parameter.
const char * getValueFile() const#
value of the file parameter. If the property is not editable, the value won't be updated.
The value stored in the file parameter depends on the flags set for the parameter.
Return value
Current value for the file parameter.int getMaskType() const#
Return value
Current Type of the mask parameter, one of the PROPERTY_PARAMETER_MASK_* variables.int getSwitchNumItems() const#
Return value
Current number of items of the switch parameter.int getSliderMaxExpand() const#
Return value
Current 1 if the maximum value can be changed; otherwise, 0.int getSliderMinExpand() const#
Return value
Current 1 if the minimum value can be changed; otherwise, 0.int getSliderLog10() const#
Return value
Current 1 if the property parameter uses a logarithmic scale; otherwise, 0.double getDoubleMaxValue() const#
Return value
Current maximum double value of the property parameter.double getDoubleMinValue() const#
Return value
Current minimum double value of the property parameter.float getFloatMaxValue() const#
Return value
Current maximum float value of the property parameter.float getFloatMinValue() const#
Return value
Current minimum float value of the property parameter.int getIntMaxValue() const#
Return value
Current maximum integer value of the property parameter.int getIntMinValue() const#
Return value
Current minimum integer value of the property parameter.void setValueGUID ( UGUID guid ) #
Arguments
UGUID getValueGUID() const#
Return value
Current value of the UGUID property parameter.void setValueMask ( int mask ) #
Arguments
- int mask - The value of the integer mask property parameter.
int getValueMask() const#
Return value
Current value of the integer mask property parameter.void setValueSwitch ( int switch ) #
Arguments
- int switch - The value of the switch parameter.
int getValueSwitch() const#
Return value
Current value of the switch parameter.void setValueToggle ( bool toggle ) #
Arguments
- bool toggle - true for the toggle parameter value set as enabled, and false for the disabled value.
bool getValueToggle() const#
Return value
true for the toggle parameter value set as enabled, and false for the disabled value.void setValueNodeID ( int id ) #
Arguments
- int id - The value of the node ID property parameter.
int getValueNodeID() const#
Return value
Current value of the node ID property parameter.void setValueNode ( Node node ) #
Arguments
Node getValueNode() const#
Return value
Current value of the Node property parameter.void setValueMaterial ( Material material ) #
Arguments
Material getValueMaterial() const#
Return value
Current value of the Material property parameter.void setValueProperty ( Property property ) #
Arguments
Property getValueProperty() const#
Return value
Current value of the Property-type property parameter.void setValueVec4 ( vec4 vec4 ) #
Arguments
vec4 getValueVec4() const#
Return value
Current value of the four-component vec4 vector property parametervoid setValueVec3 ( vec3 vec3 ) #
Arguments
vec3 getValueVec3() const#
Return value
Current value of the three-component vec3 vector property parametervoid setValueString ( string string ) #
Arguments
- string string - The value of the string property parameter.
const char * getValueString() const#
Return value
Current value of the string property parameter.void setValueColor ( vec4 color ) #
Arguments
vec4 getValueColor() const#
Return value
Current value of the four-component vec4 color vector (R, G, B, A) property parameter.void setValueDouble ( double double ) #
Arguments
- double double - The value of the double property parameter.
double getValueDouble() const#
Return value
Current value of the double property parameter.void setValueFloat ( float float ) #
Arguments
- float float - The value of the float property parameter.
float getValueFloat() const#
Return value
Current value of the float property parameter.void setValueInt ( int int ) #
Arguments
- int int - The value of the integer property parameter.
int getValueInt() const#
Return value
Current value of the integer property parameter.Curve2d getValueCurve2dOverride() const#
Return value
Currentvoid setValueCurve2d ( Curve2d curve2d ) #
Arguments
Curve2d getValueCurve2d() const#
Return value
Current Curve2d value of the property parameter.int isCurve2d() const#
Return value
Current the property parameter is a 2d curveint isStruct() const#
Return value
Current the property parameter is a structureint isArray() const#
Return value
Current the property parameter is an arrayint isNode() const#
Return value
Current the property parameter is a nodeint isMaterial() const#
Return value
Current the property parameter is a materialint isProperty() const#
Return value
Current the property parameter is a propertyint isFile() const#
Return value
Current the property parameter is a fileint isMask() const#
Return value
Current the property parameter is a maskint isIVec4() const#
Return value
Current the property parameter is a vector of 4 integer componentsint isIVec3() const#
Return value
Current the property parameter is a vector of 3 integer componentsint isIVec2() const#
Return value
Current the property parameter is a vector of 2 integer componentsint isDVec4() const#
Return value
Current the property parameter is a vector of 4 double componentsint isDVec3() const#
Return value
Current the property parameter is a vector of 3 double componentsint isDVec2() const#
Return value
Current the property parameter is a vector of 2 double componentsint isVec4() const#
Return value
Current the property parameter is a vector of 4 float componentsint isVec3() const#
Return value
Current the property parameter is a vector of 3 float componentsint isVec2() const#
Return value
Current the property parameter is a vector of 2 float componentsint isColor() const#
Return value
Current the property parameter is a colorint isString() const#
Return value
Current the property parameter is a stringint isSwitch() const#
Return value
Current the property parameter is a switchint isToggle() const#
Return value
Current the property parameter is a toggleint isDouble() const#
Return value
Current the property parameter is a doubleint isFloat() const#
Return value
Current the property parameter is a floatint isInt() const#
Return value
Current the property parameter is an integerconst char * getFilter() const#
Return value
Current string specifying a filter for file, material or property parameter values.const char * getGroup() const#
Return value
Current name of the group to which the property parameter belongs.const char * getTooltip() const#
Return value
Current tooltip for the property parameter.const char * getTitle() const#
Return value
Current title of the property parameter.const char * getName() const#
Return value
Current name of the property parameter.int getType() const#
Return value
Current One of the PROPERTY_PARAMETER_* pre-defined variables; if an error occurs, -1 will be returned.const char * getTypeName() const#
Return value
Current name of the property parameter type.int isOverridden() const#
Return value
Current the property parameter is overriddenint isInherited() const#
Return value
Current the property parameter is inherited from a parentint isHidden() const#
Return value
Current the property parameter is hiddenint isExist() const#
Return value
Current the property parameter is an existing oneint getNumChildren() const#
Return value
Current total number of children of the property parameter.PropertyParameter getParent() const#
Return value
Current Parent property parameter, if it exists; otherwise, NULL.UGUID getPropertyGUID() const#
Return value
Current GUID of the property that owns the parameter.Property getProperty() const#
Return value
Current property that owns the parameter.int getID() const#
Return value
Current ID of the property parameter.void setSwitchItem ( int item ) #
Suppose we have a property switch parameter declared as follows:
<parameter items="red=-1,green,blue=5,yellow"/>
After loading we'll have switch items with the following values: red = -1, green = 0, blue = 5, yellow = 6.
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).
Arguments
- int item - The number of the item of the switch parameter.
int getSwitchItem() const#
Suppose we have a property switch parameter declared as follows:
<parameter items="red=-1,green,blue=5,yellow"/>
After loading we'll have switch items with the following values: red = -1, green = 0, blue = 5, yellow = 6.
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).
Return value
Current number of the item of the switch parameter.void setValueIVec4 ( ivec4 ivec4 ) #
Arguments
- ivec4 ivec4 - The value of the property parameter.
ivec4 getValueIVec4() const#
Return value
Current value of the property parameter.void setValueIVec3 ( ivec3 ivec3 ) #
Arguments
- ivec3 ivec3 - The value of the property parameter.
ivec3 getValueIVec3() const#
Return value
Current value of the property parameter.void setValueIVec2 ( ivec2 ivec2 ) #
Arguments
- ivec2 ivec2 - The value of the property parameter.
ivec2 getValueIVec2() const#
Return value
Current value of the property parameter.void setValueDVec4 ( dvec4 dvec4 ) #
Arguments
- dvec4 dvec4 - The value of the property parameter.
dvec4 getValueDVec4() const#
Return value
Current value of the property parameter.void setValueDVec3 ( dvec3 dvec3 ) #
Arguments
- dvec3 dvec3 - The value of the property parameter.
dvec3 getValueDVec3() const#
Return value
Current value of the property parameter.void setValueDVec2 ( dvec2 dvec2 ) #
Arguments
- dvec2 dvec2 - The value of the property parameter.
dvec2 getValueDVec2() const#
Return value
Current value of the property parameter.void setValueVec2 ( vec2 vec2 ) #
Arguments
- vec2 vec2 - The value of the property parameter.
vec2 getValueVec2() const#
Return value
Current value of the property parameter.int 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
1 if the specified property parameter is a child of this property parameter; otherwise, 0.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.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, NULL.getChild ( ) #
Returns a child property parameter by its name.Arguments
Return value
Child property parameter instance, if it exists; otherwise, NULL.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.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 resetValue ( ) #
Resets an overridden value of the property parameter.Variable getValue ( ) #
Returns the current value of the property parameter as a Variable.Return value
Value of the property parameter.int 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: PROPERTY_PARAMETER_INT, PROPERTY_PARAMETER_FLOAT, PROPERTY_PARAMETER_DOUBLE.Return value
1 if the slider parameter has the minimum value specified; otherwise, 0.int 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: PROPERTY_PARAMETER_INT, PROPERTY_PARAMETER_FLOAT, PROPERTY_PARAMETER_DOUBLE.Return value
1 if the slider parameter has the maximum value specified; otherwise, 0.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 ( int fast = 0 ) #
Returns the current value of the file parameter.Arguments
- int fast - 1 to use the specified number as an index in users auxiliary parameters cache; otherwise, 0.
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
string getValueFile ( ) #
Returns the current value of the file parameter.Return value
Current file parameter valueint getFileIsAsset ( ) #
Returns a value indicating if the file parameter stores a reference to an asset file.Return value
1 if the file parameter stores a reference to an asset file; otherwise, 0.int getFileIsRuntime ( ) #
Returns a value indicating if the file parameter stores a reference to a runtime file.Return value
1 if the file parameter stores a reference to a runtime file; otherwise, 0.int getFileIsAbsPath ( ) #
Returns a value indicating if the file parameter stores an absolute file path.Return value
1 if the file parameter stores an absolute file path; otherwise, 0.int isFileExist ( ) #
Returns a value indicating if a file corresponding to the property parameter exists.Return value
1 if a file corresponding to the property parameter exists; otherwise, 0.int 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.setValueInt(7);
// save state
Blob blob_state = new Blob();
propertyparam1.saveState(blob_state);
// change state
propertyparam1.setValueInt(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
1 if the property parameter data is saved successfully; otherwise, 0.int 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.setValueInt(7);
// save state
Blob blob_state = new Blob();
propertyparam1.saveState(blob_state);
// change state
propertyparam1.setValueInt(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
1 if the property parameter data is restored successfully; otherwise, 0.int 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.int isValuePropertyInterface ( ) #
Checks if the property parameter flag is defined as an interface type (flags="interface"), allowing any component that implements the required interface to be assigned to it.Return value
true if a property parameter's flag is set to "interface"; otherwise, false.The information on this page is valid for UNIGINE 2.20 SDK.