Skip to content

Commit

Permalink
Prepping to move more examples to another PR
Browse files Browse the repository at this point in the history
  • Loading branch information
sdfgeoff committed Jan 19, 2022
1 parent bab7adc commit 59624ba
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 15 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ assets:
rm -r assets || true
blender -b test_scenes/Cube.blend --python export.py -- --output-file="assets/scenes/Cube.scn" --log-level=DEBUG
blender -b test_scenes/PhysicsTest.blend --python export.py -- --output-file="assets/scenes/PhysicsTest.scn" --log-level=DEBUG
blender -b test_scenes/Heirarchy.blend --python export.py -- --output-file="assets/scenes/Heirarchy.scn" --log-level=DEBUG

run:
cargo run --example scenes -- scenes/PhysicsTest.scn
cargo run --example scenes
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
"type": "bool",
"default": false,
"description": "allow this body to sleep when velocity is low - this increases performance"
},
}
]
}
15 changes: 3 additions & 12 deletions examples/scenes/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ use bevy_rapier3d::physics::{NoUserData, RapierPhysicsPlugin};
use bevy_rapier3d::prelude::*;
use blender_bevy_toolkit::BlendLoadPlugin;

use std::env;


fn spawn_scene(
mut commands: Commands,
Expand All @@ -27,16 +25,7 @@ fn spawn_scene(
..Default::default()
});

let args: Vec<String> = env::args().collect();

if args.len() != 2 {
println!("Please specify a scene file to load. For example:\n cargo run --example scenes -- scenes/Heirarchy.scn");
std::process::exit(1);
}

println!("Running scene: {}", args[1]);

let scene_handle: Handle<DynamicScene> = asset_server.load(args[1].as_str());
let scene_handle: Handle<DynamicScene> = asset_server.load("scenes/PhysicsTest.scn");
scene_spawner.spawn_dynamic(scene_handle);
}

Expand All @@ -48,6 +37,8 @@ fn setup_physics(mut physics_config: ResMut<RapierConfiguration>) {


fn main() {
println!("Running example scenes");

App::new()
.add_plugins(DefaultPlugins)
.add_plugin(RapierPhysicsPlugin::<NoUserData>::default())
Expand Down
1 change: 1 addition & 0 deletions export.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def export_all(args):

logging.basicConfig(level=config.log_level)


try:
import blender_bevy_toolkit
print("WARNING: Plugin is installed in blender, using installed version for export")
Expand Down
Binary file modified test_scenes/Cube.blend
Binary file not shown.
Binary file removed test_scenes/Heirarchy.blend
Binary file not shown.

0 comments on commit 59624ba

Please sign in to comment.