0
$\begingroup$

Is there any way to define a constructor-like mechanism for a class derived from bpy.types.PropertyGroup?

I have two instances of the same property group class, and each one has different defaults.

Edit: I forgot to mention that my previous strategy was to call a custom function after the preference class is registered, but the problem being that user-data is loaded immediately when the class is registered, so any values I set in the "constructor" overrides the saved user settings. One way to get around it would be to set "abnormal" defaults for at least one property so you can detect the class instance being unset by the user, but that would definitely feel like a hack.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.