Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Defines the name of a group under which the widget of the attribute will be placed. Nested groups can be defined by formatting the page value string as "parent group.child group".


float slidermin, float slidermax

...

Code Block
string options = "clamp|black|mirror|periodic" 

floatRamp

maya_colorRamp

maya_floatRamp

else if(meta.name == "options")
else if(meta.name == "widget")
{
index = StringMetadata::widget;
}
else if(meta.name == "niceName")
{
index = StringMetadata::niceName;
}
else if(meta.name == "related_to_widget")
{
index = StringMetadata::relatedToWidget;
}
else if(meta.name == "defaultColorSpace")

string maya_type

Specifies the type of the Maya attribute related to the shader parameter. For now, only bool is supported to display an integer parameter as a checkbox.

string maya_name

Specifies the name of the Maya attribute related to the shader parameter.

string maya_label

Specifies the label to use for the Maya attribute in the various Maya editors (Attribute EditorNode EditorChannel Box, etc.).

string maya_group

Specifies the label of a Frame Layout into which the Maya attribute will be displayed in the Attribute Editor.

float maya_min

Specifies the soft minimum value for the Maya attribute attribute related to the shader parameter.

float maya_max

Specifies the soft maximum value for the Maya attribute attribute related to the shader parameter.

int maya_hidden

When set to 1, the Maya attribute will not be shown in the Attribute Editor. It will still be visible in the other Maya editors (Node EditorChannel Box, etc.).

...

The ramp widgets require more than one shader parameters and are explained in a dedicated section.


Getting the texture coordinates

Because retrieving the UV coordinates is a costly process, it is best to centralize this operation in a single shader and share the results with all shaders. For a shader to benefit of this, it may declare a parameter similar to this:

Code Block
languagecpp
themeMidnight
float uvCoord[2] = { 0, 0 } 
[[
	string default_connection = "uvCoord",
	int skip_init = 1,
	string label = "UV Coordinates",
	string widget = "null" 
]],

This uses the following metadata intended to address this specific problem:

string default_connection = "uvCoord"

int skip_init = 1

This combination of metadata instruct that when no incoming connection exists on the node attribute, one should be established between the uvCoord shader that 3Delight outputs by default and this parameter. The uvCoord shader is the centralized place to fetch the UV coordinates. 

Ramp widgets

The ramp widgets in Maya and Katana both require 3 different attributes. They also have diverging expectations and features. 

Maya-style float ramp widget

The triplet of shader parameters required to present a Maya-style float ramp can be declared as follows:

Code Block
float i_value_Position[] = { 0, 1 } 
[[
	string katana_attribute = "value_Knots",
	string maya_attribute = "value.value_Position",
	string related_to_widget = "maya_floatRamp",
	string widget = "null"
]],

float i_value_FloatValue[] = { 0, 1 } 
[[
	string katana_attribute = "value_Floats",
	string maya_attribute = "value.value_FloatValue",
	string label = "value",
	string widget = "maya_floatRamp" 
]],

int i_value_Interp[] = { 1, 1 } 
[[
	string katana_attribute = "value_Interpolation",
	string attribute = "value.value_Interp",
	string related_to_widget = "maya_floatRamp",
	string widget = "null" 
]],

Maya-style color ramp widget

Code Block
float i_color_Position[] = { 0, 1 }
[[
	string katana_attribute = "color_Knots",
	string maya_attribute = "color.color_Position",
	string related_to_widget = "maya_colorRamp",
	string widget = "null"
]],

color i_color_Color[] = { 0, 1 }
[[
	string katana_attribute = "color_Colors",
	string maya_attribute = "color.color_Color",
	string label = "color",
	string widget = "maya_colorRamp"
]],

int i_color_Interp[] = { 1, 1 } 
[[
	string katana_attribute = "color_Interpolation",
	string maya_attribute = "color.color_Interp",
	string related_to_widget = "maya_colorRamp",
	string widget = "null"
]],