本文整理汇总了Python中bpy.props.CollectionProperty方法的典型用法代码示例。如果您正苦于以下问题:Python props.CollectionProperty方法的具体用法?Python props.CollectionProperty怎么用?Python props.CollectionProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bpy.props
的用法示例。
在下文中一共展示了props.CollectionProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: register
# 需要导入模块: from bpy import props [as 别名]
# 或者: from bpy.props import CollectionProperty [as 别名]
def register():
for cls in classes:
try:
bpy.utils.register_class(cls)
except ValueError as e:
log.warning('{} is already registered, now unregister and retry... '.format(cls))
bpy.utils.unregister_class(cls)
bpy.utils.register_class(cls)
#Create uilist collections
bpy.types.Scene.uiListCollec = CollectionProperty(type=RECLASS_PG_color)
bpy.types.Scene.uiListIndex = IntProperty() #used to store the index of the selected item in the uilist
bpy.types.Scene.colorRampPreview = CollectionProperty(type=RECLASS_PG_color_preview)
#Add handlers
bpy.app.handlers.depsgraph_update_post.append(scene_update)
#
bpy.types.Scene.analysisMode = EnumProperty(
name = "Mode",
description = "Choose the type of analysis this material do",
items = [('HEIGHT', 'Height', "Height analysis"),
('SLOPE', 'Slope', "Slope analysis"),
('ASPECT', 'Aspect', "Aspect analysis")],
update = updateAnalysisMode
)
示例2: register
# 需要导入模块: from bpy import props [as 别名]
# 或者: from bpy.props import CollectionProperty [as 别名]
def register():
bpy.utils.register_class(archipack_wall)
Mesh.archipack_wall = CollectionProperty(type=archipack_wall)
bpy.utils.register_class(ARCHIPACK_PT_wall)
bpy.utils.register_class(ARCHIPACK_OT_wall)