Code Monkey home page Code Monkey logo

trickshots-manual's Introduction

Blender add-on for executing trickshots using physics simulation. You write a short scenario and this Python package will run numerous simulations to find the right scene parameters to fulfill the scenario. It is a fast way to win a game called dude, perfect!

  • No fakes - physics is simulated with Blender for real.
  • Original solver allows creating variables and optimization tasks as scenario unfolds.
  • Can handle any scene parameters.
  • Includes convenience functions for setting initial object velocity and detecting scenario events.

You can use this package for motion design, robotics, education and who knows what else.

Features

For the solver the simulation is a black box as if it was the real world: no derivatives, no exact collisions, poor repeatability.

  • Check if objects had a collision between frames
  • Track velocities and accelerations
  • Creating variables during scenario execution
  • Setting optimization tasks during scenario execution
  • Flexible scenario structure with yield
  • Tasks math: bool, or, and
  • Triggers - remembers if the watched event happened
  • Minimize an arbitrary expression for guiding the solver
  • Supply a callback to modify the scene or use it to early exit the sim
  • Extend the code by defining your own tasks

Supported Blender versions

Supported: 3.3, 3.4, 3.5, 3.6
OS: Windows, Linux, MacOS
Not supported: 2.93 and earlier

Installation

In Blender go to Edit -> Preferences -> Add-ons tab, press Install and select trickshots.zip.

Tutorial

Please read the full manual. And here's just a small example:

def scenario():
    set_vel('ball', var3(-10, 10))
    yield hit('ball', 'box1')
    yield hit('ball', 'box2')
    yield hit('ball', 'box3')

solve(scenario)

This short piece of code is enough for animating the shot:

More examples of Blender scenes together with corresponding scenarios written in Python are available here.

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.