https://github.com/kaosat-dev/Blenvy
Bevy Code & Blender addon for a simple workflow to add & edit Bevy components in Blender
https://github.com/kaosat-dev/Blenvy
bevy-engine blender gamedev
Last synced: 2 months ago
JSON representation
Bevy Code & Blender addon for a simple workflow to add & edit Bevy components in Blender
- Host: GitHub
- URL: https://github.com/kaosat-dev/Blenvy
- Owner: kaosat-dev
- License: other
- Created: 2023-07-25T20:57:57.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-05T16:00:43.000Z (8 months ago)
- Last Synced: 2024-10-29T15:48:05.948Z (6 months ago)
- Topics: bevy-engine, blender, gamedev
- Language: Python
- Homepage:
- Size: 50.5 MB
- Stars: 586
- Watchers: 15
- Forks: 54
- Open Issues: 45
-
Metadata Files:
- Readme: README-workflow-classic.md
- Funding: FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
- awesome-bevy - `blenvy`
- awesome-bevy - `blenvy`
README
# Workflow: classic
The workflow goes as follows (once you got your Bevy code setup)
- create & register all your components you want to be able to set from the Blender side (this is basic Bevy, no specific work needed)

## Component creation
- Create an object / collection (for reuse) in Blender
- Go to object properties => add a property, and add your component data
- unit structs, enums, and more complex strucs / components are all supported, (if the fields are basic data types at least,
have not tried more complex ones yet, but should also work)
- for structs with no params (unit structs): use a **STRING** property & an empty value
- for structs with params: use a RON representation of your fields (see below)
- for tupple strucs you can use any of the built in Blender custom property types: Strings, Booleans, floats, Vectors, etc
In rust:

(the Rust struct for these components for reference is [here](./examples/basic/game.rs#34) )

In rust:

(the Rust struct for this component for reference is [here](./examples/basic/core/camera/camera_tracking.rs#21) )
There is an other examples of using various Component types: Enums, Tupple structs, strucs with fields etc [here](./examples/basic/test_components.rs),
even colors, Vecs (arrays), Vec2, Vec3 etc are all supported
- for collections & their instances:
* I usually create a library scene with nested collections
* the leaf collections are the assets you use in your level
* add an empty called xxxx_components
* add the components as explained in the previous part
* In the Level/world itself, just create an instance of the collection (standard Blender, ie Shift+A -> collection instance -> pick the collection)
## Exporting to gltf
- export your level as a glb/gltf file :
- using Blender's default gltf exporter
!!**IMPORTANT** you need to check the following:
- custom properties
- cameras & lights if you want a complete level (as in this example)

- or much better, using [gltf_auto_export](./tools/gltf_auto_export/)## Now use your gltf files in Bevy
- load it in Bevy (see the various examples for this)
- you should see the components attached to your entities in Bevy

> note: you get a warning if there are any unregistered components in your gltf file (they get ignored)
you will get a warning **per entity**