I’ve noticed that when exporting plugins to .vrscene file I’m not getting interpolated attributes say for a deforming mesh.
My test scene consists of a single plane with a single moving vertex
Here is what gets written to my debug.vrscene using the previously posted VRayPluginsExporterBase example code:
GeomStaticMesh my_plugin0 {
vertices=ListVector(
Vector(-0.5, -1.110223e-16, 0.5),
Vector(0.5, -1.110223e-16, 0.5),
Vector(-0.5, -1.110223e-16, -0.5),
Vector(0.5, 0.1928756, -0.5)
);
faces=ListInt(
0,1,3,0,3,2);
normals=ListVector(
Vector(-0.09552449, 0.9908301, 0.09555501),
Vector(-0.09552449, 0.9908301, 0.09555501),
Vector(-0.09552449, 0.9908301, 0.09555501),
Vector(-0.09552449, 0.9908301, 0.09555501)
);
faceNormals=ListInt(
0,1,3,0,3,2);
map_channels=List(
List(
0,
ListVector(
Vector(0, 0, 0),
Vector(1, 0, 0),
Vector(0, 1, 0),
Vector(1, 1, 0)
),
ListInt(
0,1,2,0,2,3)
)
);
dynamic_geometry=0;
smooth_uv_borders=0;
smooth_uv=1;
}
I’ve instrumented my MyVectorListParam (derived from VR::VRayPluginParameter) to see when and with what times getVectorList is called but it results in zero which results in the following when exporting the scene:
frameEnd dumping expanded vrscene:/tmp/debug1.vrscene
t:1010 start:1010 end:1011
get vector list ptr:0x7fd5e81197c0 name: 'vertices' time: 0
num samples: 2 start: 1010 end:1011
get vector list ptr:0x7fd5e81197c0 name: 'vertices' time: 0
num samples: 2 start: 1010 end:1011
get vector list ptr:0x7fd5e81197c0 name: 'vertices' time: 0
num samples: 2 start: 1010 end:1011
get vector list ptr:0x7fd5e8119868 name: 'normals' time: 0
num samples: 2 start: 1010 end:1011
get vector list ptr:0x7fd5e8119868 name: 'normals' time: 0
num samples: 2 start: 1010 end:1011
get vector list ptr:0x7fd5e8119868 name: 'normals' time: 0
num samples: 2 start: 1010 end:1011
I would have expected times in the range [1010,1011] and are the multiple calls indication there is a problem in my implementation?
Here is the maya polygons exportered with proper interpolated attributes and I suppose I would expect something like this in the export
GeomStaticMesh pPlaneShape1@mesh1 {
vertices=interpolate(
(1010, ListVector(
Vector(-0.5, -1.110223e-16, 0.5),
Vector(0.5, -1.110223e-16, 0.5),
Vector(-0.5, 1.110223e-16, -0.5),
Vector(0.5, 0.2014523, -0.5)
)),
(1011, ListVector(
Vector(-0.5, -1.110223e-16, 0.5),
Vector(0.5, -1.110223e-16, 0.5),
Vector(-0.5, 1.110223e-16, -0.5),
Vector(0.5, 0.2359534, -0.5)
))
);
faces=interpolate(
(1010, ListInt(
0,1,3,0,3,2)),
(1011, ListInt(
0,1,3,0,3,2))
);
normals=interpolate(
(1010, ListVector(
Vector(-0.09971951, 0.9900061, 0.09971951),
Vector(-0.09971951, 0.9900061, 0.09971951),
Vector(-0.09971951, 0.9900061, 0.09971951),
Vector(-0.09971951, 0.9900061, 0.09971951)
)),
(1011, ListVector(
Vector(-0.1163682, 0.9863656, 0.1163682),
Vector(-0.1163682, 0.9863656, 0.1163682),
Vector(-0.1163682, 0.9863656, 0.1163682),
Vector(-0.1163682, 0.9863656, 0.1163682)
))
);
faceNormals=interpolate(
(1010, ListInt(
0,1,2,0,2,3)),
(1011, ListInt(
0,1,2,0,2,3))
);
map_channels=interpolate(
(1010, List(
List(
0,
ListVector(
Vector(0, 0, 0),
Vector(1, 0, 0),
Vector(0, 1, 0),
Vector(1, 1, 0),
Vector(0, 0, 0)
),
ListInt(
0,1,3,0,3,2)
)
)),
(1011, List(
List(
0,
ListVector(
Vector(0, 0, 0),
Vector(1, 0, 0),
Vector(0, 1, 0),
Vector(1, 1, 0),
Vector(0, 0, 0)
),
ListInt(
0,1,3,0,3,2)
)
))
);
map_channels_names=ListString(
"map1"
);
edge_visibility=interpolate(
(1010, ListInt(
51)),
(1011, ListInt(
51))
);
primary_visibility=1;
dynamic_geometry=0;
}
Is there a default interpolated attribute class which I should use instead of my own MyVectorListParam? I get the feeling that I’ve missed reading the vray sdk docs and some pointers where to start reading would be useful.
Thanks
- Don