Blender Addons

repository·main·Indexed 18 days ago

https://github.com/blender/blender-addons

Documentation for various Blender addons, including the Blender ID addon for authentication and integration, the mesh_tinyCAD addon for CAD-style edge operations (VTX, XALL, V2X, BIX, CCEN, E2F), and the Tissue computational design add-on.

Tokens
1.8K
Snippets
6
Records
14
Agent score
64%

What's inside blender-addons

  1. Install the Blender ID addon

    main

    You can install the Blender ID addon manually within Blender by following these steps:

    1. Download or build the addon to obtain a .addon.zip file (located in the dist/ directory after building).
    2. In Blender, navigate to User PreferencesAddons.
    3. Click Install from file....
    4. Select the dist/blender_id*.addon.zip file.
    5. Enable the addon under the System category in the Addons list.

    Note: You must sign up for an account at the Blender ID site and log in once to authenticate.

    dist/blender_id*.addon.zip
  2. Use VTX (Vertex, Trim, or X) tools

    main

    The vtx script provides three CAD-style edge operations. It automatically detects whether to perform a V, T, or X operation based on the selection. Note that geometry must intersect within a tolerance of 1.5E-6.

    Operations:

    • V (Extend): Extends two edges towards their calculated intersection point.
    • T (Trim): Extends the path of one edge towards another edge.
    • X (Intersect/Weld): Where two edges intersect, a weld vertex is created, resulting in 4 edges and 5 vertices.

    How to use:

    1. Select two edges.
    2. Press Spacebar and type vtx.
    3. Select autoVTX.
    1. Select two edges
    2. hit `Spacebar` and type `vtx` ..select `autoVTX`
  3. Build and bundle the Blender ID addon

    main

    If you are developing or packaging the addon, use the following commands:

    • To build the addon: python3 setup.py bdist

    • To bundle the addon for Blender release scripts: python3 setup.py bdist bundle --path ../blender-git/blender/release/scripts/addons

    python3 setup.py bdist
    python3 setup.py bdist bundle --path ../blender-git/blender/release/scripts/addons
  4. Install the Tissue add-on in Blender

    main

    Tissue is a computational design add-on. While it is shipped with Blender, it is recommended to manually install the latest version from the official releases for better stability and features.

    Installation Steps:

    1. Download the latest release zip file from the Tissue GitHub releases page.
    2. In Blender, navigate to Edit > Preferences.
    3. Select the Add-ons tab.
    4. Click the Install... button.
    5. Locate and select the downloaded .zip file.

    Note for macOS users: If the zip file was automatically extracted by the OS, you must re-zip the extracted folder before attempting to install it in Blender.

    Note on duplicate versions: If you see two versions of Tissue in your add-ons list after installation, activate only the newly installed version and ignore the built-in one.

  5. Install the mesh_tinyCAD addon

    main

    The mesh_tinyCAD addon is included in standard Blender installations from version 2.78 onwards.

    To enable it:

    1. Open Blender.
    2. Navigate to User Preferences > Add-ons.
    3. Search for 'tiny' in the search field.
    4. Enable 'Mesh: tinyCAD Mesh tools'.

    Note for Blender 2.80+ users: If you encounter an older version that fails to load or run, you should reinstall it directly from the GitHub repository.

  6. Use X ALL to intersect all selected edges

    main

    The XALL (Intersect All) operator programmatically iterates through all selected edges, slices them at every found intersection, and welds them together.

    1. Select as many edges as you want to intersect.
    2. hit `spacebar` and type `xa` ..select `XALL intersect all edges`
  7. Example: Displaying username in Addon Preferences

    main

    This example demonstrates how to use blender_id.get_active_profile() within a bpy.types.AddonPreferences class to show the logged-in user's name in the Blender UI.

    import bpy
    
    class DemoPreferences(bpy.types.AddonPreferences):
        bl_idname = __name__
    
        def draw(self, context):
            import blender_id
    
            profile = blender_id.get_active_profile()
            if profile:
                self.layout.label('You are logged in as %s' % profile.username)
            else:
                self.layout.label('You are not logged in on Blender ID')
    
    def register():
        bpy.utils.register_module(__name__)
    
    def unregister():
        bpy.utils.unregister_module(__name__)
    
    if __name__ == '__main__':
        register()
  8. Use Blender ID functions in your own addon

    main

    You can integrate Blender ID authentication into your own Blender addons using the blender_id module.

    Available Functions

    • blender_id.get_active_profile(): Returns a BlenderIdProfile object for the logged-in user, or None if not logged in.
    • blender_id.get_active_user_id(): Returns the user ID string of the logged-in user, or '' if not logged in.
    • blender_id.is_logged_in(): Returns True if the user is logged in, False otherwise.

    BlenderIdProfile Object

    The BlenderIdProfile object contains the following attributes:

    • user_id: The unique user ID (e.g., '41234').
    • username: The user's email/username (e.g., 'username@example.com').
    • token: The authentication token.
    import blender_id
    
    # Check login status
    if blender_id.is_logged_in():
        profile = blender_id.get_active_profile()
        print(f"Logged in as: {profile.username}")
    else:
        print("User not logged in.")