Git Product home page Git Product logo

blender_bevy_toolkit's Introduction

FormatCheck ExportCheck

About

Bevy is a game engine written in the Rust programming language. It's currently rather early stages and doesn't have any sort of editor. So until it does, the only way to assign custom components to objects is through code. That's where blender_bevy_toolkit comes in. It provides a UI for adding components to objects in blender and exports the blender scene to bevy's scn format.

Note: I am developing this for my specific game and use case, so the exporter may not include all the features your game requires. PR's welcome!

Instructions

  1. Copy or symlink the blender_bevy_toolkit subfolder (the one with all the python) into your blenders addons folder. On linux this is .config/blender/2.92/scripts/addons.

  2. Create a scene in blender

  3. Add blender_bevy_toolkit to your Cargo.toml

[dependencies]
blender_bevy_toolkit = {path="../blender_bevy_toolkit"}
  1. Add the BlendLoadPlugin
use blender_bevy_toolkit::BlendLoadPlugin;
let mut builder = App::build();
builder = builder.add_plugin(BlendLoadPlugin::default());
  1. You can now load scenes the normal way:
let scene_handle: Handle<DynamicScene> =
    asset_server.load("models/Collections/PhysicsTest.scn");
scene_spawner.spawn_dynamic(scene_handle);

Supported Features:

A UI!

The whole point of this integration is to allow use of a user interface for creating scenes and adding components! So here's what using it looks like:

clip of adding components

Collection Export

The exporter exports all the collections in the blend file, including mesh data and hierarchy.

Note: This will likely change in the near future to exporting the current blender scene.

Physics Export

Physics objects are exported with an integration with bevy_rapier

Custom Components

Custom components allow your game-specific logic to be added through the same blender interface. Most custom components can be defined through simple JSON files, and those that require more complex behaviour can be implemented as python files. Custom components are stored externally to the addon (the addon looks for the folder component_definitions in the directory of the blend file), so you can work on multiple games without conflicts.

screenshot of custom component definition

Version Information:

Rust:

  • bevy 0.6.0
  • bevy_rapier 0.12.0

Blender:

  • blender 3.x (may work on others)

Developing

The makefile runs a script to export some blends from the test_scenes folder.

You should install:

pip install black

blender_bevy_toolkit's People

Contributors

lucaspoffo avatar sdfgeoff 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.