Extensions:2.6/Py/Scripts/Mesh/Exact Offsets

提供: wiki
< Extensions:2.6‎ | Py‎ | Scripts‎ | Mesh
2018年6月29日 (金) 06:22時点におけるYamyam (トーク | 投稿記録)による版 (1版 をインポートしました)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先: 案内検索

Exact Offsets

Exact Offsets
Tool for precisely setting distance, scale, and rotation of mesh geometry
UI location Spacebar Menu > "Exact Offsets"
Version 0,0,9 Author(s) nBurn
Blender 2.77 - 2.79 License GPL
Category Mesh


Executable information
File name mesh_xoffsets.py
Current version download https://drive.google.com/open?id=1uEzlGp19MNWSk84_XlYVOsmcDkasQbFW


Warning Point finding code is not optimized for high poly meshes
Links https://blenderartists.org/forum/showthread.php?416960


Overview

Exact Offsets is a mesh editing tool that allows you to precisely set the distance, scale, and rotation of mesh objects using vertex locations. It works in both Object and Edit Modes, with the operation performed being dependent on which mode you are in when a new distance or rotation is entered. The purpose of Exact Offsets is to make doing light CAD work in Blender easier (things like making minor adjustments to models from STL files before having them 3D printed).

Exact Offsets distance adjust example


Performance Note

The Add-On's vertex finding code is still mostly a proof-of-concept with only minor performance optimizations. During trial runs Exact Offsets worked fine with basic models, but once vertex counts reached the 10K to 30K range performance took a major hit. Using Exact Offsets with anything more complex than that might still be possible, but is not recommended.

Install instructions

  1. Save the "xoffsets_alpha_v009.zip" file to your computer
  2. In Blender, go to:  File > User Preferences > Add-ons
  3. Remove any older versions of "Exact Offsets" (if there are any)
  4. Press the "Install From File" button and select the xoffsets_alpha_v009.zip file you just downloaded.
  5. Enable the Add-On by clicking on the box to the left of Add-On's name (Exact Offsets)

Basic Usage

Launch the Add-On from the Spacebar menu by typing in: Exact Offsets
After launching the addon it will be in "Point Click" mode where you can add 2 or 3 "reference points" using the Left Mouse Button. Points are added by left clicking on/near the vertices of a mesh model in the 3D View. A point will be placed at the vertex closest to the location you clicked (except when no vertices are near the mouse cursor). The order in which you add the points determines their function and color:

  • 1st point set is the "Anchor" (red)
  • 2nd point set is the "Free" (green)
  • If a 3rd point is set, the 2nd point becomes the "Pivot" (blue) and the 3rd point (last) becomes the "Free" point

Removing points

If you click on an existing reference point it will be removed. For removing points the reference point assignment works in reverse of the "Anchor > Pivot > Free" order when you added points. Examples:

  • If 2 points were added and the Anchor is removed, the Free point (now the only point left) becomes the "new" Anchor.
  • If 3 points were added and the Pivot is removed, the Free and Anchor remain unchanged and the Pivot is removed.
  • If 3 points were added and the Free is removed, the Anchor remains unchanged and the Pivot becomes the "new" Free.

Entering a new measurement

After you add 2 or 3 points, a "button" will appear in the 3D View displaying the distance or rotation value between the reference points. If you click on the button a "Measure Input" dialog box will appear displaying the current measure between the points. If you change the measure in the dialog box and click "OK", a translation (move), scale, or rotation will be performed depending on which mode was active.

Available transform modes

Translate, Scale (Object mode only), and Rotation.

  • Translate mode is active when only 2 points were added.
  • Scale mode is active only if 2 ref points were added and attached to the same object.
  • Rotate mode active when 3 points are added.

Direction of Movement

When a new measurement is input with the dialog box, the Free point will move away from or towards the Anchor point to match the updated measurement. If Blender was in Object Mode, the Object the "Free" point was attached to will be moved. If Blender was in Edit Mode, the "Free" point's vertex will be moved. If the Free point was part of a selection set, all other selected vertices (if in Edit Mode) or Mesh Objects (if in Object Mode) will be moved along with the Free point (except when in scale mode).

Translate mode

Without an axis lock set, the Free point will move along the slope between the Anchor and Free points. With an axis lock set, Free is moved along a set axis.

Rotation mode

When an axis lock is set, the Free point will rotate around that axis where it passes through the Pivot point's location. The displayed angle measurement (in degrees) represents the smallest angle created starting from the Anchor-Pivot line (at 0 degrees) to the Pivot-Free line. Because the smallest angle is used to determine the direction to move the Free point, if the angle measured 0 or 180 degrees before entering a new rotation value, the new location for the Free point will have to be manually selected with the Left Mouse Button. When no axis lock is set, the Free point will rotate around the "face normal" of Anchor-Pivot-Free "face" coming off the Pivot's location. You will not be able to do a rotation without an axis lock set if the original rotation value was 0 or 180 degrees.

Scale mode

(Object Mode Only) If scale mode is active and no axis lock set, the whole object is scaled up or down so the distance between the Anchor and Free points matches the distance input with the dialog box. If an axis lock was set, the object will scale only along the selected axis. Note that the object is scaled in the direction of the Free point with the Anchor point maintaining its original location.

Notes

  • You cannot assign more than 1 reference point to a given 3D location (Points can't share the same coordinates).
  • If Objects have an unapplied scale or rotation, transforms may not work as intended (scale in particular).
  • Entering negative values will reverse the direction of the transformation. For example, If a Z axis lock was applied, the Free vertex was 2 units above the Anchor, and -3 was entered, the Free vertex would be moved down 5 units to sit 3 units below the Anchor.

Hotkeys

 LMB = Left Mouse Button, RMB = Right Mouse Button
  
 ESC      exits Exact Offsets
 LMB+RMB  exits Exact Offsets
 LMB      adds/remove ref points and activates button
 X        sets X-axis lock
 Y        sets Y-axis lock
 Z        sets Z-axis lock
 C        clears axis lock (sets "spherical" lock in rotation mode)