Python bpy.props.CollectionProperty() Examples

The following are 2 code examples of bpy.props.CollectionProperty(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module bpy.props , or try the search function .
Example #1
Source File: nodes_terrain_analysis_reclassify.py    From BlenderGIS with GNU General Public License v3.0 6 votes vote down vote up
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
		) 
Example #2
Source File: archipack_wall.py    From archipack with GNU General Public License v3.0 5 votes vote down vote up
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)