Compare commits

..

2 Commits

Author SHA1 Message Date
kaosat.dev 6bc0ec0782 feat(Blenvy:Blender): added blender_manifest.toml to be compatible with Blender 4.2 extensions 2024-07-19 01:11:31 +02:00
kaosat.dev be0f4f1377 fix(Blenvy:Bevy): added safeguard against files withouth scene level metadata
* normally this should NOT happen if the blueprints to spawn are correctly generated
(by the Blender add-on) gltf files, but better safe (no unwrap!) than sorry
2024-07-19 01:09:43 +02:00
3 changed files with 104 additions and 34 deletions

View File

@ -156,7 +156,8 @@ pub(crate) fn blueprints_prepare_spawn(
/* prefetch attempt */ /* prefetch attempt */
let gltf = RawGltf::open(format!("assets/{}", blueprint_info.path)).unwrap(); let gltf = RawGltf::open(format!("assets/{}", blueprint_info.path)).unwrap();
for scene in gltf.scenes() { for scene in gltf.scenes() {
let scene_extras = scene.extras().clone().unwrap(); if let Some(scene_extras) = scene.extras().clone()
{
let lookup: HashMap<String, Value> = serde_json::from_str(scene_extras.get()).unwrap(); let lookup: HashMap<String, Value> = serde_json::from_str(scene_extras.get()).unwrap();
if lookup.contains_key("BlueprintAssets") { if lookup.contains_key("BlueprintAssets") {
let assets_raw = &lookup["BlueprintAssets"]; let assets_raw = &lookup["BlueprintAssets"];
@ -195,6 +196,7 @@ pub(crate) fn blueprints_prepare_spawn(
} }
} }
} }
}
// now insert load tracker // now insert load tracker
// if there are assets to load // if there are assets to load

View File

@ -171,7 +171,6 @@ type_mappings = {
"bevy_color::linear_rgba::LinearRgba": lambda value: parse_color_rgba(value, float, "LinearRgba"), "bevy_color::linear_rgba::LinearRgba": lambda value: parse_color_rgba(value, float, "LinearRgba"),
"bevy_color::hsva::Hsva": lambda value: parse_color_hsva(value, float, "Hsva"), "bevy_color::hsva::Hsva": lambda value: parse_color_hsva(value, float, "Hsva"),
'bevy_ecs::entity::Entity': lambda value: int(value), 'bevy_ecs::entity::Entity': lambda value: int(value),
} }

View File

@ -0,0 +1,69 @@
schema_version = "1.0.0"
id = "Blenvy"
version = "0.1.0"
name = "Blenvy"
tagline = "Tools to add/edit components of objects, collections etc & create blueprints & levels for the Bevy Engine in Blender"
maintainer = "kaosat-dev <https://github.com/kaosat-dev/>"
type = "add-on"
# Optional link to documentation, support, source files, etc
# website = "https://extensions.blender.org/add-ons/my-example-package/"
website = "https://github.com/kaosat-dev/Blenvy"
# Optional list defined by Blender and server, see:
# https://docs.blender.org/manual/en/dev/advanced/extensions/tags.html
tags = ["Game Engine", "User Interface", "Import-Export"]
blender_version_min = "4.2.0"
# # Optional: Blender version that the extension does not support, earlier versions are supported.
# # This can be omitted and defined later on the extensions platform if an issue is found.
# blender_version_max = "5.1.0"
# License conforming to https://spdx.org/licenses/ (use "SPDX: prefix)
# https://docs.blender.org/manual/en/dev/advanced/extensions/licenses.html
license = [
"SPDX:MIT"
]
copyright = [
"2023-2024 kaosat-dev",
]
# Optional list of supported platforms. If omitted, the extension will be available in all operating systems.
# platforms = ["windows-x64", "macos-arm64", "linux-x64"]
# Other supported platforms: "windows-arm64", "macos-x64"
# Optional: bundle 3rd party Python modules.
# https://docs.blender.org/manual/en/dev/advanced/extensions/python_wheels.html
# wheels = [
# "./wheels/hexdump-3.3-py3-none-any.whl",
# "./wheels/jsmin-3.0.1-py3-none-any.whl",
# ]
# # Optional: add-ons can list which resources they will require:
# # * files (for access of any filesystem operations)
# # * network (for internet access)
# # * clipboard (to read and/or write the system clipboard)
# # * camera (to capture photos and videos)
# # * microphone (to capture audio)
# #
# # If using network, remember to also check `bpy.app.online_access`
# # https://docs.blender.org/manual/en/dev/advanced/extensions/addons.html#internet-access
# #
# # For each permission it is important to also specify the reason why it is required.
# # Keep this a single short sentence without a period (.) at the end.
# # For longer explanations use the documentation or detail page.
#
[permissions]
# network = "Need to sync motion-capture data to server"
files = "Export Gltf files to disk, read registry files, etc"
# clipboard = "Copy and paste bone transforms"
# Optional: build settings.
# https://docs.blender.org/manual/en/dev/advanced/extensions/command_line_arguments.html#command-line-args-extension-build
# [build]
# paths_exclude_pattern = [
# "__pycache__/",
# "/.git/",
# "/*.zip",
# ]