Origin Adjustment Control

by blenderVfxMaster in Addons


Origin Adjustment Control


Overview

This add-on enhances the ability to precisely manipulate the object origin in Blender. It supports operations such as aligning origins, snapping origins to surfaces, applying transformations, managing presets, and more. The interface includes modal interaction, panel controls, and tool enhancements like Gizmo display and coordinate conversion.



Features and Functions

1. Global Functions

  • get_valid_objects(context)
    Retrieves all selected objects of types MESH, CURVE, SURFACE, or FONT for origin adjustment.

  • apply_origin_transform(obj, new_origin)
    Transforms the object’s origin to a specified position in the world space while keeping its geometry intact.


2. Modal Operators

  • ADJUST_ORIGIN_OT_modal: Adjusts the object origin interactively by mouse movement.
    Steps to Use:
    1. Enable the custom origin feature.
    2. Invoke the operation via the "Adjust Origin Modal" button.
    3. Use the mouse to reposition the origin; left-click to confirm or right-click to cancel.

3. Actions and Operators

  • APPLY_ORIGIN_OT_apply: Moves the origin to the object’s geometric center.
    Usage: Click "Origin to Center" from the add-on panel.

  • ORIGIN_OT_ModeSwitch: Switches between origin control modes: World, Local, or Custom Reference.

  • OBJECT_OT_precise_rotation: Applies precise rotation values to objects based on input degrees for each axis.


4. Custom Origin Panel (UI)

  • Found in the VIEW_3D > Sidebar > Origin Adjustment.
    Panel Functions:
    • Enable custom origin positioning with a toggle.
    • Manually input precise origin positions.
    • Buttons to invoke key origin-related operators.

5. Key Features

5.1. Precise Transformations
  • Update the origin’s position or rotation directly using property inputs (custom_origin or precise_rotation).
5.2. Origin Gizmo
  • Enables an intuitive and interactive way to manipulate object origins using a visible 3D widget.
5.3. Keyframe Support
  • Add keyframes to record and animate origin transformations using the ORIGIN_OT_AddKeyframe operator.
5.4. Snapping System
  • Snap the origin to the nearest surface point using the ORIGIN_OT_SnapToSurface.

6. Coordinate Conversion

  • The ORIGIN_OT_CoordinateConverter operator supports transforming coordinates between World, Local, and Custom spaces for flexible origin control.

7. Preset Management

  • Origin Preset System:
    • Save current origin position and rotation with custom names (ORIGIN_OT_PresetManager).
    • Load saved presets to apply consistent transformations.
    • Manage presets with Save, Load, or Delete actions.

8. Batch Operations

Perform mass transformations on selected objects:

  • Align: Align origins of all selected objects to the active object.
  • Distribute: Uniformly distribute origins among objects (work in progress).
  • Reset: Reset origins to (0, 0, 0) in the world coordinate.

Setup Instructions

Installation:

  1. Save the Python script (*.py) to your computer.
  2. Open Blender and go to Edit > Preferences > Add-ons > Install.
  3. Select the script file and enable the add-on by ticking the checkbox.

Registration and Unregistration:

  • Register: The add-on is automatically initialized upon enabling.
  • Unregister: Use the disable option in Preferences or manually call the unregister() function.



Controls Overview

Tool/Feature Usage
Adjust Origin Modal Interactive adjustment using the mouse.
Apply Origin Move the origin to the object's geometric center.
Coordinate Converter Switch the coordinate space of a given point or object.
Preset Management Save and load custom positions and rotations for reuse.
Origin Gizmo Visual aid for real-time transformations in the 3D Viewport.
Keyframe Animation Record animated origin transformations for time-based effects.
Batch Operations Efficiently process multiple objects for origin transformations.

Custom Properties

The following properties are added to the Scene object:

  • enable_custom_origin: Toggles the custom origin mode.
  • custom_origin: Stores the current origin position as a 3D vector.
  • last_origin_location: Tracks the last-used origin position for quick reversion.

Additional properties are linked to object instances, such as origin_keyframes for animation and origin_presets for preset management.


Development Notes

  • This tool is modular, making it extensible for future updates.
  • Use the template structure of REGISTER/UNREGISTER blocks for safe property management.

Enjoy seamless control of origins to elevate your modeling, animation, and workflow precision!


$5

Have questions about this product?
Login to message

Details
Published 22 days ago
Software Version 4.3, 4.2, 4.1, 4.0, 3.6, 3.5, 3.4, 3.3
Extension Type N/A
License GPL