Skip to content

Conversation

@Exairnous
Copy link
Member

@Exairnous Exairnous commented Nov 18, 2025

What?

Prevents Python errors when copying components from one object to another, and when removing components in Blender 5.0.

Why?

To allow components to be copied or removed successfully in Blender 5.0, the same as in previous versions.

Examples

N/A (this prevents Python errors, so the only thing changed should be that no errors pop up in Blender 5.0 when copying or deleting components).

How to test

  1. Add a Hubs component to the default cube in Blender (you'll find the button to add components in the Hubs panel in the object's properties - which is represented by the orange square icon button in the sidebar of the properties editor).
  2. Shift select the default light.
  3. Shift select the cube again to make it active again without deselecting the light.
  4. Press the copy button on the component (it's the button with the clipboard icon that's right next to the remove button in the top right-hand corner of the component).
  5. Select the light and see that the component has been added to the light and no errors have been triggered.
  6. Press the remove button on the component (it's the button with the X in the top right-had corner of the component).
  7. See that the component has been removed and no errors have been triggered.

Documentation of functionality

No changes to functionality/behaviour.

Limitations

Only tested in Linux, but otherwise there are no known limitations.

Alternatives considered

None.

Open questions

Does this work in Windows/Mac?

Additional details or related context

See the commit message for technical details.

Thanks to @hrithikwins for finding the issues this PR addresses!

References:

What: Components are now accessed via `getattr` instead of via dictionary key when copying components from one object to another and property_unset is used to remove components instead of deleting them directly.

Why: Blender 5.0 no longer allows access to `bpy.props` properties (which is what the components technically are) via dictionary key or directly deleting them.

Notes:
It's unclear which cases of dictionary key access are affected by the changes in Blender 5.0, e.g. properties within a `PropertyGroup` seem to act the same as previously (accessible via dictionary key after they have been set at least once).

The replacements for dictionary key access and deleting properties work in previous versions of Blender, so support for previous versions remains the same.

References:
* https://developer.blender.org/docs/release_notes/5.0/python_api/#removal-of-unsupported-access-to-runtime-defined-properties-storage-data
* https://projects.blender.org/blender/blender/commit/469f54f484
* https://projects.blender.org/blender/blender/issues/141042
@Exairnous
Copy link
Member Author

Exairnous commented Nov 18, 2025

@DougReeder
Copy link
Member

I think we should also add 5.0 to the CI test versions.

@Exairnous
Copy link
Member Author

Exairnous commented Nov 18, 2025

@hrithikwins @GottfriedHofmann @Spiderguy-F Can you review this, and test it on your systems, please? There is a download link for the zip in my comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants