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
Contributor

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.

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.
howetuft added 1 commit 2024-01-12 22:46:16 +01:00
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.
howetuft requested review from Brecht Van Lommel 2024-01-13 14:39:37 +01:00
howetuft requested review from Thomas Dinges 2024-01-13 14:39:37 +01:00
Thomas Dinges approved these changes 2024-01-13 15:07:03 +01:00

Thanks for the patch. From a quick look this looks okay. Let's wait for Brecht for final approval though.

Thanks for the patch. From a quick look this looks okay. Let's wait for Brecht for final approval though.
Brecht Van Lommel approved these changes 2024-01-15 20:00:19 +01:00

Thanks.

I'm unsure how long we will keep the XML file format alive, at some point I would like to remove it in favor of USD. But as long as that is not a complete replacement we can keep doing improvements like this.

Thanks. I'm unsure how long we will keep the XML file format alive, at some point I would like to remove it in favor of USD. But as long as that is not a complete replacement we can keep doing improvements like this.
Brecht Van Lommel changed title from Cycles Standalone - Expose Object node in XML API to Expose object node in XML API 2024-01-15 20:01:55 +01:00
Brecht Van Lommel merged commit d17993feae into main 2024-01-15 20:04:23 +01:00
Brecht Van Lommel deleted branch caustics 2024-01-15 20:04:24 +01:00
Author
Contributor

Thank you!
I'm attached to the XML API beyond reason, but I must be one of the only ones ;-)
USD (or glTF?) is likely to be the future, however: it would be a sensible move.

Thank you! I'm attached to the XML API beyond reason, but I must be one of the only ones ;-) USD (or glTF?) is likely to be the future, however: it would be a sensible move.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/cycles#8
No description provided.