LuxCoreRender / LuxCoreRender/BlendLuxCore
Refactor the export system to have one global properties object
@Theverat is already working on this.
Since Apr 29, 2018.
- Dominant language
- Python
- Stars
- 877
- Forks
- 108
- PR merge metrics
- No merged PRs in 30d
Description
This would allow us to have one global node cache that we don't have to clear before each fragment properties export.
The Problem:
Currently our convert functions look like this:
def convert(...):
props = pyluxcore.Properties()
This means that we have many "disconnected" Properties objects, each containing e.g. the definitions for one material and its textures, or for one volume, or for one object and all its materials and textures.
The Exporter class joins all of these fragments together (pseudocode):
for obj in objects:
scene_props.Set(obj_props) # contains material, textures, volume definitions of this object
scene_props.Set(camera_props) # can contain a volume definition
The problem is that sometimes, a fragment needs to be parsed by the scene, e.g. when particles should be duplicated with a luxcore scene method.
Before the node cache this was not a problem because every fragment contained all necessary sub-definitions it was depending on (e.g. interior/exterior volumes of a material).
With the cache, it might only contain the name - so the fragment can no longer be parsed independently.
A solution could be one global properties object (no more fragments).
The cache would only have to be cleared if the global properties are cleared.
However, we have to test if this is possible and if it raises performance issues when the same definitions are parsed multiple times into the scene.
Maybe all calls to pyluxcore.Properties should be encapsulated in a custom class with the cache alongside the properties, so they can never "desync".
Or we find a way to query the defined names from the properties class (GetAllSubNames() etc.), however this is probably not possible for materials/textures because they sometimes plug helper textures in front of themselves on export.
The benefit of this refactor:
Much faster export times when nodes with speed impact are exported, e.g. smoke, but in the future possibly also imagemaps via blobs: #137 .
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.