Dev:Source/Data System/Property Standards/Yafray

提供: wiki
移動先: 案内検索

YafRay does not really need much of a hierarchy (assumed that cusstom material nodes can be done with PyNodes or similar). There is basically just a (variable) set of properties for scene elements and the scene(s) itself that require custom properties. Most of these sets attach directly to IDs of blender scene elements, scenes, cameras, materials, (mesh-)objects etc.

Hence, the first suggestion is to put everything in an enclosing ID property group named "YafRay" (upper and lower case still debatable...). In the most general case, every property inside directly corresponds to identical named YafRay "parameters".

Short overview:

  • YafRay materials bind to blender materials
  • YafRay backgrounds bind to blender worlds
  • YafRay render settings bind to blender scenes
  • YafRay camera settings bind to blender cameras
  • YafRay mesh light definitions bind to blender objects

Notes:
1:1 material binding is not everyone's wish, but recreating the layer system is quite a bit of extra work, and realizing material nodes that way is probably a lot more extra work.

Mesh lights bind to objects of type mesh, not directly to meshes because a mesh can belong to several objects.

Problems to be solved

Generic Parameter Sets

It would simplify export and allow the user to manually define just about anything a new yafray plugin could need with a generic ID Property Browser if ID properties would feature a way to define all types YafRay's internal "parameter_t" type knows. The "parameter_t" class distinguishes 6 types:
integer, float, boolean, string, RGB(A)-color, XYZ coordinate.
Since YafRay can be extended by plugins, there is in general no way for the export code to predict the type, so it has to be stored in some way.

ID Properties currently feature integer, float, string, vector and array (int or float) data types. The vector and matrix types seem to be just specialized float arrays.
This means there is missing a way to identify boolean values. Colors and 3d coordinates could be distinguished by the array length/vector size (3 := XYZ, 4 := RGBA) or one could be vector, the other array.

I could allow YafRay to convert integer (or even strings like the old design does) to boolean values, but in terms of planned UI presentation it still would be desirable to make the type clear, also on scenes exported to XML files.

Accessing Lamp ID Properties

Until a more generic render API is available, there doesn't seem to be an easy way to get ID Properties of lamps, because the export code only gets the LampRen type.

Other details

--Lynx3d 14:35, 13 March 2007 (CET)