# Python-defined property does not start with default value

I am defining an extra property for all objects like this:

bpy.types.Object.alpha = bpy.props.FloatProperty(
default=100.0,
min=0.0,
max=100.0
)


However, when adding new objects, they start with their alpha at 0.0:

Making matters even more confusing, right-clicking the property and selecting 'reset to default' correctly sets the value to 100.0:

How can I ensure that new objects correctly start with this default value?

• If you have a getter / setter set up on property with issue post code in question. As it stands now the question / answer do not correlate. The default value of simple property defined via code above will be correct. Related blender.stackexchange.com/questions/126458/… ... as shown can use return self.get("alpha", DEFAULT) Jun 12 at 5:09

Turns out it was a problem with the getter I defined:

def get_alpha(self):
return self["alpha"] * 100.0


should be

def get_alpha(self):
if "alpha" not in self:
return 100.0
return self["alpha"] * 100.0

• could be, not should be Jun 12 at 5:09