I'm a Render Engine developer, how can I support Skatter?
Scattered instances are stored in an hash/array structure which can be read by render engines (or anyone for that matter). This is very similar to parsing the model and reading the transformation of regular Component Instances. This allows users to render hundreds of thousands of instances without overloading Sketchup.
The hash is in a shared namespace called Common
, and its name is render_instances
.
It is structured like so:
Sketchup.active_model.definitions.entityID is used to differentiate models on OSX, as we can have multiple models opened in one Sketchup instance
plugin_name is the plugin's name, in this case "skatter". This level is necessary so we don't overwrite each other's data
comp_def is the Sketchup::ComponentDefinition of the scattered object. Each item of this array is an individual instance generated by Skatter.
:transformation is a Geom::Transformation that represents the instance's transform
:material is a Sketchup::Material assigned to the instance. If this is not defined or nil, simply consider this instance as having the default material applied to it, just like a regular Component Instance.
Reading this in Ruby is pretty simple:
Additionally, you can add an observer to the Common module, and Skatter will call it every time it updates. It is useful if you are doing Real Time rendering.
If you have any question or need a NFR license to test your implementation with Skatter, contact us at skatter@lindale.io.
This is an open protocol, so if other plugins use it, you will automatically support them as well.
Last updated