This encapsulates members of publicly accessible classes behind sets of
getters and setters. To determine what is public or not, the Blender
scene exporter was used as a reference.
The getters and setters are defined via macros, located in util_api.h.
Either the property is supposed to be read only (e.g. Scene::geometry),
and only a getter is defined (through the GET macro), or the property
can also be written to publicly, and a setter is defined as well (though
the GET_SET macro).
Now that method calls are used to access data, the code can be a bit
lengthy, or its redundancy might have become noticeable, so some
cleanups could be done. I did deduplicate some logic (mostly for
RenderTileNeighbors), some more could be done, but this patch is big
enough already, and I don't want to risk creating issues or bugs.
The following classes/structures were not encapsulated although they are
accessible from the Blender exporter, as they are either simple
parametric structures (e.g. DeviceDrawParams) or will be made into nodes
(e.g. Image).
- DeviceDrawParams
- Image
- Particle
- ParticleCurveData
- SceneParams
- DenoiseImageLayer
Particle could perhaps also be encapsulated, and maybe also made into a
Node, but that would require a revision of the ParticleSystem Node API
so it would be nicer to work with.
The properties of the following structures were encapsulated.
- Attribute
- AttributeRequest
- AttributeRequestSet
- AttributeSet
- BufferParams
- Camera
- Denoiser
- DisplayBuffer
- Geometry
- Hair
- Hair::Curve
- ImageMerger
- Mesh
- Node
- NodeType
- OSLNode
- ParticlesSystem
- PointDensityTextureNode
- Pass
- RenderBuffer
- RenderTile
- RenderTileNeighbors
- Scene
- Session
- SessionParams
- Shader
- ShaderGraph
- ShaderInput
- ShaderNode
- ShaderOutput
- SkyTextureNode
- SocketType
- Stats
- TileManager