I've coded this enum property using this code:
class RuleCondition(PropertyGroup):
data_type: EnumProperty(
name="Condition Object Type",
description="The type of data",
items=[
(
RuleIDStrings.OBJECT,
'Object',
"The condition should be based on an object being present or not"
),
(
RuleIDStrings.MATERIAL,
'Material',
"The condition should be based on an object being present or not"
)
],
)
...
And it shows up like this in the interface:
Is there a way that I can make it non-animatable so that the little circle next to it allowing for keyframes doesn't show up? I've tried setting the is_animatable flag to False:
data_type: EnumProperty(
name="Condition Object Type",
description="The type of data",
items=[
(
RuleIDStrings.OBJECT,
'Object',
"The condition should be based on an object being present or not"
),
(
RuleIDStrings.MATERIAL,
'Material',
"The condition should be based on an object being present or not"
)
],
is_animatable=False
)
But the EnumProperty can't register when I do that. It also doesn't allow me to use a colon instead of an equals sign (it says "positional argument follows keyword argument"). Any thoughts on how to make it so that this property isn't animatable?
UPDATE: When I pass an empty options parameter as shown below, I get the following error.
class RuleCondition(PropertyGroup):
data_type: EnumProperty(
name="Condition Object Type",
description="The type of data",
items=[
(
RuleIDStrings.OBJECT,
'Object',
"The condition should be based on an object being present or not"
),
(
RuleIDStrings.MATERIAL,
'Material',
"The condition should be based on an object being present or not"
)
],
options={}
)
...
Error:
Traceback (most recent call last):
File "/home/anson/.vscode/extensions/jacqueslucke.blender-development-0.0.17/pythonFiles/include/blender_vscode/operators/addon_update.py", line 27, in execute
bpy.ops.preferences.addon_enable(module=self.module_name)
File "/home/anson/Downloads/Software/blender-3.1.0-linux-x64/3.1/scripts/modules/bpy/ops.py", line 132, in __call__
ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
File "/home/anson/Downloads/Software/blender-3.1.0-linux-x64/3.1/scripts/modules/addon_utils.py", line 387, in enable
mod.register()
File "/home/anson/.config/blender/3.1/scripts/addons/Brightaxe/__init__.py", line 112, in register
_call_globals("register")
File "/home/anson/.config/blender/3.1/scripts/addons/Brightaxe/__init__.py", line 108, in _call_globals
getattr(m, attr_name)()
File "/home/anson/.config/blender/3.1/scripts/addons/Brightaxe/properties/rules_properties.py", line 191, in register
bpy.utils.register_class(class_to_register)
ValueError: bpy_struct "RuleCondition" registration error: 'data_type' EnumProperty could not register (see previous error)
Sending: {'type': 'enableFailure'}