Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bounds and Animation Property Deduplication #415

Merged
merged 3 commits into from
Jul 6, 2024

Conversation

Hoikas
Copy link
Member

@Hoikas Hoikas commented Jun 28, 2024

This is a set of changes to de-duplicate code and storage of bounds and animation related properties. All bounds properties are now proxies to the collision modifier's bounds property with an automated upgrade path. All of the manual getters and setters in code that was already doing this have been removed and replaced with a helper to register bounds properties. Animation properties, especially material/texture animations, have been greatly simplified by removing verbose boilerplate around property registration.

Every time we need to make a place to store a region's bounds, we have
to write quite a bit of boilerplate code to stash the bounds type into
the collision modifier. This removes the need to do that by making a
helper function that generates those helper functions for us. Generally,
we would use `functools.partial` to do this, but Blender requires
function objects for the `EnumProperty`'s getter and setter. Partial
objects raise a `TypeError`.
This migrates duplicated bounds properties (i.e. those *NOT* found on
the collision modifier) to be stored on the collision modifier. This can
potentially be a lossy process if there are multiple conflicting bounds
property values for a single object. This may result in some Ages having
"new" bugs appear, but, really, they were only working by sheer dumb
luck before. It's better this way.
@Hoikas Hoikas merged commit 9dc7f68 into H-uru:master Jul 6, 2024
3 checks passed
@Hoikas Hoikas deleted the bounds_storage_overhaul branch July 6, 2024 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant