GithubHelp home page GithubHelp logo

blender-scripts's Introduction

Blender Scripts

Open Python.blend for an example Blender file that contains all scripts.

Supported versions: Blender 3+ and 4+

Operators

Align Bone to Transform Orientation

Align bone to a Custom Transform Orientation and recalculate roll so that the bone Z axis points along the custom orientation X axis.

Run the op_align_bone_to_transform_orientation.py script once to register the new "Align Bone to Transform Orientation" operation.

op_align_bone_to_transform_orientation.py

  1. Go into Edit Mode (Tab when in Object Mode).

  2. Switch to Face Select mode (3).

  3. Select an object face.

    align_bone_to_transform_orientation_03.png

  4. Create a Custom Transform Orientation.

    Two options:

    • Option 1: Open the command palette (F3 or Edit --> Menu Search), type "transform create orientation" and execute the "Create Orientation" command. This will create a new Custom Transform Orientation called "Face" (by default). (Note: Older Blender versions will not automatically select the transform it. See: step 5.)

      align_bone_to_transform_orientation_04a.png

    • Option 2: Open the "Transform Orientations" menu in the header of your 3D Viewport editor and click on the + button. This will create a new Custom Transform Orientation called "Face" (by default) and automatically select it.

      align_bone_to_transform_orientation_04b.png

  5. If your new Custom Transform Orientation isn't already selected: Open the "Transform Orientations" menu in the header of your 3D Viewport editor and select "Face" at the bottom. ("Face" is the default name if this was the first manually created custom orientation.)

    align_bone_to_transform_orientation_05.png

  6. Snap (Shift+S) --> Cursor to Selected

    align_bone_to_transform_orientation_06.png

  7. Select an existing armature and enter Edit Mode.

  8. Either add a new bone or select an existing bone.

    align_bone_to_transform_orientation_08.png

  9. Open the command palette (F3) and type "Align Bone to Transform Orientation".
    Or: Right click the bone in Edit Mode and select the same operation.

    align_bone_to_transform_orientation_09a.png

    align_bone_to_transform_orientation_09b.png

  10. Now the bone sits orthogonal on the selected face and is rolled in a way that its Z axis points along the X axis of the Custom Transform Orientation.

    align_bone_to_transform_orientation_10a.png

    align_bone_to_transform_orientation_10b.png

  11. The newly created "Face" orientation can now be deleted.

Test Scripts

Just a couple of test scripts.

Get location of a vertex and move cursor to Z +1 in local space.

Show object info and convert vertex coordinates between local and global space.

blender-scripts's People

Contributors

toxe avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.