<p>你在任务中使用了错误的类型。EnumProperty是必须存在于已定义的可接受值列表中的单个值,传递给构造函数的项列表是该属性可接受的值的列表,不在初始列表中的值不能分配给该属性。在</p>
<p>我希望您能看看给<a href="https://www.blender.org/api/blender_python_api_current/bpy.props.html#collection-example" rel="nofollow">CollectionProperty</a>提供的示例,以得到类似于-</p>
<pre><code>class RotationSyncValuesType(bpy.types.PropertyGroup):
x = bpy.props.FloatProperty(name='x', default=0.0)
y = bpy.props.FloatProperty(name='y', default=0.0)
z = bpy.props.FloatProperty(name='z', default=0.0)
bpy.utils.register_class(RotationSyncValuesType)
bpy.types.Scene.RotationSyncValuesList = \
bpy.props.CollectionProperty(type=RotationSyncValuesType)
fvalue = bpy.context.scene.RotationSyncValuesList.add()
fvalue.x = 1.0
fvalue.y = 1.0
fvalue.z = 1.0
fvalue = bpy.context.scene.RotationSyncValuesList.add()
fvalue.x = 2.0
fvalue.y = 2.0
fvalue.z = 2.0
</code></pre>
<p>那么在你的小组里你可以用-</p>
^{pr2}$
<p>由于您似乎想要三个具有相同值的属性,您应该考虑使用<a href="https://www.blender.org/api/blender_python_api_current/bpy.props.html#get-set-example" rel="nofollow">custom get/set functions</a>,这可以确保所有三个属性保持同步(或者只存储一个值),您可以将get/set添加到PropertyGroup类中的属性。在</p>