Closed benjamin-heasly closed 11 years ago
This raises the issue of how to refer to each polylist.
Mitsuba refers to each polylist object using the name of the parent geometry, plus a numeric suffix. So, say a geometry has the id myShape-mesh
. Say the geometry's mesh contains 2 polylists. Mitsuba would create scene objects with names myShape-mesh_0
and myShape-mesh_1
.
This works fine for Mitsuba, internally. We could adopt the same behavior for ColaldaToPBRT/ConvertGeometry().
Users would need to know this naming convention so that they could refer to individual polylists in their mappings files. The convention might look like magic:
myShape
.myShape
and myShape-mesh
. The "-mesh" would appear by magic during the Collada export process.myShape-mesh_0
. The "_0" would appear by magic in the Collada to Mitsuba or Collada to PBRT conversion process.As a convenience, RenderToolbox3 could automatically convert unnumbered geometry ids like myShape-mesh
into myShape-mesh_0
. This is the current behavior to accommodate Mitsuba in ApplyMitsubaObjects().
Users would still be free to use precise ids, like myShape-mesh_0
and myShape-mesh_5
, if they knew what they wanted.
The issue of referring to numbered polylists only matters if users need to access a particular polylist in the mappings file.
Each polylist can have its own material as specified in Blender, without users having to worry.
Users can bless a whole geometry as an area light, in the mappings file, without having to refer to numbered polylists.
So this is only an "issue" if users need to e.g. bless an individual polylist as an area light. Even then, that would be separate from this issue about converting multiple polylists for PBRT.
78a9780f24fce24e67a1569131c462a5c81e6dea converts multiple polylists from each geometry mesh. Each polylist may have its own material. Each polylist gets a numeric suffix.
ConvertGeometry() in Collada To PBRT only converts a single polylist for each mesh. But meshes might contain multiple polylists.
For example, in the [[SpectralIllusion]] example scene, the 25 facets on each cube face come as 25 separate polylists in the Collada file. This allows each facet to have its own color, even though there is only one big cube mesh object.
The Mitsuba converter already converts multiple polylists for each mesh.