Those seem to me operations which could be left to the rendering software thought (or the component designed to read the scene). An appropriate use of attributes to the elements of your scene file could be enough for most of these use cases. For example, one or more 'target' elements may collect all the geometry into different sets:raider wrote:Okay, I see your point. And I believe many others would share you opinion with you if we ask.
But I can think of some scenarios where I see conditionals useful.How is that? Still looks useless?
- Depending on command line options you can select different versions of the objects to be rendered (high-res/low-res).
- You could organize objects into groups (layers) and render them separately using additional command line options.
- Object could be assigned to multiple groups, so in addition to ordinary layers you could organize groups “production” and “previz”, where in “production” you include all high-res objects (or references to them) and in “previz” you include the key objects only excluding extra details, like, for instance, particles. Doing so you could invoke renderer supplying additional command line options to render “for production” and “for preview” from the same file. That seams to me more convenient in contrast to generating (and keeping them in sync) separate files for each layer, for previz/production and so forth.
- Loops are less obvious, but… For example, you could iterate over some objects (e.g. particles), and load some other geometry instead of particles (e.g. plant geometry selected randomly from a list of files, making a field of grass that way). And, off course, having conditionals you would have a possibility to choose geometry from different directories depending on render target (production/draft).
Code: Select all
<scene>
<geometry name="car1_hires">
...
</geometry>
<geometry name="car1_lowres">
...
</geometry>
<target name="hires">
<reference type="geometry" name="car1_hires"/>
</target>
<target name="lowres">
<reference type="geometry" name="car2_hires"/>
</target>
</scene>