當前位置: 首頁>>代碼示例>>Python>>正文


Python props.IntProperty方法代碼示例

本文整理匯總了Python中bpy.props.IntProperty方法的典型用法代碼示例。如果您正苦於以下問題:Python props.IntProperty方法的具體用法?Python props.IntProperty怎麽用?Python props.IntProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在bpy.props的用法示例。


在下文中一共展示了props.IntProperty方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: register

# 需要導入模塊: from bpy import props [as 別名]
# 或者: from bpy.props import IntProperty [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
		) 
開發者ID:domlysz,項目名稱:BlenderGIS,代碼行數:25,代碼來源:nodes_terrain_analysis_reclassify.py

示例2: register

# 需要導入模塊: from bpy import props [as 別名]
# 或者: from bpy.props import IntProperty [as 別名]
def register():

    for col_name, type_name in SUPPORTED_COLLECTIONS:
        type = getattr(bpy.types, type_name)
        type.id = p.IntProperty(name="unique id", get=_create_id_getter(col_name))

        counter_name = col_name + "_id_counter"
        setattr(bpy.types.Scene, counter_name,
            p.IntProperty(name="unique id counter", default=1))

    handlers.load_post.append(load_file)
    handlers.scene_update_pre.append(load_file_shim) 
開發者ID:WowDevTools,項目名稱:Blender-WMO-import-export-scripts,代碼行數:14,代碼來源:idproperty.py


注:本文中的bpy.props.IntProperty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。