Giter VIP home page Giter VIP logo

blender-origami-fold's Introduction

Origami Fold Blender Add-on

This is a simple add-on for Blender 2.90+ that adds some commands to the mesh 'edge' sub-menu for creating armatures that simulate paper folding around an edge.

Presently you can create armatures that:

  • Fold the "left" side of the edge
  • Fold the "right" side of the edge
  • Fold both sides simultaneously (like 'mountain' or 'valley' folds)
    • Just a pre-linked left & right fold

Other features available:

  • Link any new fold to the one previously created so they fold at the same time
  • Create new folds as parents of previously created folds
    • Left parents to left, right parents to right

Possible future features:

  • Bevel edge to give fold some thickness
  • More than 1 axis of symmetry (e.g. more than left vs right)
  • Think about IK for squash and inside-reverse folds
  • Support for other advanced 3d fold types

Installation

  • Click 'code -> download zip' above to download the add-on zip
  • Extract the one folder inside, rename it to 'OrigamiFold', then re-zip it
    • Note: I will eventually post releases that avoid this step
  • In Blender, open the preferences pane
  • Click 'Add-ons' at the left then 'Install..' near the top
  • Select the Origamifold.zip file you created
  • Locate 'Mesh: Origami fold' in the list and enable it

How it Works

The concept behind this add-on was largely inspired by the following Youtube Video:

I automate placement of bones and avoid multiple armatures by:

  • Using vector math to compute orientations that are perpendicular to the edge
  • Painting weights automatically using an internal plane equation with the edge and the paper's surface normal
    • Some vertex weighting is not needed due to parented bones
  • If a bone moves an edge containing another bone, it becomes that bone's parent
    • This avoids needing multiple armatures

Basic Workflow (for very simple models like paper planes)

Here's a basic workflow to create an animation similar to the one above:

Prepare your paper:

  • Create a plane/quad aligned with XY-plane of the proper dimensions.
  • Cut edges into the plane with the knife or subdivision tool to match the crease pattern of your target model.
  • Ensure there is only one vertex at each edge endpoint (merge duplicates)

Create your folds:

  • Select all edges segments (along a single fold)
  • In the 'edge' menu (View3D, edit mode) select Origami Fold
  • Add the fold type desired

Tips:

  • Think about dependencies as you create your folds
    • If two folds are a mirror image, consider using the 'linked' feature
    • If fold will move the bone of one coming later, make the LATER one first and then use the 'parent' feature
  • The order you create folds matters when using the 'linked' and 'parent' features

Examples

(coming soon)

blender-origami-fold's People

Contributors

olliebrown avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

blender-origami-fold's Issues

Paper Thickness

Explore paper thickness options. The 'solidify' modifier seems like low-hanging fruit but it does not always play well with extreme folds, bevel modifiers, and other oddities that might be commonly needed.

Can't find the menu to use it

After installing the addon I prepared my paper, added an armature and parented the paper to it. When in edit mode, I don't find any menu regarding the addon though...

Support Fold radius (note, not paper thickness)

Real folds have a radius to them and the folded portion ends up sitting on top of the paper it meets up to (not in line with it). We need to explore adding some radius to the fold via the 'bevel' modifier and careful bone placement and vertex weights.

The original video that inspired this plugin (see readme for link) does this but it requires a lot of hand tweaking and seems to yield only moderately satisfying results without a lot of intervention. Want to explore how fool-proof we can make this and how it might also interact with a 'solidify' modifier to give the paper some thickness.

Intelligently support 'Undo'

Undoing the creation of folds creates an inconsistent state for the plugin. Need to explore Blender's options for rigorously defining how to 'undo' a python operator and implement this properly.

This is related to issue #1 and might be mitigated by changes there.

Expose Parameters for Fold Operator

Research how to have the little parameter box pop up after an operator that exposes ways to customize the operator itself. This would allow the user to adjust things like:

  • Fold direction (see issue #2)
  • Parenting and Linking
  • Bevel thickness and offset as part of fold radius (see issue #6)

This would also make the operators more consistent with Blender's built-in operators.

Probably need to consider the undo issues (#4) as well, as I suspect change the parameters after the operator is run would in fact cause a quick undo and redo to fire. Need to research how that works as well.

Internal Fold Count and Bone List can get out of sync

The list of folds and their associated bone names stored in the python script can get stale. It will hold onto the names of bones even if they have been deleted. It also seems to occasionally 'count' the folds incorrectly.

Need to take a different approach. Consider:

  • Name armature from the paper object name instead of just 'Fold'
  • Don't keep a list of bone names, instead search for them every time they are needed
    • Alternatively, always audit the list to ensure the bones exist still before using
  • Determine which bones to parent based on if they currently have a parent or not (don't just use list)

Support more lines of symmetry

Right now, only one line of symmetry is supported for linking folds (the Y-axis, left/right symmetry). We should expand this to not be relative to arbitrary things (like 'left' and 'right') and include more possibilities (4 lines, maybe 8 if possible).

Things to consider:

  • 4 possibilities is straightforward: +X, -X, +Y, -Y
  • More than 4, what should we name the lines:
    • Angle degrees (where is 0, CW or CCW)
    • Clock-face numbers (no perfect 45 without using minutes or fractions)
  • Could this just be reasonably automated so they don't need names, detect what way the edge tangent is pointing?
    • How do we know when it is backward and needs to be flipped (a common issue)?
      • Pick the side with the fewest vertices (e.g minimize the surface area of the folding part)
      • Utilize winding of neighboring faces to make it unambiguous
    • Having the user tell us via names avoids that ambiguity but burdens the user

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.