RubendeBruin / DAVE

DAVE - Design Analysis Visualization and Engineering
Mozilla Public License 2.0
29 stars 7 forks source link

Generalizing python code generation for non-managed properties #175

Closed RubendeBruin closed 3 months ago

RubendeBruin commented 3 months ago

None-managed properties can be changed by the user even if a node is managed. They need to be registered and stored when the scene is saved or copied. This is currently the job of the manager, which is undesirable.

RubendeBruin commented 3 months ago

Proposal:

Example:

BallastTanks have "fill_pct", "free_flooding", and "density" as non-managed properties. the function could return

s['tank'].density = 1.025
s['tank'].fill_pct = 50
RubendeBruin commented 3 months ago

an other unmanaged property is "color".

This needs to be wrapped in try-except because nodes that are created by super-element may not exist anymore the next time the model is loaded (as the input files for those nodes may have changed)

So the python code is not practical.

Better to return the list of properties together with their values like so:


[
("density",1.025),
("fill_pct", 50)
]

should be a list because the order may be important.