本文整理匯總了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)