You are not allowed to perform this action
reference_guide:math_expression_language:functions_variables:output_functions:output_field_mel

Field Output Functions

The ExpressionME-L node allows you to create outputs for specific OpenVDB Field Data, which can then be further processed with any other available node, including another ExpressionME-L node.

Below is a list of functions dedicated to creating and passing on outputs and Field data.

 

Global Variables

Variable Description
field_out Scalar or vector value of the current voxel. Note, this value is only available when the first input is a Field (parallel processing).
field_in_voxelsize World voxel size
field_in_ovoxelsize voxel size in object space
field_out_valuestateValue state of the current voxel “valueon”, “valueoff”, “forcevalueoff”, “forcevalueon”
field_out_id returns the index of the output you created (starting with 0).


field_out_iset

This function sets the value of a voxel in index (voxel) space. The position is rounded to the nearest voxel. The value can be either a scalar or vector.

Calls:

field_out_iset(value_in, ipos_in)
field_out_iset(value_in, ipos_in, set_type_in)
field_out_iset(value_in, ipos_in, set_type_in, create_in)

Parameters:

Parameter Type Description
value_in float or float[3]The value to set for the voxel.
ipos_in float[3] The position in index (voxel) space to set the value.
set_type_inint The set type. Refer to the Set Types table for more information. Default is set_max.
create_in bool “true”: Create a voxel if it does not exist. “false”: Set the value only if the voxel exists. Default is true.

Set Types:

Type Description
set_repReplace the value.
set_addAdd to the existing value.
set_subSubtract from the existing value.
set_mulMultiply the existing value.
set_devDivide the existing value.
set_minSet the minimum value.
set_maxSet the maximum value.

Returns:

ValueDescription
0 The operation failed.
1 The operation was successful.

 

field_out_wset

Description: This function sets the value of a voxel in world space. The position is transformed to index (voxel) space and rounded to the nearest voxel before the value is set. The value can be either a scalar or vector.

Calls:

field_out_wset(value_in, wpos_in)
field_out_wset(value_in, wpos_in, set_type_in)
field_out_wset(value_in, wpos_in, set_type_in, create_in)

Parameters:

Parameter Type Description
value_in float or float[3]The value to set for the voxel.
wpos_in float[3] The position in world space to set the value. The position is transformed to index space before the value is set.
set_type_inint The set type. Refer to the Set Types table for more information. Default is set_max.
create_in bool “true”: Create a voxel if it does not exist. “false”: Set the value only if the voxel exists. Default is true.

Set Types:

Type Description
set_replace Replace the value.
set_add Add to the existing value.
set_subtractSubtract from the existing value.
set_multiplyMultiply the existing value.
set_divide Divide the existing value.
set_min Set the minimum value.
set_max Set the maximum value.

Returns:

ValueDescription
0 The operation failed.
1 The operation was successful.

 

field_out_iraster

This function rasters a value into voxels in a spherical shape centered at a position in index (voxel) space. The radius of the sphere is specified in index space and the value is set for all voxels within the sphere. The radius blending curve can be manipulated using the bias parameter. The value can be either a scalar or vector.

You can call this function by using two 'value_in' parameters, where the first parameter defines the value to be used for the center point of the Sphere. The second parameter will define the end value of the rasterized Sphere. When the second parameter is omitted, a value of 0 is assumed.

This is especially useful in Signed Distance Fields to ensure a transition from negative to positive values.

Calls:

field_out_iraster(value_in, ipos_in, iradius_in)

field_out_iraster(value_in, ipos_in, iradius_in, bias_in)

field_out_iraster(value_in, ipos_in, iradius_in, bias_in, set_type_in)   

field_out_iraster(value_in, ipos_in, iradius_in, bias_in, set_type_in, create_in)

field_out_iraster(value_in, ipos_in, iradius_in, bias_in, set_type_in, create_in, iminradius_in, imaxradius_in)

// Tow value call
field_out_iraster(inner_value_in, outer_value_in, ipos_in, iradius_in)

Parameters:

Parameter Type Description
value_in float or float[3]The value to set for the voxels.
ipos_in float[3] The position in index (voxel) space to center the spherical raster.
iradius_in float The radius of the sphere in index space.
bias_in float Manipulate the radius blending curve. A value of 1 results in a linear curve. Values less than 1 result in a bell curve. Values greater than 1 result in a pointed curve. Default is 1.
set_type_in int The set type. Refer to the Set Types table for more information. Default is set_max.
create_in bool “true”: Create a voxel if it does not exist. “false”: Set the value only if the voxel exists. Default is true.
iminradius_infloat The minimum radius in index space. Default is 1.
imaxradius_infloat The maximum radius in index space. Default is 100.

Set Types:

Type Description
set_replace Replace the value.
set_add Add to the existing value.
set_subtractSubtract from the existing value.
set_multiplyMultiply the existing value.
set_divide Divide the existing value.
set_min Set the minimum value.
set_max Set the maximum value.

Returns:

ValueDescription
0 The operation failed.
1 The operation was successful.

 

field_out_wraster

Description: This function rasters a value into voxels in a spherical shape centered at a position in world space. The radius of the sphere is specified in world space and the value is set for all voxels within the sphere. The radius blending curve can be manipulated using the bias parameter. The value can be either a scalar or vector. The world space position is transformed into index space before setting the voxels.

You can call this function by using two 'value_in' parameters, where the first parameter defines the value to be used for the center point of the Sphere. The second parameter will define the end value of the rasterized Sphere. When the second parameter is omitted, a value of 0 is assumed.

This is especially useful in Signed Distance Fields to ensure a transition from negative to positive values.

Calls:

field_out_wraster(value_in, wpos_in, wradius_in)

field_out_wraster(value_in, wpos_in, wradius_in, bias_in)

field_out_wraster(value_in, wpos_in, wradius_in, bias_in, set_type_in)

field_out_wraster(value_in, wpos_in, wradius_in, bias_in, set_type_in, create_in)

field_out_wraster(value_in, wpos_in, wradius_in, bias_in, set_type_in, create_in, iminradius_in, imaxradius_in)

// Two Parameter call (inner and outer value)
field_out_wraster(inner_value_in,outer_value_in, wpos_in, wradius_in)

Parameters:

Parameter Type Description
value_in float or float[3]The value to set for the voxels.
wpos_in float[3] The position in world space to center the spherical raster.
wradius_in float The radius of the sphere in world space.
bias_in float Manipulate the radius blending curve. A value of 1 results in a linear curve. Values less than 1 result in a bell curve. Values greater than 1 result in a pointed curve. Default is 1.
set_type_in int The set type. Refer to the Set Types table for more information. Default is set_max.
create_in bool “true”: Create a voxel if it does not exist. “false”: Set the value only if the voxel exists. Default is true.
iminradius_infloat The minimum radius in index space. Default is 1.
imaxradius_infloat The maximum radius in index space. Default is 100.

Set Types:

Type Description
set_replace Replace the value.
set_add Add to the existing value.
set_subtractSubtract from the existing value.
set_muliply Multiply the existing value.
set_divide Divide the existing value.
set_min Set the minimum value.
set_max Set the maximum value.

Returns:

ValueDescription
0 The operation failed.
1 The operation was successful.

 

field_out_iextrapolate

This function extrapolates a value into the surrounding voxels in index space using trilinear interpolation. The value can be either a scalar or vector.

Calls:

field_out_iextrapolate(value_in, ipos_in)
field_out_iextrapolate(value_in, ipos_in, set_type_in)
field_out_iextrapolate(value_in, ipos_in, set_type_in, create_in)

Parameters:

Parameter Type Description
value_in float or float[3]The value to set for the voxels.
ipos_in float[3] The position in index space to extrapolate the value.
set_type_inint The set type. Refer to the Set Types table for more information. Default is set_max.
create_in bool “true”: Create a voxel if it does not exist. “false”: Set the value only if the voxel exists. Default is true.

Set Types:

Type Description
set_replace Replace the value.
set_add Add to the existing value.
set_subtractSubtract from the existing value.
set_multiplyMultiply the existing value.
set_divide Divide the existing value.
set_min Set the minimum value.
set_max Set the maximum value.

Returns:

ValueDescription
0 The operation failed.
1 The operation was successful.

 

 

field_out_wextrapolate

This function extrapolates a value into the surrounding voxels in world space using trilinear interpolation. The value can be either a scalar or vector. The position in world space is transformed into index space before extrapolation.

Calls:

field_out_wextrapolate(value_in, wpos_in)
field_out_wextrapolate(value_in, wpos_in, set_type_in)
field_out_wextrapolate(value_in, wpos_in, set_type_in, create_in)

Parameters:

Parameter Type Description
value_in float or float[3]The value to set for the voxels.
wpos_in float[3] The position in world space to extrapolate the value.
set_type_inint The set type. Refer to the Set Types table for more information. Default is set_max.
create_in bool “true”: Create a voxel if it does not exist. “false”: Set the value only if the voxel exists. Default is true.

Set Types:

Type Description
set_replace Replace the value.
set_add Add to the existing value.
set_subtractSubtract from the existing value.
set_muliply Multiply the existing value.
set_divide Divide the existing value.
set_min Set the minimum value.
set_max Set the maximum value.

Returns:

ValueDescription
0 The operation failed.
1 The operation was successful.

field_out_transform

This function transforms a vector or point from one space into various other coordinate spaces. Vector transform represents only rotate/scale and NO translation. Point rtransforms represent a full transform including rotation, scale and translation.
 

Calls:

field_out_transform(transform_point, in_fromto_type, in_vector[3], out_vector[3]);
field_out_transform(transform_vector, in_fromto_type, in_vector[3], out_vector[3]);
field_out_transform(transform_point,in_fromto_type, in_out_vector[3]);
field_out_transform(transform_vector,in_fromto_type, in_out_vector[3]);

Parameters:

Name Description
transform_type sets the transformation type to either vector or point(complete transform). 
in_fromto_type specifies the transformation space to use see below table for possibel options.
in_vector[3] specifies the input 3D vector to transform
out_vector[3] stores the transformed result of this function
in_out_vector[3]the passed in vector will be overwritten with the result of the transformation

transform_types:

Name Description
transform_pointwill do a full transformation (Rotation,Scale,Translation)
transform_vectorwill do a transformation (Rotation,Scale)
transform_directionwill do a rotatioon transformation, only
transform_normalwill do a transformation (Rotation,Scale)
transform_transrotwill do a transformation (Rotation,Translation)

fromto_types:

Name Description
object2worldwill convert the vector from object to world coordinates
world2objectwill convert the vector from world to object coordinates
voxel2world will convert the vector from voxel to world coordinates
world2voxel will convert the vector from world to voxel coordinates
voxel2objectwill convert the vector from voxel to object coordinates
object2voxelwill convert the vector from object to voxel coordinates

Return:

0; Fail, 1; Succed

 

©2024, cebas Visual Technology Inc.

reference_guide/math_expression_language/functions_variables/output_functions/output_field_mel.txt · Last modified: 2024/02/27 00:05 by edwin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki