Python bpy.props.PointerProperty() Examples

The following are 22 code examples of bpy.props.PointerProperty(). 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: __init__.py    From commotion with GNU General Public License v3.0 6 votes vote down vote up
def register():
    if bl_info["blender"] > bpy.app.version:
        addon_name = bl_info["name"].upper()
        addon_ver = ".".join(str(x) for x in bl_info["version"])
        blender_ver = ".".join(str(x) for x in bl_info["blender"][:2])
        requirements_check = RuntimeError(
            f"\n!!! BLENDER {blender_ver} IS REQUIRED FOR {addon_name} {addon_ver} !!!"
            "\n!!! READ INSTALLATION GUIDE !!!"
        )
        raise requirements_check

    for cls in classes:
        bpy.utils.register_class(cls)

    bpy.types.Scene.commotion = PointerProperty(type=preferences.SceneProperties)
    bpy.types.WindowManager.commotion = PointerProperty(type=preferences.WmProperties)

    mod_update.init(
        addon_version=bl_info["version"],
        releases_url="https://api.github.com/repos/mrachinskiy/commotion/releases",
    ) 
Example #2
Source File: writinganim_2_8.py    From writinganimation with GNU General Public License v3.0 5 votes vote down vote up
def register():
    bpy.utils.register_class(CreateWritingAnimPanel)
    bpy.utils.register_class(CreateWritingAnimOp)
    bpy.utils.register_class(SeparateSplinesObjsOp)
    bpy.utils.register_class(CreateWritingAnimParams)
    bpy.types.WindowManager.createWritingAnimParams = \
        bpy.props.PointerProperty(type=CreateWritingAnimParams) 
Example #3
Source File: mesh_morpher.py    From unreal_tools with GNU General Public License v3.0 5 votes vote down vote up
def register():
    bpy.utils.register_class(UT_MeshMorpherPanel)
    bpy.utils.register_class(UT_PackMorphTargetsOperator)
    bpy.utils.register_class(UT_MeshMorpherProperties)
    bpy.types.Scene.mesh_morpher_properties = PointerProperty(type = UT_MeshMorpherProperties) 
Example #4
Source File: view_layer.py    From BlendLuxCore with GNU General Public License v3.0 5 votes vote down vote up
def register(cls):
        bpy.types.ViewLayer.luxcore = PointerProperty(
            name="LuxCore ViewLayer Settings",
            description="LuxCore ViewLayer settings",
            type=cls,
        ) 
Example #5
Source File: blender_object.py    From BlendLuxCore with GNU General Public License v3.0 5 votes vote down vote up
def register(cls):
        bpy.types.Object.luxcore = PointerProperty(
            name="LuxCore Object Settings",
            description="LuxCore object settings",
            type=cls,
        ) 
Example #6
Source File: material.py    From BlendLuxCore with GNU General Public License v3.0 5 votes vote down vote up
def register(cls):        
        bpy.types.Material.luxcore = PointerProperty(
            name="LuxCore Material Settings",
            description="LuxCore material settings",
            type=cls,
        ) 
Example #7
Source File: camera.py    From BlendLuxCore with GNU General Public License v3.0 5 votes vote down vote up
def register(cls):
        bpy.types.Camera.luxcore = PointerProperty(
            name="LuxCore Camera Settings",
            description="LuxCore camera settings",
            type=cls,
        ) 
Example #8
Source File: scene.py    From BlendLuxCore with GNU General Public License v3.0 5 votes vote down vote up
def register(cls):
        bpy.types.Scene.luxcore = PointerProperty(
            name="LuxCore Scene Settings",
            description="LuxCore scene settings",
            type=cls,
        ) 
Example #9
Source File: automask.py    From AutoMask with MIT License 5 votes vote down vote up
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)
    bpy.types.Scene.settings = PointerProperty(type=Settings)
    remove_handler()
    bpy.app.handlers.frame_change_pre.append(MaskLayerActivater) 
Example #10
Source File: view3d_point_cloud_visualizer.py    From meshroom2blender with GNU General Public License v3.0 5 votes vote down vote up
def register(cls):
        bpy.types.Object.point_cloud_visualizer = PointerProperty(type=cls) 
Example #11
Source File: tools_painclones.py    From mifthtools with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def register():
    bpy.utils.register_module(__name__)
    bpy.types.Scene.paintClonesTools = PointerProperty(
        name="Paint Clones Variables",
        type=PaintClonesProperties,
        description="Paint Clones Properties"
    ) 
Example #12
Source File: PivotPainterTool280.py    From Pivot-Painter-for-Blender with GNU General Public License v3.0 5 votes vote down vote up
def register():
	from bpy.utils import register_class
	for cls in classes:
		register_class(cls)
	bpy.types.Scene.pivot_painter = PointerProperty(type = UE4_PivotPainterProperties) 
Example #13
Source File: PivotPainterTool.py    From Pivot-Painter-for-Blender with GNU General Public License v3.0 5 votes vote down vote up
def register():																								# Register function to add the script
	bpy.utils.register_class(UE4_PivotPainterPanel)
	bpy.utils.register_class(UE4_CreateTexturesOperator)
	bpy.utils.register_class(UE4_PivotPainterProperties)
	bpy.utils.register_class(ShowHideExtraOptions)
	bpy.utils.register_class(ShowHideExperimentalOptions)
	bpy.utils.register_class(CreateSelectOrederOperator)
	bpy.utils.register_class(CreateCustomLevelOperator)
	bpy.types.Scene.pivot_painter = PointerProperty(type = UE4_PivotPainterProperties) 
Example #14
Source File: properties.py    From io_kspblender with GNU General Public License v2.0 5 votes vote down vote up
def register():
    bpy.types.Object.kspbproperties = PointerProperty(type=KSPBProperties) 
Example #15
Source File: __init__.py    From material_recommender with GNU General Public License v3.0 5 votes vote down vote up
def register():
    for aclass in classes:
        register_class(aclass)
    Scene.global_properties = PointerProperty(type=GlobalProperties)
    Scene.preferences_properties = PointerProperty(type=PreferencesProperties)
    Scene.recommendations_properties = PointerProperty(type=RecommendationsProperties)
    Scene.search_properties = PointerProperty(type=SearchProperties) 
Example #16
Source File: __init__.py    From Fluid-Designer with GNU General Public License v3.0 5 votes vote down vote up
def execute(self, context):
        bpy.types.Scene.stored_views = PointerProperty(type=properties.StoredViewsData)
        scenes = bpy.data.scenes
        for scene in scenes:
            core.DataStore.sanitize_data(scene)
        return {'FINISHED'} 
Example #17
Source File: mesh_pen_tool.py    From Fluid-Designer with GNU General Public License v3.0 5 votes vote down vote up
def register():
    for c in class_list:
        bpy.utils.register_class(c)

    bpy.types.Scene.pt_custom_props = PointerProperty(type = pt_p_group0)

    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name='3D View', space_type='VIEW_3D')
    kmi = km.keymap_items.new('pt.op0_id', 'D', 'PRESS')

# ------ unregister ------ 
Example #18
Source File: writinganim.py    From writinganimation with GNU General Public License v3.0 5 votes vote down vote up
def register():
    bpy.utils.register_class(CreateWritingAnimPanel)
    bpy.utils.register_class(CreateWritingAnimOp)
    bpy.utils.register_class(SeparateSplinesObjsOp)
    bpy.utils.register_class(CreateWritingAnimParams)
    bpy.types.WindowManager.createWritingAnimParams = \
        bpy.props.PointerProperty(type=CreateWritingAnimParams) 
Example #19
Source File: leomoon-textcounter.py    From leomoon-textcounter with GNU General Public License v3.0 5 votes vote down vote up
def register():
    for cls in classes:
        make_annotations(cls)
        bpy.utils.register_class(cls)
    bpy.types.TextCurve.text_counter_props = PointerProperty(type = TextCounter_Props)
    bpy.app.handlers.frame_change_post.append(textcounter_text_update_frame) 
Example #20
Source File: __init__.py    From jewelcraft with GNU General Public License v3.0 4 votes vote down vote up
def register():
    if not os.path.exists(var.ICONS_DIR):
        integrity_check = FileNotFoundError("!!! READ INSTALLATION GUIDE !!!")
        raise integrity_check

    for cls in classes:
        bpy.utils.register_class(cls)

    bpy.types.WindowManager.jewelcraft = PointerProperty(type=preferences.WmProperties)
    bpy.types.Scene.jewelcraft = PointerProperty(type=preferences.SceneProperties)

    # Menu
    # ---------------------------

    bpy.types.VIEW3D_MT_object.append(ui.draw_jewelcraft_menu)

    # Translations
    # ---------------------------

    for k, v in mod_update.localization.init().items():
        if k in localization.DICTIONARY.keys():
            localization.DICTIONARY[k].update(v)
        else:
            localization.DICTIONARY[k] = v

    bpy.app.translations.register(__name__, localization.DICTIONARY)

    # Previews
    # ---------------------------

    pcoll = bpy.utils.previews.new()

    for entry in os.scandir(var.ICONS_DIR):
        if entry.is_file() and entry.name.endswith(".png"):
            name = os.path.splitext(entry.name)[0]
            pcoll.load(name.upper(), entry.path, "IMAGE")
        if entry.is_dir():
            for subentry in os.scandir(entry.path):
                if subentry.is_file() and subentry.name.endswith(".png"):
                    name = entry.name + os.path.splitext(subentry.name)[0]
                    pcoll.load(name.upper(), subentry.path, "IMAGE")

    var.preview_collections["icons"] = pcoll

    # On load
    # ---------------------------

    prefs = bpy.context.preferences.addons[__package__].preferences
    preferences.upd_asset_popover_width(prefs, None)

    on_load.handler_add()

    # mod_update
    # ---------------------------

    mod_update.init(
        addon_version=bl_info["version"],
        releases_url="https://api.github.com/repos/mrachinskiy/jewelcraft/releases",
    ) 
Example #21
Source File: property.py    From BlenderRobotDesigner with GNU General Public License v2.0 4 votes vote down vote up
def register(self, btype, parent=[]):
        """
        Register the wrapped property group to blender. This needs only be called for property groups directly
        assigned to a blender type. Nested groups are automatically registered.

        .. todo::

            Register should use the standard registration mechanism of PluginManager. Right now, however,
            this would break the current registration process. This will be done once the properties for
            the robot designer have been clarified and migrated to this representation.

        @param btype: Blender type (e.g. :class:`bpy.types.Object` or :class:`bpy.types.Bone`)
        @param parent: For traversing nested groups
        @return: Reference to the generated :class:`bpy.types.PropertyGroup`-derived class (not used by the user).
        """

        if bpy.app.version == 'Mockup':
            return

        newPropertyGroup = type(self.__class__.__name__ + "_unwrapped", (bpy.types.PropertyGroup,), {})

        for attr in self.__dict__.items():
            if isinstance(attr[1], PropertyHandler):
                attr[1].property[1]['attr'] = attr[0]
                # print(attr[0], attr[1].d)
                property=attr[1].property
                setattr(newPropertyGroup, attr[0], property) # property[0](**property[1]))
                attr[1].reference = parent + [attr[0]]
            elif isinstance(attr[1], PropertyGroupHandlerBase):
                pg = attr[1].register(None, parent + [attr[0]])
                print(type(pg), pg.__bases__)
                p = PointerProperty(type=pg)
                p[1]['attr'] = attr[0]
                setattr(newPropertyGroup, attr[0], p)

        core_logger.debug("Registering generated property group: %s", newPropertyGroup.__name__)
        bpy.utils.register_class(newPropertyGroup)
        PluginManager._registered_properties.append((newPropertyGroup,btype))
        if btype:
            setattr(btype,'RobotDesigner',
                    bpy.props.PointerProperty(type=getattr(bpy.types, newPropertyGroup.__name__)))
            core_logger.debug("Assigning property to: %s", btype)
        return newPropertyGroup 
Example #22
Source File: __init__.py    From booltron with GNU General Public License v3.0 4 votes vote down vote up
def register():
    if not os.path.exists(var.ICONS_DIR):
        integrity_check = FileNotFoundError("!!! READ INSTALLATION GUIDE !!!")
        raise integrity_check

    for cls in classes:
        bpy.utils.register_class(cls)

    bpy.types.WindowManager.booltron = PointerProperty(type=preferences.WmProperties)

    # Menu
    # ---------------------------

    bpy.types.VIEW3D_MT_object.append(ui.draw_booltron_menu)

    # Translations
    # ---------------------------

    for k, v in mod_update.localization.init().items():
        if k in localization.DICTIONARY.keys():
            localization.DICTIONARY[k].update(v)
        else:
            localization.DICTIONARY[k] = v

    bpy.app.translations.register(__name__, localization.DICTIONARY)

    # Previews
    # ---------------------------

    pcoll = bpy.utils.previews.new()

    for entry in os.scandir(var.ICONS_DIR):
        if entry.is_dir():
            for subentry in os.scandir(entry.path):
                if subentry.is_file() and subentry.name.endswith(".png"):
                    name = entry.name + os.path.splitext(subentry.name)[0]
                    pcoll.load(name.upper(), subentry.path, "IMAGE")

    var.preview_collections["icons"] = pcoll

    # mod_update
    # ---------------------------

    mod_update.init(
        addon_version=bl_info["version"],
        releases_url="https://api.github.com/repos/mrachinskiy/booltron/releases",
    )