Blender Git Loki

Git Commits -> Revision d59f53f

Revision d59f53f by Lukas Toenne (master)
February 24, 2014, 10:35 (GMT)
Support for generic OSL shader parameters in the Cycles standalone XML
reader.

To make a generic OSL shader connectable to other nodes, the parameters
must be declared via "input" and "output" child elements:

<osl_shader name="tex" src="./osl/stripes.osl">
<input name="Stripes" type="int" />
<output name="ColorOut" type="color" />
</osl_shader>

`name` must be the same as the OSL shader parameter name.
`type` must be one of float, int, color, vector, point, normal, closure,
string (matching cycles socket types)

Beyond this the OSL script nodes then work just like all other nodes.

OSL parameter sockets can be connected to other cycles nodes:

<connect from="checker color" to="tex Stripes" />
<connect from="tex ColorOut" to="floor_closure color" />

They can set default values for the input sockets by attributes of the
main node element:

<osl_shader name="tex" src="./osl/stripes.osl" Stripes="3" >
<input name="Stripes" type="int" />
<output name="ColorOut" type="color" />
</osl_shader>

This system of specifying custom attributes should probably be changed,
since it can easily create name conflicts and arbitrarily long elements.
But that is a different issue to be solved for all nodes in general.

Commit Details:

Full Hash: d59f53f7b7dac5eff66fcf182f2cdc7dfabd6f87
Parent Commit: 7078fb9
Lines Changed: +60, -16

1 Modified Path:

/intern/cycles/app/cycles_xml.cpp (+60, -16) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021