Problem summary:
When defining arbitrary geometry attributes using the geometry.arbitrary.<group>.<attrName> syntax, warnings may be printed to the render log if the number of values in a geometry.arbitrary.<group>.value or geometry.arbitrary.<group>.index attribute does not match the required number of values.
The number of values that are required for a geometry.arbitrary.<group>.value attribute is calculated as
inputTypeSize * scopeSize * elementSize
-
inputTypeSize is inferred from the type of the given geometry.arbitrary.<group>.value attribute, and states the number of values that are required for the respective data type. For example, int, float, and double each require 1 value, color3, normal3, point3 each require 3 values, and matrix9 requires 9 values. The input type to use can be specified by setting a geometry.arbitrary.<group>.inputType attribute of type string.
-
scopeSize depends on the scope that is given in the geometry.arbitrary.<group>.scope attribute, and the type of geometry that is being processed, e.g. nurbspatch, curves, polymesh or subdmesh, pointcloud, or volume.
Examples:
- Geometry type: curves
- Scope: face --> scopeSize = number of tuples of the numVertices attribute
- Scope: point
- If degree attribute value is 1, scopeSize is the same as with scope vertex: the total number of vertices for each curve.
- If degree attribute value is 3, scopeSize is calculated based on whether the curve is open or closed.
- For an open curve, scopeSize is calculated as (numberOfVertices - 4) / vstep + 2.
- For a closed curve, scopeSize is calculated as numberOfVertices / vstep.
- Scope: vertex --> scopeSize = total number of vertices for each curve
- Geometry type: polymesh or subdmesh,
- Scope: face --> scopeSize = number of tuples of the poly.startIndex attribute minus 1
- Scope: point --> scopeSize = number of tuples of the point.P attribute
- Scope: vertex --> scopeSize = number of tuples of the poly.vertexList attribute
- Geometry type: pointcloud
- Scope: face, point, or vertex: --> scopeSize = number of tuples of the point.P attribute
-
elementSize by default is 1, but can be set using the geometry.arbitrary.<group>.elementSize attribute. This optional attribute determines the array length of each scoped element. This is used by some renderers, for example, PRMan maps this to the [n] portion of a RenderMan type declaration: uniform color[2]
Steps to reproduce:
- Start KATANA.
- Choose Help > I want a pony, and place the PonyCreate node in the Node Graph tab.
- Create an OpScript node, connect it to the PonyCreate node, set its CEL parameter to match /root/world/geo/pony, and enter the following lines of code in the script.lua parameter:
-
Interface.SetAttr("geometry.arbitrary.foo.value", FloatAttribute({1, 2, 3, 4, 5}))Interface.SetAttr("geometry.arbitrary.foo.scope", StringAttribute("point"))
-
Create a CameraCreate node.
-
Select the OpScript and CameraCreate nodes, and press the M key to merge them using a Merge node downstream.
-
Start a preview render from the Merge node.
Expected behaviour:
Once rendering has started, the Render Log should contain something like the following message to warn about missing values for the geometry.arbitrary.foo.value attribute:
[KatanaProcedural] Warning: /root/world/geo/pony - Unrecognized arbitrary parameter 'foo':The number of values in the 'foo.value' attribute does not match the required number of values: 5 != 29020(type 'float' requires 1 value for each of 29020 'point' elements of size 1).
Actual behaviour:
Once rendering has started, the Render Log contains the following message to warn about missing values for the geometry.arbitrary.foo.value attribute:
[KatanaProcedural] Warning: /root/world/geo/pony - Unrecognized arbitrary parameter 'foo':The 'value' attribute length of 5 does not match required multiple of 1..
Workaround:
No known workaround.
Reproduced versions/platforms: