vray.Class

class vray.Class

Bases: object

V-Ray Plugin Class

A type class that defines a particular V-Ray render plugin type. It allows creation of new instances if called as a function. It also supplies meta information about the type.

Methods

__init__()

getCategories

Returns a list of categories to which this class belongs.

getDeprecation

Returns a deprecation string for this render plugin type.

getDescription

Returns a description for this render plugin type.

getGPUSupport

Returns to what extent the plugin is supported in V-Ray GPU

getInstance

Returns the last Plugin instance of the class, if any.

getInstanceOrCreate

Returns the last Plugin instance of the class or creates a new instance if not available.

getInstances

Returns a list of all Plugin instances of the class.

getMeta

Obtains meta information about all properties (if no arguments) or about a particular one (if a name is given as an argument). The meta information consists of the following fields: * name: The primary name of this property. * aliases: A list of alias names of this property. * type: The type of the property value by definition. The runtime type may be slightly different for texture objects - they can be Plugin references or plain AColor, Vector, etc. values. * defaultValue: The default value of this property.This will never be a list.For list types the default value of an element is used, if any. It is undefined if a default value is not available. * description: A short description of this property. May be empty. * deprecation: A deprecation string for this property. May be empty. * uiGuides: A short description string of what the name of this property in UI should be, min and max values, etc. This information is not available for many properties. * GPUSupport: To what extent the property is supported by V - Ray GPU. * elementsCount: The number of elements for the property if it is a list. It is undefined otherwise.

getName

Returns this class name as a string.

getRenderer

Returns the VRayRenderer instance to which this class belongs.

getUIGuides

Obtains UI Guides information about all properties (if no arguments) or about a particular one (if a name is given as an argument). The information consists of the following fields (in general the object consists of a subset of the fields): * guideTypes: A list of strings which represent all UI Guide types which this parameter has and are listed as fields of this object. The possible values are: - Enum: A list of enumerated strings used as combo-box items. For example, ‘enum=(-1:a;0:b;1:c;2:d)’ means the combo-box will have 4 strings - a,b,c,d and the integers are the corresponding values. - Enable: Indicates when the control should be active (not grayed out), depending on other plugin parameter values. - DisplayName: Specifies a user-friendly display name to be used instead of the parameter name. For example, ‘displayName=(Refraction Glossiness)’. - MinValue: Limits the min value of the control. - MaxValue: Limits the max value of the control. - SpinStep: Adds a step hint to a slider. - Units: Gives information about the units of the parameter. This guide lets the UI present the parameter in a more appropriate form to the user (e.g., converting radians to degrees). - FileAsset: Used to mark filename parameters. The format is ‘fileAsset=(ext0;ext1;ext2)’, where ext0,ext1,ext2 are the supported extensions (for all extensions). - Attributes: Used to specify some additional attributes for the parameter. The format is ‘attributes=(attr0;attr1;attr2)’. - StringEnum: A list of enumerated strings used as combo-box items. For example, ‘string_enum=(value1;value2;value3)’ means the combo-box will have 3 strings - value1,value2,value3. - FileAssetNames: Used to give longer names to the file extensions. The format is ‘fileAssetNames=(ext0_LongName;ext1_LongName;ext2_LongName)’. For example, ‘Portable Network Graphics’ for a ‘png’ extension in ‘fileAsset’. - FileAssetOp: Specifies whether the file asset is going to be loaded or saved (or both) by V-Ray. - StartRollout: If this is present, a roll-out should be added starting with this parameter. The roll-out name is specified like this ‘startRollout=(rollout_name)’. If ‘rollout_name’ is an empty string, a simple divider of some kind should be added before the parameter. For example, ‘startRollout=(Reflection layer)’. If ‘rollout_name’ is equal to the special string ‘<EndRollout>’, this means that this parameter is the last that should be part of the roll-out. - StartTab: If this is present, a tab should be added starting with this parameter. The name of the tab is specified like this ‘startTab=(tab_name)’. For example, ‘startTab=(V-Ray Material)’. - SoftMinValue: Limits the min value of the control initially (the user can override it). - SoftMaxValue: Limits the max value of the control initially (the user can override it). - QuantityType: Defines the quantity type that the parameter represents. For example, ‘quantityType=(distance)’. - OverridenBy: Marks a parameter that is overridden by another parameter. The format is ‘overridenBy=(overridingParamName)’. - Overrides: Marks a parameter that overrides another parameter. The format is ‘overrides=(overridenParamName)’. - GPUSupport: Specifies the extent to which the parameter is supported by V-Ray GPU. - Tier: Specifies the UI tier where the parameter should be shown. By default, the UI should show the ‘default’ tier. - Hide: Indicates when the control should be hidden (not shown at all), depending on other plugin parameter values. - DefaultValue: Specifies the default value which should be used when generating UI for this parameter. The format is ‘defaultValue=(number0,number1,number2,…,numberN)’. It is possible to specify a maximum of 16 values. The number is in float format (1.0 or 1e6), and for parameters that don’t use float storage (int, bool), the parameter is converted using C/C++ conversion rules. * enumStrings: An object with keys strings and values integers used as combo-box items. It is added as a property if ‘guideTypes’ has the guide type ‘Enum’ present. * enabledDepends: A list of strings which represent the names of the parameter dependencies for the enabled condition of the parameter. It is added as a property if ‘guideTypes’ has the guide type ‘Enable’ present. * displayName: A user-friendly display name to be used instead of the parameter name. It is added as a property if ‘guideTypes’ has the guide type ‘DisplayName’ present. * minValue: A floating-point number which limits the min value of the control. It is added as a property if ‘guideTypes’ has the guide type ‘MinValue’ present. * maxValue: A floating-point number which limits the max value of the control. It is added as a property if ‘guideTypes’ has the guide type ‘MaxValue’ present. * spinStep: A floating-point number which adds a step hint to a slider. It is added as a property if ‘guideTypes’ has the guide type ‘SpinStep’ present. * units: Gives information about the units of the parameter. It is added as a property if ‘guideTypes’ has the guide type ‘Units’ present. The possible values are: - DefaultUnits: Default unit type. - Radians: Unit type is radians. - Degrees: Unit type is degrees. - Millimeters: Unit type is millimeters. - Centimeters: Unit type is centimeters. - Meters: Unit type is meters. * fileAssetExts: A list of strings to mark filename extensions which the parameter supports. It is added as a property if ‘guideTypes’ has the guide type ‘FileAsset’ present. * attributes: A list of strings used to specify some additional attributes for the parameter. It is added as a property if ‘guideTypes’ has the guide type ‘Attributes’ present. The possible values are: - None: No additional attributes. - ObjectSet: Mark plugin list parameters as taking geometry objects for the values. - TextureSlot: Mark a texture parameter as accepting only texture maps, no constant float/color/etc. values. The UI for such a parameter shouldn’t include a slider or color picker, but just a slot for connecting textures. If no texture is connected, such parameters shouldn’t be set at all, for performance reasons. - LightSet: Mark plugin list parameters as containing light plugins. - PartOf3dsMaxTriple: Mark color/color_tex/color_tex_mult parameter with this attribute. - BitSet: Mark the parameter as having multiple bitwise OR’ed values. The single bit values may be described by enum=(..). - Boolean: Mark the parameter as having only two acceptable values (0/1). Used for parameters that are represented by ‘int’ type to allow easy future extensions, while still allowing generated UI to use check-boxes for representing the parameter. * stringEnumStrings: A list of enumerated strings used as combo-box items. It is added as a property if ‘guideTypes’ has the guide type ‘StringEnum’ present. * fileAssetExtNames: A list of enumerated strings used to give longer names to the file extensions. It is added as a property if ‘guideTypes’ has the guide type ‘FileAssetNames’ present. * fileAssetOp: A string which whether the file asset is going to be loaded or saved (or both) by V-Ray. It is added as a property if ‘guideTypes’ has the guide type ‘FileAssetOp’ present. The possible values are: - Load: The file asset is going to be loaded. - Save: The file asset is going to be saved. - LoadAndSave: The file asset can be both loaded and saved. * startRollout: A string which indicates that a roll-out should be added starting with this parameter. It is added as a property if ‘guideTypes’ has the guide type ‘StartRollout’ present. * startTab: A string which indicates that a tab should be added starting with this parameter. It is added as a property if ‘guideTypes’ has the guide type ‘StartTab’ present. * softMinValue: A floating-point number which limits the min value of the control initially (the user can override it). It is added as a property if ‘guideTypes’ has the guide type ‘SoftMinValue’ present. * softMaxValue: A floating-point number which limits the max value of the control initially (the user can override it). It is added as a property if ‘guideTypes’ has the guide type ‘SoftMaxValue’ present. * quantity: A string which defines the quantity type that the parameter represents. It is added as a property if ‘guideTypes’ has the guide type ‘QuantityType’ present. The possible values are: - Unknown: Default type if the quantity type is not specified. - Distance: If no units are set, the distance is in ‘scene units’, and conversion to meters is defined by the value of SettingsUnitsInfo::meters_scale. If the units set are ‘millimeters’, ‘centimeters’, or ‘meters’, the ‘distance’ quantity type is implied, so you can omit it in the uiGuides string. This type is valid only for ‘float’, ‘double’, and ‘vector’ parameters. - Angle: If the unit type is radians or degrees, this is implied, so you can omit it in the uiGuides string. If no unit type is specified, then the UI code should assume that the angle is in ‘degrees’. This type is valid only for ‘float’, ‘double’, and ‘vector’ parameters. - LocalSubdivs: This should be specified on parameters which are affected by the ‘Use Local Subdivs’ option of the DMC Sampler (SettingsDMCSampler::use_local_subdivs). * overridenBy: A string is the name of the parameter which overrides the current parameter. It is added as a property if ‘guideTypes’ has the guide type ‘OverridenBy’ present. * overrides: A list of strings which are names of the parameters which the current parameter overrides. It is added as a property if ‘guideTypes’ has the guide type ‘Overrides’ present. * gpuSupport: A string which specifies the extent to which the parameter is supported by V-Ray GPU. It is added as a property if ‘guideTypes’ has the guide type ‘GPUSupport’ present. The possible values are: - Full: This parameter is fully supported in V-Ray GPU. - Partial: This parameter is partially supported in V-Ray GPU. - None: This parameter is not supported in V-Ray GPU. - Unknown: It is unknown if this parameter is supported or not in V-Ray GPU. * tier: A string which specifies the UI tier where the parameter should be shown. It is added as a property if ‘guideTypes’ has the guide type ‘Tier’ present. The possible values are: - Basic: The most basic tier. - DefaultTier: The default tier. - Advanced: The most advanced tier. * hiddenDepends: A list of strings which represent the names of the parameter dependencies for the hidden condition of the parameter. It is added as a property if ‘guideTypes’ has the guide type ‘Hide’ present. * defaultValue: Specifies the default value (primitive type, never a list) which should be used when generating UI for this parameter. It is added as a property if ‘guideTypes’ has the guide type ‘DefaultValue’ present. * defaultValues: Specifies the default value (a list of values) which should be used when generating UI for this parameter. It is added as a property if ‘guideTypes’ has the guide type ‘DefaultValue’ present.

getCategories()

Returns a list of categories to which this class belongs.

getDeprecation()

Returns a deprecation string for this render plugin type. May be None.

getDescription()

Returns a description for this render plugin type. May be None.

getGPUSupport()

Returns to what extent the plugin is supported in V-Ray GPU

getInstance()

Returns the last Plugin instance of the class, if any.

getInstanceOrCreate()

Returns the last Plugin instance of the class or creates a new instance if not available. The optional one parameter “plugin name” is used only if a new instance has to be created. This is intended mostly for Settings plugin classes which should have only one instance in a scene.

getInstances()

Returns a list of all Plugin instances of the class.

getMeta()

Obtains meta information about all properties (if no arguments) or about a particular one (if a name is given as an argument). The meta information consists of the following fields:

  • name: The primary name of this property.

  • aliases: A list of alias names of this property.

  • type: The type of the property value by definition. The runtime type may be slightly different for texture objects - they can be Plugin references or plain AColor, Vector, etc. values.

  • defaultValue: The default value of this property.This will never be a list.For list types the default value of an element is used, if any. It is undefined if a default value is not available.

  • description: A short description of this property. May be empty.

  • deprecation: A deprecation string for this property. May be empty.

  • uiGuides: A short description string of what the name of this property in UI should be, min and max values, etc. This information is not available for many properties.

  • GPUSupport: To what extent the property is supported by V - Ray GPU.

  • elementsCount: The number of elements for the property if it is a list. It is undefined otherwise.

getName()

Returns this class name as a string.

getRenderer()

Returns the VRayRenderer instance to which this class belongs.

getUIGuides()

Obtains UI Guides information about all properties (if no arguments) or about a particular one (if a name is given as an argument). The information consists of the following fields (in general the object consists of a subset of the fields):

  • guideTypes: A list of strings which represent all UI Guide types which this parameter has and are listed as fields of this object. The possible values are:
    • Enum: A list of enumerated strings used as combo-box items. For example, ‘enum=(-1:a;0:b;1:c;2:d)’ means the combo-box will have 4 strings - a,b,c,d and the integers are the corresponding values.

    • Enable: Indicates when the control should be active (not grayed out), depending on other plugin parameter values.

    • DisplayName: Specifies a user-friendly display name to be used instead of the parameter name. For example, ‘displayName=(Refraction Glossiness)’.

    • MinValue: Limits the min value of the control.

    • MaxValue: Limits the max value of the control.

    • SpinStep: Adds a step hint to a slider.

    • Units: Gives information about the units of the parameter. This guide lets the UI present the parameter in a more appropriate form to the user (e.g., converting radians to degrees).

    • FileAsset: Used to mark filename parameters. The format is ‘fileAsset=(ext0;ext1;ext2)’, where ext0,ext1,ext2 are the supported extensions (for all extensions).

    • Attributes: Used to specify some additional attributes for the parameter. The format is ‘attributes=(attr0;attr1;attr2)’.

    • StringEnum: A list of enumerated strings used as combo-box items. For example, ‘string_enum=(value1;value2;value3)’ means the combo-box will have 3 strings - value1,value2,value3.

    • FileAssetNames: Used to give longer names to the file extensions. The format is ‘fileAssetNames=(ext0_LongName;ext1_LongName;ext2_LongName)’. For example, ‘Portable Network Graphics’ for a ‘png’ extension in ‘fileAsset’.

    • FileAssetOp: Specifies whether the file asset is going to be loaded or saved (or both) by V-Ray.

    • StartRollout: If this is present, a roll-out should be added starting with this parameter. The roll-out name is specified like this ‘startRollout=(rollout_name)’. If ‘rollout_name’ is an empty string, a simple divider of some kind should be added before the parameter. For example, ‘startRollout=(Reflection layer)’. If ‘rollout_name’ is equal to the special string ‘<EndRollout>’, this means that this parameter is the last that should be part of the roll-out.

    • StartTab: If this is present, a tab should be added starting with this parameter. The name of the tab is specified like this ‘startTab=(tab_name)’. For example, ‘startTab=(V-Ray Material)’.

    • SoftMinValue: Limits the min value of the control initially (the user can override it).

    • SoftMaxValue: Limits the max value of the control initially (the user can override it).

    • QuantityType: Defines the quantity type that the parameter represents. For example, ‘quantityType=(distance)’.

    • OverridenBy: Marks a parameter that is overridden by another parameter. The format is ‘overridenBy=(overridingParamName)’.

    • Overrides: Marks a parameter that overrides another parameter. The format is ‘overrides=(overridenParamName)’.

    • GPUSupport: Specifies the extent to which the parameter is supported by V-Ray GPU.

    • Tier: Specifies the UI tier where the parameter should be shown. By default, the UI should show the ‘default’ tier.

    • Hide: Indicates when the control should be hidden (not shown at all), depending on other plugin parameter values.

    • DefaultValue: Specifies the default value which should be used when generating UI for this parameter. The format is ‘defaultValue=(number0,number1,number2,…,numberN)’. It is possible to specify a maximum of 16 values. The number is in float format (1.0 or 1e6), and for parameters that don’t use float storage (int, bool), the parameter is converted using C/C++ conversion rules.

  • enumStrings: An object with keys strings and values integers used as combo-box items. It is added as a property if ‘guideTypes’ has the guide type ‘Enum’ present.

  • enabledDepends: A list of strings which represent the names of the parameter dependencies for the enabled condition of the parameter. It is added as a property if ‘guideTypes’ has the guide type ‘Enable’ present.

  • displayName: A user-friendly display name to be used instead of the parameter name. It is added as a property if ‘guideTypes’ has the guide type ‘DisplayName’ present.

  • minValue: A floating-point number which limits the min value of the control. It is added as a property if ‘guideTypes’ has the guide type ‘MinValue’ present.

  • maxValue: A floating-point number which limits the max value of the control. It is added as a property if ‘guideTypes’ has the guide type ‘MaxValue’ present.

  • spinStep: A floating-point number which adds a step hint to a slider. It is added as a property if ‘guideTypes’ has the guide type ‘SpinStep’ present.

  • units: Gives information about the units of the parameter. It is added as a property if ‘guideTypes’ has the guide type ‘Units’ present. The possible values are:
    • DefaultUnits: Default unit type.

    • Radians: Unit type is radians.

    • Degrees: Unit type is degrees.

    • Millimeters: Unit type is millimeters.

    • Centimeters: Unit type is centimeters.

    • Meters: Unit type is meters.

  • fileAssetExts: A list of strings to mark filename extensions which the parameter supports. It is added as a property if ‘guideTypes’ has the guide type ‘FileAsset’ present.

  • attributes: A list of strings used to specify some additional attributes for the parameter. It is added as a property if ‘guideTypes’ has the guide type ‘Attributes’ present. The possible values are:
    • None: No additional attributes.

    • ObjectSet: Mark plugin list parameters as taking geometry objects for the values.

    • TextureSlot: Mark a texture parameter as accepting only texture maps, no constant float/color/etc. values. The UI for such a parameter shouldn’t include a slider or color picker, but just a slot for connecting textures. If no texture is connected, such parameters shouldn’t be set at all, for performance reasons.

    • LightSet: Mark plugin list parameters as containing light plugins.

    • PartOf3dsMaxTriple: Mark color/color_tex/color_tex_mult parameter with this attribute.

    • BitSet: Mark the parameter as having multiple bitwise OR’ed values. The single bit values may be described by enum=(..).

    • Boolean: Mark the parameter as having only two acceptable values (0/1). Used for parameters that are represented by ‘int’ type to allow easy future extensions, while still allowing generated UI to use check-boxes for representing the parameter.

  • stringEnumStrings: A list of enumerated strings used as combo-box items. It is added as a property if ‘guideTypes’ has the guide type ‘StringEnum’ present.

  • fileAssetExtNames: A list of enumerated strings used to give longer names to the file extensions. It is added as a property if ‘guideTypes’ has the guide type ‘FileAssetNames’ present.

  • fileAssetOp: A string which whether the file asset is going to be loaded or saved (or both) by V-Ray. It is added as a property if ‘guideTypes’ has the guide type ‘FileAssetOp’ present. The possible values are:
    • Load: The file asset is going to be loaded.

    • Save: The file asset is going to be saved.

    • LoadAndSave: The file asset can be both loaded and saved.

  • startRollout: A string which indicates that a roll-out should be added starting with this parameter. It is added as a property if ‘guideTypes’ has the guide type ‘StartRollout’ present.

  • startTab: A string which indicates that a tab should be added starting with this parameter. It is added as a property if ‘guideTypes’ has the guide type ‘StartTab’ present.

  • softMinValue: A floating-point number which limits the min value of the control initially (the user can override it). It is added as a property if ‘guideTypes’ has the guide type ‘SoftMinValue’ present.

  • softMaxValue: A floating-point number which limits the max value of the control initially (the user can override it). It is added as a property if ‘guideTypes’ has the guide type ‘SoftMaxValue’ present.

  • quantity: A string which defines the quantity type that the parameter represents. It is added as a property if ‘guideTypes’ has the guide type ‘QuantityType’ present. The possible values are:
    • Unknown: Default type if the quantity type is not specified.

    • Distance: If no units are set, the distance is in ‘scene units’, and conversion to meters is defined by the value of SettingsUnitsInfo::meters_scale. If the units set are ‘millimeters’, ‘centimeters’, or ‘meters’, the ‘distance’ quantity type is implied, so you can omit it in the uiGuides string. This type is valid only for ‘float’, ‘double’, and ‘vector’ parameters.

    • Angle: If the unit type is radians or degrees, this is implied, so you can omit it in the uiGuides string. If no unit type is specified, then the UI code should assume that the angle is in ‘degrees’. This type is valid only for ‘float’, ‘double’, and ‘vector’ parameters.

    • LocalSubdivs: This should be specified on parameters which are affected by the ‘Use Local Subdivs’ option of the DMC Sampler (SettingsDMCSampler::use_local_subdivs).

  • overridenBy: A string is the name of the parameter which overrides the current parameter. It is added as a property if ‘guideTypes’ has the guide type ‘OverridenBy’ present.

  • overrides: A list of strings which are names of the parameters which the current parameter overrides. It is added as a property if ‘guideTypes’ has the guide type ‘Overrides’ present.

  • gpuSupport: A string which specifies the extent to which the parameter is supported by V-Ray GPU. It is added as a property if ‘guideTypes’ has the guide type ‘GPUSupport’ present. The possible values are:
    • Full: This parameter is fully supported in V-Ray GPU.

    • Partial: This parameter is partially supported in V-Ray GPU.

    • None: This parameter is not supported in V-Ray GPU.

    • Unknown: It is unknown if this parameter is supported or not in V-Ray GPU.

  • tier: A string which specifies the UI tier where the parameter should be shown. It is added as a property if ‘guideTypes’ has the guide type ‘Tier’ present. The possible values are:
    • Basic: The most basic tier.

    • DefaultTier: The default tier.

    • Advanced: The most advanced tier.

  • hiddenDepends: A list of strings which represent the names of the parameter dependencies for the hidden condition of the parameter. It is added as a property if ‘guideTypes’ has the guide type ‘Hide’ present.

  • defaultValue: Specifies the default value (primitive type, never a list) which should be used when generating UI for this parameter. It is added as a property if ‘guideTypes’ has the guide type ‘DefaultValue’ present.

  • defaultValues: Specifies the default value (a list of values) which should be used when generating UI for this parameter. It is added as a property if ‘guideTypes’ has the guide type ‘DefaultValue’ present.