chore(): minor tweaks

This commit is contained in:
kaosat.dev 2024-03-21 21:37:10 +01:00
parent 4f50c4f6d2
commit 4f5f3be317
4 changed files with 7 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 626 KiB

After

Width:  |  Height:  |  Size: 644 KiB

View File

@ -19,16 +19,10 @@ fn start_game(mut next_app_state: ResMut<NextState<AppState>>) {
}
#[derive(Debug)]
struct Node {
value: String,
children: Vec<String>,
}
// if the export from Blender worked correctly, we should have animations (simplified here by using AnimationPlayerLink)
// if the export from Blender worked correctly, we should have an Entity called "Cylinder" that has two components: UnitTest, TupleTestF32
// if the export from Blender worked correctly, we should have an Entity called "Blueprint4_nested" that has a child called "Blueprint3" that has a "BlueprintName" component with value Blueprint3
// if the export from Blender worked correctly, we should have a blueprints_list
// if the export from Blender worked correctly, we should have the correct tree of entities
#[allow(clippy::too_many_arguments)]
fn validate_export(
parents: Query<&Parent>,
@ -36,7 +30,6 @@ fn validate_export(
names: Query<&Name>,
blueprints: Query<(Entity, &Name, &BlueprintName)>,
animation_player_links: Query<(Entity, &AnimationPlayerLink)>,
exported_cylinder: Query<(Entity, &Name, &UnitTest, &TupleTestF32)>,
empties_candidates: Query<(Entity, &Name, &GlobalTransform)>,
blueprints_list: Query<(Entity, &BlueprintsList)>,
@ -80,11 +73,10 @@ fn validate_export(
}
}
// generate parent/child tree
// generate parent/child "tree"
if !root.is_empty() {
let root = root.single();
let mut tree: HashMap<String, Vec<String>> = HashMap::new();
// println!("root {}", root.1);
for child in children.iter_descendants(root.0) {
let child_name:String = names.get(child).map_or(String::from("no_name"), |e| e.to_string() ); //|e| e.to_string(), || "no_name".to_string());

View File

@ -68,6 +68,7 @@ def copy_animation_data(source, target):
bpy.ops.object.make_links_data(type='ANIMATION')
# we add an "animated" flag component
target['Animated'] = f'(animations: {animations})'.replace("'", '"') #'(animations: [])' #
"""print("copying animation data for", source.name, target.animation_data)
properties = [p.identifier for p in source.animation_data.bl_rna.properties if not p.is_readonly]
for prop in properties:

View File

@ -31,6 +31,10 @@ def setup_data(request):
if os.path.exists(diagnostics_file_path):
os.remove(diagnostics_file_path)
hierarchy_file_path = os.path.join(root_path, "bevy_hierarchy.json")
if os.path.exists(hierarchy_file_path):
os.remove(hierarchy_file_path)
screenshot_observed_path = os.path.join(root_path, "screenshot.png")
if os.path.exists(screenshot_observed_path):
os.remove(screenshot_observed_path)