[[
string vstructmember = "inputVstruct.parameter"
]],
- int inputIntArray[3] = {1, 2, 3},
+ int inputInt2[2] = {1, 2},
+ int inputInt3[3] = {1, 2, 3},
+ int inputInt4[4] = {1, 2, 3, 4},
+ int inputIntArray[5] = {1, 2, 3, 4, 5},
string inputStringArray[4] = { "foo", "bar", "baz", "moo" },
float inputFloatArray[5] = { 1.0, 2.0, 3.0, 4.0, 5.0 },
color inputColorArray[2] = { color(1.0, 1.0, 1.0), color(1.0, 1.0, 1.0) },
)
{
// Nothing here!
-}
\ No newline at end of file
+}
OpenShadingLanguage 1.00
-# Compiled by oslc 1.8.2.pixar1697a56
+# Compiled by oslc 1.11.0@OPROJECT_VERSION_RELEASE_TYPE@
# options: -o TestShaderPropertiesNodeOSL.oso
shader TestShaderPropertiesNodeOSL %meta{string,help,"This node is used for testing shader property typecorrectness"}
param int inputInt 1 %read{2147483647,-1} %write{2147483647,-1}
param float inputStruct.foo 0 %read{2147483647,-1} %write{2147483647,-1} %mystruct{inputStruct} %mystructfield{0}
param float inputVstruct 0 %read{2147483647,-1} %write{2147483647,-1}
param float inputVstruct_parameter 0 %meta{string,vstructmember,"inputVstruct.parameter"} %read{2147483647,-1} %write{2147483647,-1}
-param int[3] inputIntArray 1 2 3 %read{2147483647,-1} %write{2147483647,-1}
+param int[2] inputInt2 1 2 %read{2147483647,-1} %write{2147483647,-1}
+param int[3] inputInt3 1 2 3 %read{2147483647,-1} %write{2147483647,-1}
+param int[4] inputInt4 1 2 3 4 %read{2147483647,-1} %write{2147483647,-1}
+param int[5] inputIntArray 1 2 3 4 5 %read{2147483647,-1} %write{2147483647,-1}
param string[4] inputStringArray "foo" "bar" "baz" "moo" %read{2147483647,-1} %write{2147483647,-1}
param float[5] inputFloatArray 1 2 3 4 5 %read{2147483647,-1} %write{2147483647,-1}
param color[2] inputColorArray 1 1 1 1 1 1 %read{2147483647,-1} %write{2147483647,-1}
const normal $const2 1 2 3 %read{1,1} %write{2147483647,-1}
const vector $const3 1 2 3 %read{2,2} %write{2147483647,-1}
code inputPointRoleNone
-# TestShaderPropertiesNodeOSL.osl:63
-# ]],
- assign inputPointRoleNone $const1 %filename{"TestShaderPropertiesNodeOSL.osl"} %line{63} %argrw{"wr"}
+# TestShaderPropertiesNodeOSL.osl:69
+# color inputPointRoleNone = point(1.0, 2.0, 3.0)
+ assign inputPointRoleNone $const1 %filename{"TestShaderPropertiesNodeOSL.osl"} %line{69} %argrw{"wr"}
code inputNormalRoleNone
-# TestShaderPropertiesNodeOSL.osl:67
-# ]],
- assign inputNormalRoleNone $const2 %filename{"TestShaderPropertiesNodeOSL.osl"} %line{67} %argrw{"wr"}
+# TestShaderPropertiesNodeOSL.osl:73
+# color inputNormalRoleNone = normal(1.0, 2.0, 3.0)
+ assign inputNormalRoleNone $const2 %filename{"TestShaderPropertiesNodeOSL.osl"} %line{73} %argrw{"wr"}
code inputVectorRoleNone
-# TestShaderPropertiesNodeOSL.osl:71
-# ]],
- assign inputVectorRoleNone $const3 %filename{"TestShaderPropertiesNodeOSL.osl"} %line{71} %argrw{"wr"}
+# TestShaderPropertiesNodeOSL.osl:77
+# color inputVectorRoleNone = vector(1.0, 2.0, 3.0)
+ assign inputVectorRoleNone $const3 %filename{"TestShaderPropertiesNodeOSL.osl"} %line{77} %argrw{"wr"}
code ___main___
end
}
// We prefer more specific types, so if the arraySize is 2, 3, or 4,
- // then try to convert to a fixed-dimension float array.
+ // then try to convert to a fixed-dimension int or float array.
// In the future if we change this to not return a fixed-size array,
// all the parsers need to be updated to not return a fixed-size
// array as well.
+ if (type == SdrPropertyTypes->Int) {
+ if (arraySize == 2) {
+ return std::make_pair(SdfValueTypeNames->Int2, TfToken());
+ } else if (arraySize == 3) {
+ return std::make_pair(SdfValueTypeNames->Int3, TfToken());
+ } else if (arraySize == 4) {
+ return std::make_pair(SdfValueTypeNames->Int4, TfToken());
+ }
+ }
if (type == SdrPropertyTypes->Float) {
if (arraySize == 2) {
return std::make_pair(SdfValueTypeNames->Float2, TfToken());
vector3f inputs:inputVector = (0.0, 0.0, 0.0)
matrix4d inputs:inputMatrix = (
(0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0) )
- int[] inputs:inputIntArray = [1, 2, 3]
+ int[] inputs:inputInt2 = [1, 2]
+ int[] inputs:inputInt3 = [1, 2, 3]
+ int[] inputs:inputInt4 = [1, 2, 3, 5]
+ int[] inputs:inputIntArray = [1, 2, 3, 4, 5]
string[] inputs:inputStringArray = [ "foo", "bar", "baz", "moo" ]
float[] inputs:inputFloatArray = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
color3f[] inputs:inputColorArray = [ (1.0, 1.0, 1.0), (1.0, 1.0, 1.0) ]