Expose object node in XML API #8

Merged
Brecht Van Lommel merged 1 commits from howetuft/cycles:caustics into main 2024-01-15 20:04:23 +01:00

1 Commits

Author SHA1 Message Date
356d49faf4
Cycles Standalone - Expose Object node in XML API
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.
2024-01-12 21:44:52 +01:00