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

Error in the code for Preference Panel #91

Closed
orencloud opened this issue Feb 3, 2024 · 3 comments
Closed

Error in the code for Preference Panel #91

orencloud opened this issue Feb 3, 2024 · 3 comments

Comments

@orencloud
Copy link

class DemoPreferences(bpy.types.AddonPreferences):
bl_idname = package
auto_check_update = bpy.props.BoolProperty(

gave me this error in the blender terminal (same for "updater_interval_months" and all the other ones):
rna_uiItemR: property not found: DemoPreferences.auto_check_update

this fixed it:
auto_check_update : bpy.props.BoolProperty(name="

@TheDuckCow
Copy link
Collaborator

What version of blender are you using?

Trying myself freshly now, I am not seeing any printouts with this repo as-is. Maybe while implementing in your own project, you didn't include the addon_updater_ops.make_annotations(cls) # Avoid blender 2.8 warnings. line in registration? If you skip this then yes, you would indeed get these problems. Be sure to also fully restart blender when testing of course.

We can't directly use syntax like auto_check_update : bpy.props.BoolProperty(name=" as yields syntax errors in e.g. Python 3.5 (used in blender 2.79). At a certain point it will be fair enough to officially end support for Blender 2.7x, but since nothing is actually broken at this time in 4.0 I don't see a good reason to do so. The make_annotations function works around this to after the fact add the annotation attribute to properties so blender 2.8x can function as intended.

@orencloud
Copy link
Author

Sorry, I'm a bit unexperienced with coding. I'm using 4.0.2. My addon will be supported from 3.6 and forward, so I'm not too concerned about retro compatiblity.

I tried adding the "make annotations" but the terminal still told me that the "auto_check_update" properties couldn't be found.

The only way to solve it was to switch "=" with ":".
I noticed it because all my other custom properties used that format.

Also, thanks a lot for your amazing addon.

@TheDuckCow
Copy link
Collaborator

TheDuckCow commented Feb 4, 2024 via email

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

No branches or pull requests

2 participants