The Object node is not currently exposed in XML API (see
https://devtalk.blender.org/t/cycles-standalone-caustics/32861/2).
At now, Object nodes are only implicitly created when Mesh nodes are
read. This prevents users of the XML API from accessing features that
are dependent on this node, in particular caustics.
This commit implements the following solution:
- Add a function for reading Object XML nodes
- Provide the XML Read State with an object property, which allows to
set the current Object for state’s sub-nodes.
- When creating a Mesh, if the object of the Read State is set, use that
object rather than creating a new one. Otherwise, follow the previous
behaviour (implicit creation).
An example scene is also provided, illustrating how caustics can be
rendered using this functionality.