本文整理汇总了Python中bpy.utils方法的典型用法代码示例。如果您正苦于以下问题:Python bpy.utils方法的具体用法?Python bpy.utils怎么用?Python bpy.utils使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bpy
的用法示例。
在下文中一共展示了bpy.utils方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: draw_preset
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def draw_preset(self, context):
"""
Define these on the subclass:
- preset_operator (string)
- preset_subdir (string)
Optionally:
- preset_extensions (set of strings)
- preset_operator_defaults (dict of keyword args)
"""
import bpy
ext_valid = getattr(self, "preset_extensions", {".py", ".xml"})
props_default = getattr(self, "preset_operator_defaults", None)
self.path_menu(bpy.utils.preset_paths(self.preset_subdir),
self.preset_operator,
props_default=props_default,
filter_ext=lambda ext: ext.lower() in ext_valid)
示例2: register
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def register():
"""Register Classes and Create Scene Variables.
Operates on the classes list defined above.
"""
from bpy.utils import register_class
for cls in classes:
register_class(cls)
# OpenGL flag
#
window_manager = WindowManager
# Register Internal OpenGL Property
#
window_manager.pdt_run_opengl = BoolProperty(default=False)
Scene.pdt_pg = PointerProperty(type=PDTSceneProperties)
示例3: unregister
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def unregister():
"""Unregister Classes and Delete Scene Variables.
Operates on the classes list defined above.
"""
from bpy.utils import unregister_class
# remove OpenGL data
pdt_pivot_point.PDT_OT_ModalDrawOperator.handle_remove(
pdt_pivot_point.PDT_OT_ModalDrawOperator, bpy.context
)
window_manager = bpy.context.window_manager
pdt_wm = "pdt_run_opengl"
if pdt_wm in window_manager:
del window_manager[pdt_wm]
for cls in reversed(classes):
unregister_class(cls)
del Scene.pdt_pg
示例4: reload_supporters
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def reload_supporters():
# Read the support file
readJson()
# Get existing preview collection or create new one
if preview_collections.get('supporter_icons'):
pcoll = preview_collections['supporter_icons']
else:
pcoll = bpy.utils.previews.new()
# load the supporters and news icons
load_icons(pcoll)
if not preview_collections.get('supporter_icons'):
preview_collections['supporter_icons'] = pcoll
unregister_dynamic_buttons()
register_dynamic_buttons()
# Finish reloading
finish_reloading()
print('Updated supporter list.')
示例5: load_other_icons
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def load_other_icons():
# Note that preview collections returned by bpy.utils.previews
# are regular py objects - you can use them to store custom data.
pcoll = bpy.utils.previews.new()
# path to the folder where the icon is
# the path is calculated relative to this py file inside the addon folder
icons_dir = os.path.join(resources_dir, "icons")
icons_other_dir = os.path.join(icons_dir, "other")
# load a preview thumbnail of a file and store in the previews collection
pcoll.load('heart1', os.path.join(icons_other_dir, 'heart1.png'), 'IMAGE')
pcoll.load('discord1', os.path.join(icons_other_dir, 'discord1.png'), 'IMAGE')
pcoll.load('cats1', os.path.join(icons_other_dir, 'cats1.png'), 'IMAGE')
pcoll.load('empty', os.path.join(icons_other_dir, 'empty.png'), 'IMAGE')
pcoll.load('UP_ARROW', os.path.join(icons_other_dir, 'blender_up_arrow.png'), 'IMAGE')
# pcoll.load('TRANSLATE', os.path.join(icons_other_dir, 'translate.png'), 'IMAGE')
preview_collections['custom_icons'] = pcoll
示例6: unregister
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def unregister():
bpy.types.DATA_PT_vertex_groups.remove(vgroupExtra)
try:
del bpy.types.WindowManager.armatoolbox
except:
pass
bpy.types.TOPBAR_MT_file_export.remove(ArmaToolboxExportMenuFunc)
bpy.types.TOPBAR_MT_file_import.remove(ArmaToolboxImportMenuFunc)
bpy.types.TOPBAR_MT_file_import.remove(ArmaToolboxImportASCMenuFunc)
bpy.types.TOPBAR_MT_file_export.remove(ArmaToolboxExportASCMenuFunc)
#bpy.utils.unregister_class(ArmaToolboxAddNewProxy)
#bpy.types.TOPBAR_MT_file_import.remove(ArmaToolboxAddProxyMenuFunc)
bpy.types.TOPBAR_MT_file_export.remove(ArmaToolboxExportRTMMenuFunc)
from bpy.utils import unregister_class
from . import properties,panels,lists,operators
lists.unregister()
panels.unregister()
operators.unregister()
properties.unregister()
for cls in reversed(classes):
unregister_class(cls)
示例7: unregister
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def unregister():
from bpy.utils import unregister_class
for cls in reversed(classes):
unregister_class(cls)
del bpy.types.Scene.uefy_character_objects
del bpy.types.Scene.uefy_org_bone_objects
del bpy.types.Scene.uefy_epic_bone_objects
del bpy.types.Scene.uefy_character_name
del bpy.types.Scene.uefy_uemann_name
del bpy.types.Scene.uefy_metarig_name
del bpy.types.Scene.uefy_character_type
del bpy.types.Scene.uefy_axis_type
del bpy.types.Scene.uefy_fix_metarig
del bpy.types.Scene.uefy_remove_face
del bpy.types.Scene.uefy_remove_extras_chest
del bpy.types.Scene.uefy_remove_extras_pelvis
del bpy.types.Scene.uefy_add_face
del bpy.types.Scene.uefy_add_extras_chest
del bpy.types.Scene.uefy_add_extras_pelvis
del bpy.types.Scene.uefy_add_twist
del bpy.types.Scene.uefy_add_second_twist
del bpy.types.Scene.uefy_move_thigh_twist
示例8: register
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def register():
from bpy.utils import register_class
for cls in classes:
register_class(cls)
bpy.types.Object.exportActionList = CollectionProperty(type=BFU_OT_ObjExportAction)
bpy.types.Scene.UnrealExportedAssetsList = CollectionProperty(type=BFU_OT_UnrealExportedAsset)
bpy.types.Scene.potentialErrorList = CollectionProperty(type=BFU_OT_UnrealPotentialError)
示例9: unregister
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def unregister():
from bpy.utils import unregister_class
for cls in reversed(classes):
unregister_class(cls)
示例10: register
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def register():
from bpy.utils import register_class
for cls in classes:
register_class(cls)
bpy.utils.register_class(BFU_OT_ObjExportAction)
bpy.types.Object.exportActionList = CollectionProperty(type=BFU_OT_ObjExportAction)
bpy.utils.register_class(BFU_OT_SceneCollectionExport)
bpy.types.Scene.CollectionExportList = CollectionProperty(type=BFU_OT_SceneCollectionExport)
bpy.utils.register_class(BFU_OT_UnrealExportedAsset)
bpy.types.Scene.UnrealExportedAssetsList = CollectionProperty(type=BFU_OT_UnrealExportedAsset)
bpy.utils.register_class(BFU_OT_UnrealPotentialError)
bpy.types.Scene.potentialErrorList = CollectionProperty(type=BFU_OT_UnrealPotentialError)
bpy.types.VIEW3D_MT_uv_map.append(menu_func)
示例11: unregister
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def unregister():
from bpy.utils import unregister_class
for cls in reversed(classes):
unregister_class(cls)
bpy.utils.unregister_class(BFU_OT_ObjExportAction)
bpy.utils.unregister_class(BFU_OT_SceneCollectionExport)
bpy.utils.unregister_class(BFU_OT_UnrealExportedAsset)
bpy.utils.unregister_class(BFU_OT_UnrealPotentialError)
bpy.types.VIEW3D_MT_uv_map.remove(menu_func)
#register, unregister = bpy.utils.register_classes_factory(classes)
示例12: register
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def register():
from bpy.utils import register_class
register_class(RenderBurst)
register_class(RbFilterSettings)
register_class(RenderBurstCamerasPanel)
register_class(OBJECT_OT_RBButton)
bpy.types.WindowManager.rb_filter = bpy.props.PointerProperty(type=RbFilterSettings)
bpy.types.TOPBAR_MT_render.append(menu_func)
示例13: unregister
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def unregister():
from bpy.utils import unregister_class
unregister_class(RenderBurst)
bpy.types.TOPBAR_MT_render.remove(menu_func)
unregister_class(RbFilterSettings)
unregister_class(RenderBurstCamerasPanel)
unregister_class(OBJECT_OT_RBButton)
示例14: unregister
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def unregister():
### OPERATORS ###
from bpy.utils import unregister_class
for cls in reversed(classes) :
unregister_class(cls)
### PROPS ###
# GLOBAL PROPS
del bpy.types.WindowManager.fontselector_list
del bpy.types.WindowManager.fontselector_sub
del bpy.types.WindowManager.fontselector_subdirectories
del bpy.types.WindowManager.fontselector_isrefreshing
del bpy.types.WindowManager.fontselector_search
del bpy.types.WindowManager.fontselector_os
del bpy.types.WindowManager.fontselector_defaultfolders
# TEXT OBJECT PROPS
del bpy.types.TextCurve.fontselector_index
del bpy.types.TextCurve.fontselector_font
del bpy.types.TextCurve.fontselector_font_missing
del bpy.types.TextCurve.fontselector_desync_font
del bpy.types.TextCurve.fontselector_avoid_changes
# TEXT STRIPS PROPS
del bpy.types.TextSequence.fontselector_index
del bpy.types.TextSequence.fontselector_font
del bpy.types.TextSequence.fontselector_font_missing
del bpy.types.TextSequence.fontselector_desync_font
del bpy.types.TextSequence.fontselector_avoid_changes
### HANDLER
bpy.app.handlers.load_post.remove(fontselector_startup)
### MENU ###
bpy.types.TOPBAR_MT_file_export.remove(menu_export_favorites)
bpy.types.VIEW3D_MT_editor_menus.remove(popover_view3d_function)
示例15: register
# 需要导入模块: import bpy [as 别名]
# 或者: from bpy import utils [as 别名]
def register():
from bpy.utils import register_class
for cls in classes:
register_class(cls)
bpy.types.Scene.godot_game_tools = PointerProperty(type=GGT_AddonProperties_GGT, name="Godot Game Tools")
bpy.types.Action.ggt_props = PointerProperty(type=GGT_ActionProperties_GGT, name="GGT Action")
bpy.types.Scene.action_list_index = bpy.props.IntProperty(update=update_action_list)