#Blenvy

1 messages · Page 3 of 1

dawn shell
#

At least there is no instance of the word "error"

#

adding materialInfo to object <bpy_struct, Object("CarBlue") at 0x0000017786FCE420> material info (name: "TailLights", path: "materials/bike_game_materials.glb")

#

Well, that at least matches what I'm seeing: a car completely made out of tail lights

#

kinda suspicious how nothing else is betting a materialInfo added

#

Let me check if the car indeed only has a MaterialInfo on the tail lights in Bevy

#

Found something interesting: for the car, none of the meshes hold a MaterialInfo, but the meshes' parent is holding a MaterialInfo that looks like this:

name: "TailLights",
path: "materials/bike_game_materials.glb"
#

Seems like instead of exporting one MaterialInfo per mesh, only the parent is getting a single one.

ebon zealot
dawn shell
#

Checking the buildings in more detail, this is true for some of the buildings as well

#

Notice how some buildings have a color and some are white? The colored ones have a MaterialInfo on the meshes' parent, while the white ones don't

dawn shell
ebon zealot
dawn shell
#

Also, re-exporting changed which buildings were affected. Compare this screenshot with the one I'm replying to.

#

(I did not clear out my blueprints or materials directory inbetween exports)

ebon zealot
dawn shell
#

Actually, let me commit my changes after producing said log.

ebon zealot
dawn shell
dawn shell
ebon zealot
ebon zealot
ebon zealot
dawn shell
#

Sure, let's take the car

#

hierarchy

#

materials

#

The individual materials all look the exact same other than the color

ebon zealot
#

Ok, Thanks ! that confirms, it , I think I know where the issue comes from

dawn shell
ebon zealot
#

I coded that ages ago, was somehow sure that gltf does NOT support multiple materials

#

I stand corrected 😄

#

Ok I'm off, will fix this tomorrow

dawn shell
ebon zealot
#

( MaterialInfos would need to store more than one material, how that can be mapped to the different meshes generated by gltf remains an issue)

dawn shell
#

I also managed to fix some buildings not having any MaterialInfo. I deleted the materials folder and re-exported, now everything has a material

#

(That's not the default white, that's a grey color from a material)

dawn shell
round cove
#

I had to patch in that all_materials fix again today

#

I had an issue with some materials causing issues, got them all deleted but needed this afterwards to regenerate the materials file

#

materials file is actually fine now that its being generated. This is data in the Scene.glb

round cove
#

ok I narrowed it down to basically failing on unrecognized extension data afaict. Changing this from a panic to a return-and-warn let it slide by the extension data.

        let Ok(component) = reflect_deserializer.deserialize(&mut deserializer) else {
            warn!(
                "failed to deserialize component {} with value: {:?}",
                name, value
            );
            return;
        };
        // .unwrap_or_else(|_| {
        //     panic!(
        //         "failed to deserialize component {} with value: {:?}",
        //         name, value
        //     )
        // });
#

in crates/blenvy/src/components/ronstring_to_reflect_component.rs

#

I re-enabled all problematic addons (quick baker, blender kit) and it all works again. There's another issue that can come up because blender kit will insert invalid unicode from someone's profile description into your blend file

#

its literally just some "about me" type information, which is nice, but not at the cost of crashing my program when its incorrectly formatted lmao

round cove
#

I've got a little "Sacrifical Scene" in my project now that I know removing the level and unlinking data will clear up the issue. This is where I plan to try out any fun random stuff before actually using it

#

color is a little off compared to in-blender, but I figure that's fixable somehow. (maybe lights? shader adjustment? idk yet)

ebon zealot
# round cove

Hmm that is an annoying recurring issue, I'll look into it closer, but also , longer term, I wonder if I should not add the tools to enable "always export this & this material" like there is for levels and blueprints ?

ebon zealot
# round cove ok I narrowed it down to basically failing on unrecognized extension data afaict...

This is all very useful feedback, thanks a lot 🙂
I am always on the fence about panicking for such issues:

  • panic makes sure weird/bad data does not go unnoticed
  • but it makes ignoring bad data you cannot always do something about problematic
    Bevy tend's to also be overly panicky for some things (for example commands trying to do things with entities that do not exist anymore) and it tends to get annoying as a user.
    Should I switch to warn in general for this ? The likelyness of weird data coming from Blender via the various add-ons is relatively high
#

@dawn shell not quite ready to be pushed yet , however ... multiple materials with material library is working !

#

Also folks, having to deal with limitations of Blender, Blender's gltf exporter and Bevy for the same feature is sometime not fun at all to put it mildly 😄

round cove
dawn shell
# ebon zealot This is all very useful feedback, thanks a lot 🙂 I am always on the fence abou...

I'd greatly prefer if both Bevy (https://github.com/bevyengine/bevy/issues/12660) and Blenvy relied more on warnings (or Result where possible) instead of panics for the purposes of game development, as many times, a corrupt state is preferable over the player losing their progress. Case in point: my materials look very wonky right now, but I can still continue development precisely because there is no panic happening.
Maybe Blenvy could have an error_handler and warning_handler that you can override in the plugin? That way, you can set them to panic! if you want. Note that this is non-trivial to add correctly, as you must guarantee that the stack trace is preserved.

GitHub

What problem does this solve or what need does it fill? Unwrap should generally be avoided. We already encourage contributors to avoid the use of Option::unwrap, yet crashes from panics are still o...

dawn shell
dawn shell
round cove
# ebon zealot This is all very useful feedback, thanks a lot 🙂 I am always on the fence abou...

I think the warn that I inserted above is necessary, unless its possible to ignore all "extra" data when writing or whatnot.

I haven't looked into whether the utf8 issue is warn-able or not. I don't know yet whether there's important information in that same metadata string or not, but if it is ignorable, then warn as well.

In general I would say warn and never panic, especially given how loose blender seems to be with stuff.

lime pasture
#

Hey, first of all thanks for the hard work on Blenvy, it's incredible how much it improved since I last tried blender_bevy_component_workflow 😄
I noticed a strange bug when exporting parented objects, they seem to get exported multiple times, one with the parent's offset and one at the origin. Is this a known issue?
Here I just made a cube, then an empty, then parented the cube to the empty. In bevy, a second cube was spawned at the origin
This is on blenvy_v0.1.0_pre_alpha btw

dawn shell
ebon zealot
#

@dawn shell & @lime pasture is the duped object in cases like these ?
(I have at least 3 tests with variations of parenting with empties, so I am a bit sad it still happens 😄 )

dawn shell
ebon zealot
# dawn shell I'd greatly prefer if both Bevy (https://github.com/bevyengine/bevy/issues/12660...

Good points, I changed the handling to what @round cove did for the upcoming update 🙂
The idea with the handlers makes sense but perhaps even something as basic as panic when in dev mode & not on release would make sense ? although even in dev mode it gets dang annoying 😄
About unwrap() I have slowly started to remove them from the code over the past few months & replacing them with expect() , still ways to go

ebon zealot
dawn shell
ebon zealot
ebon zealot
dawn shell
#

And here's the Children of World. As you can see, there is both Bike and PlayerViewModel -> Bike

dawn shell
lime pasture
dawn shell
lime pasture
#

Nope

dawn shell
#

Does your hierarchy in Bevy also look like this?

  • World
    • Empty.001
      • Cube.004
    • Cube.004
#

(That would explain why the duplicated cube is at origin)

lime pasture
#

Oh I think I found it: I had everything in a nested collection

ebon zealot
lime pasture
ebon zealot
lime pasture
#

Ok now I'm just confused, I put it back in the collection and there's still no duplicate 😅

lime pasture
#

I don't know how I fixed it 😅

ebon zealot
dawn shell
#

😄

#

Lucky for me, the bike happens to spawn low enough to be under the floor, so it doesn't impact the game 😄

ebon zealot
ebon zealot
ebon zealot
dawn shell
#

I had the same duplication when using the following setup:
World:

  • Foo instance
    Library:
  • Foo collection
    • Cube
      • ColliderCube instance
  • ColliderCube collection
    • Empty holding ColliderConstructor
      which resulted in ColliderCube being duplicated
#

My solution for now is to manually duplicate ColliderCube and make that duplicate a child of Cube.

ebon zealot
#

@dawn shell & @lime pasture would either of you mind exporting the world as a gltf file (not glb, and using Blenvy , not the normal exporter) & send it to me ?
Because it means the duplicate is being spawned by something, likely with a BlueprintInfo where there should not be one.
With the gltf file I could check the structure and verify if the issue comes from the Blender or the Bevy side.

lime pasture
dawn shell
#

This here looks like the duplicate

dawn shell
dawn shell
lime pasture
#

My duplicate is called "Cube.004____bak" where the original is "Cube.004"

ebon zealot
ebon zealot
dawn shell
#

I also found a __bak

lime pasture
dawn shell
#

In fact, I have both a __bak and a non __bak bike in there 😄

#

These should AFAIK both not be there

ebon zealot
#

So if you do not mind a bit of sanity check:

  • the issue is always with something being a child of an empty
  • you both observed this in your levels
  • as is clear from @lime pasture 's file it also happens WITHOUT blueprints (this is the strangest part of it all)
  • the duplicates have ___bak in their names
dawn shell
dawn shell
ebon zealot
#

I am 99% that the issue comes from this function (and if I could reproduce it locally, I could pin it down exactly)

ebon zealot
dawn shell
ebon zealot
#

oh dang, I think I found the reason for the issue, but if it were the case I would also be able to reproduce it and it would happen all the time ??

lime pasture
#

It just happened to me without an empty (with a torus)

ebon zealot
ebon zealot
lime pasture
dawn shell
#

this setup does not trigger the duplicate

dawn shell
ebon zealot
lime pasture
#

For me this sequence of actions seems to cause the bug most reliably

dawn shell
#

@ebon zealot do you get the __bak node in a gltf when you export from my .blend file?

#

It's by all means not minimal, but it may allow you to reproduce it.

ebon zealot
ebon zealot
lime pasture
ebon zealot
lime pasture
ebon zealot
ebon zealot
#

In general the question that is nagging me is : why can't I reproduce the error in any of my test blend projects ?

dawn shell
#

Can you copy just my bike setup to a new blend file?

#

by importing it from my blend file

#

If you did that and are not able to reproduce the bug: what happens when you delete everything from the original blend file except the bike setup, so that the two blend files look identical?

#

If that still produces different results, you know it's some weird interaction with settings embedded in the blend file.

#

e.g. mine has pack resources enabled. Shouldn't cause any of this, but I've seen stranger things happen in Blender.

ebon zealot
lime pasture
ebon zealot
#

@lime pasture is this a fresh project/blend file ? (ie the old blender add-ons have never been used with it), right ?

dawn shell
#

As a sanity check for the future / a bandaid for now, you could emit an error! when loading something ending in ___bak and skip it.

#

For Yarn Spinner, I have a bunch of error! messages like that with a message like "Blablabla did XYZ. This is a bug. Please report it under <link to create an issue>"

lime pasture
ebon zealot
lime pasture
ebon zealot
#

My conclusion so far: Blender is doing some REALLY weird stuff with parenting under the hood.

ebon zealot
ebon zealot
#

Seriously , what the heck ?
So according to Blender, Cube.004 is a direct child of the Collection:

#

The collection:

#

So I suspect that Blender , whenever you parent things, does NOT correctly update the parent<-> child relationships wrt collections

ebon zealot
#

Then again, I tend to forget that Blender's collections are NOT part of the normal hierarchy, and that objects can be inside more than one collection 🤦‍♂️

#

Sooo, I think I solved it, need to check if I did not break more things in the process

#

If it is all good, a bit of cleanup & it gets pushed

#

I'd say it works well 🙂

ebon zealot
dawn shell
dawn shell
ebon zealot
#

New update is out !

dawn shell
ebon zealot
ebon zealot
dawn shell
#

Ah heck, the materials file again is not created

#

Or is that file now superfluous?

#

The error comes from my own preloading

ebon zealot
dawn shell
#

👍

#

let's compile again then

ebon zealot
#

I nuked it locally:

dawn shell
ebon zealot
dawn shell
#

On native builds, I could just load the entire directory, but Wasm unfortunately requires listing every file individually :/

#

hurray!

#

(the random yellow lines are colliders for debugging)

#

Only one issue

#

Blender

#

better angle in Bevy

#

note how the fire exit is red

ebon zealot
dawn shell
#

Oh yes, that would be amazing ❤️

#

Huh, looking at the fire exit, it looks like it has a weird setup

#

notice it only has one color

sly fulcrum
#

Man that test level looks really nice

dawn shell
#

but mutiple assigned materials

dawn shell
#

Everything is CC0 or CC-BY

#

I made none of the models, credit goes to the artists 🙂

ebon zealot
dawn shell
#

I did however spend a long time scaling everything, optimizing the polygon count and manually creating colliders for everything 😄

ebon zealot
dawn shell
#

brick_shade1 in Bevy vs meta_shade1 in Blender

#

The multiple materials look like a mistake on the artist's side imo

#

should really be only one

ebon zealot
dawn shell
#

I removed everything except the metal material and it's still red in Bevy. I assume change detection didn't pick up my changes.

ebon zealot
dawn shell
#

Removed all folders and regenerated everything, now it looks good!

#

Let me drive around the scene a bit

ebon zealot
dawn shell
#

something went wrong with a collider here, but I don't think that's Blenvy's fault

dawn shell
#

collider looks correct in Blender

#

🤷‍♂️

#

yeah I've had issues with negative scales in GLTFs doing weird things in Bevy before, I really really don't think this is due to Blenvy

#

hold up, all scales are negative in Bevy

#

This setup in Blender...

#

...results in this setup in Bevy. Any idea why all scales might be negative?

#

when I manually set the scales Y = 1 and Z = 1, it looks completely wrong. So I guess the scales have to be that way? But why?

dawn shell
#

For others running into this: negative scales are not properly supported by avian colliders yet

dawn shell
ebon zealot
ebon zealot
dawn shell
round cove
dawn shell
#

Little update concerning avian colliders: do not scale collection instances in your World that contain colliders in your hierarchy. The colliders won't inherit the scale. Scaling the collider's parents works, just not the collection instance

#

(Seems like an Avian bug)

ebon zealot
round cove
#

so this would turn into a navmesh that avoided the center

ebon zealot
round cove
glass abyss
#

did you guys figure out the material issue?

ebon zealot
#

So, I updated the Blender add-on again !

  • now correctly handling multi material meshes that have more materials in their slots as there are actual
    materials applied (thanks once again for reporting a bug that would have taken me ages to see @dawn shell :D)
  • per-blueprint materials are now correctly inserted/updated even when there are no material changes (ie cases where
    the ordering of slots etc is changed on a mesh)
  • conditions for triggering exports of levels & materials are more coherent and exports are now triggered on export setting
    changes (as they should have been !)
  • minor cleanups
ebon zealot
ebon zealot
round cove
#

its not a big deal for me atm, so don't feel like its something you need to focus on unless you have some ideas or whatnot

#

I also have my materials in bevy_asset_loader right now so that they preload, because I was running into some "materials should have been preloaded" messages

glass abyss
ebon zealot
# round cove I ended up putting the blueprint in bevy_asset_loader so that I could control th...

Hmm that should not be the case, but there are a few tweaks yet to the assets loading, and I keep changing things : put it simply there are two "categories" of assets , that I am not sure how to deal with:

  • the direct assets (ie only the direct children of a world for example)
  • the whole asset tree (usually what you want to load when you load a level)
    Problem is , you might need one or the other depending on use cases (level loading needs all assets, hot reload only direct assets), and of course direct assets are a subset of the whole asset tree
    In the past week I changed what assets get passed to Bevy a few times (most of it is invisible, but from what you are saying, you hit the "not invisible" cases)
    Normally a blueprint (including levels)
  • is considered "ready" only if all its assets have loaded
  • AND all its blueprints & sub-blueprints & their assets have also finished loading & have spawned

Of course if not the whole list of assets is passed , then it can cause issues (or "on-demand" loading as you put it)

ebon zealot
dawn shell
#

If it really is a bug in Blenvy, I can imagine that HideUntilReady is causing it. I'll experiment with that

round cove
dawn shell
round cove
#

I had to make sure I was optimizing packages so that the loading didn't take forever

#

and that was on native, so I assume slower on wasm

round cove
ebon zealot
dawn shell
#

If it was a long load, my problem would instead be that loading sometimes takes a few seconds and sometimes more than multiple minutes to complete

#

Also, loading generally freezes up things like the UI and the cursor (thanks, single threaded Wasm)

#

When this issue happens, the UI and cursor update normally.

ebon zealot
#

Hmm 🤔 I really need to remove the double loading of gltf files, that is a loading time and memory killer.

dawn shell
#

Can't wait to remove this code 😄

ebon zealot
dawn shell
#

oh, I've been getting these all the time and just assumed I had to preload stuff myself

ebon zealot
dawn shell
ebon zealot
dawn shell
#

That's where I took the screenshot above

dawn shell
ebon zealot
dawn shell
dawn shell
dawn shell
# dawn shell

Note that while this specific error is coming from Wasm reliably, I've been getting them every now and then native as well.
It seems to me like something in the code is assuming the preloading is done without properly checking, which works out if your app is running on native and thus the loading speed is often fast enough.

ebon zealot
sly fulcrum
#

I’ve been summoned

#

Oh nvm

ebon zealot
dawn shell
dawn shell
dawn shell
dawn shell
ebon zealot
ebon zealot
dawn shell
ebon zealot
#

I am now looking into exporting additional asset files from the Blender add-on
My brain is a bit broken, will need to lookup how to have untyped handles in ron files that are usable with bevy_common_assets (just need basic ron reading functionality)

#

oh btw @dawn shell you theoretically don't even need to add handles to your audio & co files manually either, you can just add assets to your blueprints & levels in Blenvy (Blender side) & retrieve them on the Bevy side

dawn shell
ebon zealot
dawn shell
ebon zealot
ebon zealot
dawn shell
# ebon zealot When you spawn the Blueprint

So I probably still need handles for the music and the sound effects that play in the main menu 😉 But good to know that the ingame music could be loaded through Blenvy

dawn shell
#

Does the handle get cached somewhere in that case? What happens with the assets when the world blueprint is despawned?

#

Hmm, I guess that would be a bit of a memory leak

ebon zealot
ebon zealot
dawn shell
ebon zealot
#

you know what I have to double check these parts, I am honestly not sure anymore

dawn shell
#

Hehe, no problem

#

I have a reproduction of my issue of "infinite loading" open right now, including an inspector.

#

no errors in the console

ebon zealot
#

The handles for blueprints are not staying alive for sure, because I had the issue with dropping the scene handle and they all dissapeared

dawn shell
#

as you can see by the gizmos of the colliders, the level seems to have loaded in theory

dawn shell
ebon zealot
dawn shell
ebon zealot
dawn shell
#

From a glance, it seems to trigger about 25% of the time when loading the level in Wasm

ebon zealot
#

Btw I can reproduce your issues in Wasm:

dawn shell
#

you mean the highlighted one?

ebon zealot
dawn shell
#

That's a local build and not the one of itch, right?

ebon zealot
#

Still odd that it is only on the material files

dawn shell
#

Player has no BlueprintInstanceReady

#

Which is weird, given that Player is nothing but an empty with a Player marker component

#

there's not really anything to load there

#

or should it not have anything because it itself is not a blueprint?

ebon zealot
ebon zealot
dawn shell
#

If an empty has a child blueprint, the parent should have no BlueprintInstanceReady, but the child should, correct?

ebon zealot
dawn shell
dawn shell
ebon zealot
dawn shell
#

I manually went through all blueprints I placed in the World and they all have a BlueprintInstanceReady. I did not check nested blueprints.

#

I'll leave that tab open in case I can help you debug something there

dawn shell
ebon zealot
ebon zealot
dawn shell
ebon zealot
dawn shell
ebon zealot
#

btw , to add assets, just go to either the blueprints or levels tabs, open the one you want to add assets to & browse & add assets
The blueprint/levels will then have a name + path to the asset

dawn shell
ebon zealot
dawn shell
#

The only relevant question for the Jam is "Is this worse then telling the player to randomly refresh the page if they believe it is done loading but not starting?" 😄

dawn shell
dawn shell
#

It reads as "Needs to have both With<BlueprintAssetsLoaded> and Added<BlueprintAssetsLoaded>"

#

Added should imply With, so it's at best a superfluous bound

#

And as soon as something has Added, it should rather be an observer with Trigger<OnAdd, BlueprintAssetsLoaded> for performance reasons.

#

Although at that point BlueprintAssetsLoaded could probably become an Event directly so it does not need to be inserted

#

this seems to work for now 😄

fn hack_loading(
    mut commands: Commands,
    q_world: Query<
        Entity,
        (
            With<GameWorldTag>,
            With<BlueprintSpawning>,
            Without<BlueprintReadyForFinalizing>,
            Without<BlueprintInstanceReady>,
        ),
    >,
    q_blueprints: Query<Has<BlueprintInstanceReady>, (With<BlueprintInfo>, Without<GameWorldTag>)>,
) {
    let world = single!(q_world);
    if !q_blueprints.is_empty() && q_blueprints.iter().all(|ready| ready) {
        commands.entity(world).insert(BlueprintReadyForFinalizing);
    }
}
dawn shell
dawn shell
dawn shell
#

Testing the game some more on Wasm right now, and other than a cursor locking issue that Blenvy definitely can't do anything about, this is the last user-facing problem I have with Blenvy, as the preloading stuff has a functional workaround. Everything else is working great ❤️

#

Do you think there is a chance you might find a fix on Sunday? Or should make a disclaimer UI ready / restart the game if everything didn't load after say 1 minute?

#

Again, no pressure, it's totally fine if not 🙂

dawn shell
#

Update: here's a more sophisticated version of the hack that seems to work so far. It includes some ugly memoization cooltofu
The timer is there because otherwise I get a false positive very early on, when nothing much has spawned at all yet.


#[derive(Debug, Resource, Deref, DerefMut)]
struct LoadTimer(Timer);

impl Default for LoadTimer {
    fn default() -> Self {
        Self(Timer::from_seconds(10.0, TimerMode::Once))
    }
}

/// Needed because `BlueprintReadyForFinalizing` is not inserted on `World` in about 25% of runs on Wasm
/// due to a bug that is probably coming from Blenvy
fn hack_loading(
    time: Res<Time>,
    mut commands: Commands,
    q_loading: Query<
        Entity,
        (
            With<BlueprintSpawning>,
            Without<BlueprintReadyForFinalizing>,
            Without<BlueprintInstanceReady>,
        ),
    >,
    q_children: Query<&Children>,
    q_blueprints: Query<Has<BlueprintInstanceReady>, With<BlueprintInfo>>,
    mut load_timer: ResMut<LoadTimer>,
) {
    if !load_timer.finished() {
        load_timer.tick(time.delta());
        return;
    }
    if q_loading.is_empty() {
        return;
    }
    let mut processed = HashSet::new();
    let mut ready_map = HashMap::new();
    for loading in q_loading.iter() {
        if processed.contains(&loading) {
            continue;
        }
        go_through_children(
            &mut commands,
            &q_children,
            &q_blueprints,
            loading,
            &mut ready_map,
        );
        processed.insert(loading);
    }
}

fn go_through_children(
    commands: &mut Commands,
    q_children: &Query<&Children>,
    q_blueprints: &Query<Has<BlueprintInstanceReady>, With<BlueprintInfo>>,
    entity: Entity,
    ready_map: &mut HashMap<Entity, bool>,
) -> bool {
    if q_blueprints.contains(entity) && !q_children.contains(entity) {
        ready_map.insert(entity, false);
        return false;
    }
    match q_children.get(entity) {
        Ok(children) => {
            let ready = children.iter().all(|child| {
                if let Some(ready) = ready_map.get(child) {
                    *ready
                } else {
                    let ready =
                        go_through_children(commands, q_children, q_blueprints, *child, ready_map);
                    ready_map.insert(*child, ready);
                    ready
                }
            });
            if ready {
                ready_map.insert(entity, true);
                commands.entity(entity).insert(BlueprintReadyForFinalizing);
            }
            ready
        }
        Err(_) => true,
    }
}

dawn shell
#

Little update: got this error. Seems supremely rare, I only got it once in like 50 runs. May also be a user error, since I'm spawning a blueprint manually at some point.

ebon zealot
dawn shell
round cove
#

@dawn shell have you been using any of the dynamic mesh creation ColliderConstructor variants?

dawn shell
#

Place it on the mesh in Blender, not the parent

#

i.e. on the green triangle, not the orange one

round cove
#

yeah I am. Seeing some crashes from these options in particular.

#

just realized there was a zip update yesterday though

#

so going to try that first

dawn shell
#

Huh, that's weird

#

You can also use the ColliderConstructorHierarchy anywhere and it will build stuff for all children. Maybe that helps?

dawn shell
round cove
#

then also I'm seeing some issues loading into bevy

#

but export first, then bevy fix 😆

#

I had someone comment on youtube that they also were seeing crashes so I'm testing for that reason

dawn shell
#

Only dynamic thing we did was a ConvexHullFromMesh on a simple ramp, and that always worked. I'd be interested in what is causing your crash hmm

ebon zealot
dawn shell
#

Also try dependending on avian's main branch, there was a minor update to add some types to the type registry because Blenvy was throwing warnings. Don't think it should matter, but maybe.

dawn shell
ebon zealot
round cove
#

so cube + solidify + boolean

dawn shell
ebon zealot
dawn shell
ebon zealot
#

I have a lot less gltf export crashes in Blender 4.2 than 4.1 , it crashed all the time, even exporting lights (a gltf export option) was causing the exporter to fail

ebon zealot
ebon zealot
#

Btw @round cove did the crash , while leaving the temp_scenes, also mess up your objects (ie leaving stuff with xxx__bak behind or not ?

round cove
ebon zealot
round cove
#

behavior of a serial pre-release user 😆

#

I have a "sacrifical scene" where I try materials out too

ebon zealot
#

Crap, it already should be cleaned up correctly :

round cove
#

upgrading after I play with uvs

ebon zealot
round cove
#

this was the uv map btw

round cove
#

notably I didn't technically lose anything. demo scene is still working. I just had to rename my objects in the scene. and removing the colliderconstructor fixed the export issue

round cove
dawn shell
#

Which variant(s) is/are affected?

round cove
dawn shell
#

I'm wondering if the crashing ones are the ones that have extra params

#

Does ConvexHullFromMesh crash? That one has no params.

round cove
#

oh no. now nothing is crashing at all

#

I am using the new uvs, so that's the only thing that's changed substantially

#

(yeah the colliders are clearly in the wrong rotation for some reason. idk why)

#

if I can reproduce it in the future I'll speak up again. but right now none of the FromMesh style variants are failing anymore

dawn shell
round cove
dawn shell
dawn shell
#

@ebon zealot when I spawn my level like this...

    commands.spawn((
        Name::new("Level"),
        BlueprintInfo::from_path("levels/World.glb"),
        SpawnBlueprint,
        Visibility::Hidden,
        GameWorldTag,
        StateScoped(Screen::Playing),
    ));

...the actual visibility ends up being Visibility::Inherited. Is it possible that Blenvy overwrites the Visibility even without HideUntilReady?

#

Note that I ended up not needing to hide the level after all, so this is irrelevant now for me, but I wanted to report it in case someone else runs into it.

ebon zealot
dawn shell
ebon zealot
dawn shell
dawn shell
dawn shell
#

Disclaimer: there is a chance that this is a user error and I'm setting some visibility and forgot about it. I don’t think that’s the case, but it might be.

#

… nevermind, it was a user error, my bad 😅

ebon zealot
dawn shell
ebon zealot
#

Unrelated, but bug related: @dawn shell , would you mind adding issues on github for the two issues you faced yesterday ?

  • the unreliable loading of assets on wasm (& potentially native)
  • the random lack of flagging of "BlueprintReady" for entities that should actually be ready
    Thanks !
    (I'll answer your other points of this morning tomorrow)
ebon zealot
dawn shell
dawn shell
# ebon zealot What was the source of the issue ?

I wanted to show the level when some additional loading (rendering pipelines, specifically) are done. I added the system that makes the level visible to OnEnter(PlayState::AdditionalLoding) instead of OnExit

#

I also want to stress that I again did a whole bunch of playtesting today and (with my aforementioned hacks), everything is still going great with Blenvy! Thanks a bunch for doing the pre-alpha and being super responsive to critical issues!

ebon zealot
# dawn shell I also want to stress that I again did a whole bunch of playtesting today and (w...

Glad that your experience with Blenvy was good despite the bugs !
I have a pretty good idea on how to solve at least the preloading part (the other has a lot to do with hierarchies & is not so trivial but should be solveable). I really want something as clean & reliable as possible, and some of the random issues have me a bit worried. (Altough, hey we even managed to track down & solve the weird duplicate of blueprint instances issue so anything is possible 😄 )

dawn shell
#

You're in good company here, Bevy itself has about 82 unresolved scheduling ambiguities last time I checked 😄

#

Added the issues. Ping me if I missed any

#

Unrelated: I noticed that the settings in "Limit to" always look the same, no matter what I pick. I assume I cannot override them?

#

The reason I'm asking is because sometimes it's useful to export hidden objects if you need their mesh but don't need it to be visible in Blender because it would be very ugly, e.g. meshes used to generate dynamic colliders or navhmeshes. I do like to keep things from exporting by setting them to not be rendered though, because sometimes I might want to have a camera or some lights in Blender that I use for local previews but don't want to export.
Are these use-cases currently supported? Should I open an issue for that as well?

sly fulcrum
#

is blenvy built for blender 4.1 or 4.2?

dawn shell
#

But in my experience, 4.2. is nicer for exporting stuff in general

#

So you may want to use that

sly fulcrum
#

just wanted to double check cause im getting this error when trying to load my registry file

#
Python: Traceback (most recent call last):
  File "C:\Users\stran\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\bevy_components\registry\operators.py", line 25, in execute
    generate_propertyGroups_for_components()
  File "C:\Users\stran\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\bevy_components\propGroups\prop_groups.py", line 37, in generate_propertyGroups_for_components
    process_component(registry, definition, update_calback_helper(definition, update_component, root_property_name), None, [])
  File "C:\Users\stran\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\bevy_components\propGroups\process_component.py", line 10, in process_component
    component_name = definition['title']
                     ~~~~~~~~~~^^^^^^^^^
KeyError: 'title'

sly fulcrum
#

idk why im the one with all the weird issues

dawn shell
round cove
#

oh its lots of materials now hehe

#

seeing some preload requirements for the new files (just adding them to my asset_loader setup)

materials file materials/Material.003.glb should have been preloaded

dawn shell
dawn shell
#

Oh wait, no, this is a legitimate use-case

#

I change my opinion

dawn shell
ebon zealot
ebon zealot
ebon zealot
#

is asset_server.is_loaded_with_dependencies(asset_id) unreliable on wasm ?

#

Also , is there a way to detect dropped handles: I traced down the issue with preloading to all the material files being unavailable despite clearly having been loaded, so this means between loading their untyped handles & attempting to insert the materials, the handles get dropped ?

dawn shell
dawn shell
#

Emitted when the last Handle::Strong of an Asset is dropped.

ebon zealot
dawn shell
#

So I don't think it's something Wasm-specific

ebon zealot
ebon zealot
# dawn shell yep

Then I think I know why.
Double checking
Oh btw , absolutely not ready for release yet, but in my current experiments, the list of assets is not loaded via the "secondary" gltf loader you added but from a seperate ron file :

ebon zealot
ebon zealot
#

Btw is there some tooling/pattern in Bevy to easilly "wait until this asset is loaded" (thinking of async /await type stuff)

ebon zealot
dawn shell
dawn shell
dawn shell
ebon zealot
dawn shell
#

Nice!!!

#

That's great to hear 😄

#

You fixed it right after I finished the map (15 min ago)

#

So I already wrote literally all preloading boilerplate I need for the jam already 😄

ebon zealot
#

The handles were literally dropped waaay too early when not using hot reload 🤦‍♂️ I keep using hot reload, hence why it never happened to me

dawn shell
#

But nice for next projects!

ebon zealot
dawn shell
dawn shell
#

Hot reload results in my scene crashing most of the time

#

So I'm not running it at all

ebon zealot
dawn shell
#

Hehehehe

ebon zealot
dawn shell
#

Just realized that I missed some preloading, so it would still be good to have the proper behavior

#

Found a supremely fun bug on Windows.

#

If I have a material called "white" and a material called "White", Blenvy cannot export them both because Windows is case-insensitive

#

(So is macOS by default as well FWIW)

dawn shell
dawn shell
ebon zealot
ebon zealot
# dawn shell Just realized that I missed some preloading, so it would still be good to have t...

That is going to take a bit as I am changing the whole pre-loading,
but in the meantime : you can just comment this out :
https://github.com/kaosat-dev/Blenvy/blob/blenvy/crates/blenvy/src/blueprints/spawn_from_blueprints.rs#L364
and un-comment this one :
https://github.com/kaosat-dev/Blenvy/blob/blenvy/crates/blenvy/src/blueprints/spawn_from_blueprints.rs#L807

GitHub

Bevy Code & Blender addon for a simple workflow to add & edit Bevy components in Blender - kaosat-dev/Blenvy

dawn shell
#

When running the game on Windows, this does not matter, as it will load the one material in any case as it is case-sensitive

#

But when running the game on Linux, this will crash, because it will only find e.g. "White.glb" but not "white.glb"

ebon zealot
dawn shell
#

Can you maybe display a warning when two materials have the same name but with different casing?

round cove
#

would have to be file hash names or something I'd imagine to truly "fix" it

#

not terribly fun 😅

dawn shell
#

they would just be white-IONTHPFPNXO.glb

ebon zealot
dawn shell
#

I mean they can could have a simple small hash after their proper name, couldn't they?

#

If you hash the proper name, it won't change on re-exports

#

Otherwise, I'd be very very upfront with the user that what they just exported may crash their game

ebon zealot
dawn shell
#

I'd be surprised if no one else ran into this during the next jam

#

But on the other hand, that's about 7 months away 😄

round cove
#

fix it when more people are using and run into it 😆

#

its deff not "polish" time for blenvy anyway imo

#

its "first release"

dawn shell
dawn shell
#

But yeah, leaving a warning or something like that is probably enough for now.

ebon zealot
ebon zealot
dawn shell
#

Never tried it, but I just assumed it had to be

#

But then again, it is Blender

ebon zealot
ebon zealot
round cove
#

the world of wacky waving arm flailing inflatable blender 😆

dawn shell
dawn shell
#

Supremely proud of this one

#

@ebon zealot I added you to the special thanks in the description, hope that's fine for you 🙂

#

Thank you so much again for hotfixing all issues we had ❤️

sly fulcrum
dawn shell
#

Thanks for checking it out!

ebon zealot
ebon zealot
#

Soo, big changes release before my brain melts:
pushed on the Blenvy branch, & updated zip :
big overhaul, cleanup & fixes to the assets system

  • now the blender side exports .meta.ron files in addition to the gltf files
    • these ron files contain the list of assets that are then preloaded on the Bevy side
    • removed the double loading of gltf files on the Bevy side, replaced with use of the new metadata/asset files
    • addedbevy_common_assets/ ron as dependency for the file loading
    • big cleanup & partial restructure of the spawning steps
    • fixed premature removal of the BlueprintAssetsLoadState component that was leading to missing material gltf files in
      setups without hot reload
    • added OriginalVisibility component & logic to correctly reset the visibility of entities to what they where before
      the blueprint spawning
    • fixed a few not so visible issues with some components staying around after the blueprint instance has become "ready"
    • moved a number of component insertions to the new "get the assets list from the meta file"
    • also, loading speed feels faster ! (thanks to now loading the gltf files only once)
    • minor various tweaks & cleanups

TLDR: assets lists for preloading are now written alongside the gltf files, it works great (on my end 😄 ) even on wasm
@dawn shell & @round cove if you want to take this for a spin, don't forget to remove your blueprints & level folders as they need to be regenerated with the new additional files !

dawn shell
#

Glad I no longer have list out all of my assets for preloading, haha

ebon zealot
#

Oh and this should make you happy @round cove (well not just you but still), failure to load materials will not panic anymore 😁

dawn shell
#

I won't touch the jam project for now, otherwise I will notice things I could have improved before submission. But I'll appreciate the changes when I get around to porting my personal projects to Bevy 0.14 🙂

#

I hope I described the issue clearly. I noticed that it's hard to write this in a way that is not overly confusing 😅

ebon zealot
#

@sly fulcrum my message my have gotten lost in all the other messages, but I haven't forgotten about your issue: if you could send me your registry file I could take a closer look & solve it 🙂

sly fulcrum
ebon zealot
# sly fulcrum ``` Python: Traceback (most recent call last): File "C:\Users\stran\AppData\Ro...

Hi !
So I tested out your registry file & it worked fine
Then I noticed your error log , & triggered an error in Blenvy to double check:

  • you are still using the "old" add-on 🙂 (visible because the error you are seing is in 4.2\scripts\addons\bevy_components if it was Blenvy it would be 4.2/scripts/addons/blenvy/add_ons/bevy_components
  • so please make sure to use the Blenvy UI , not the old one 🙂 ie the one that is labelled "Blenvy" (see screenshot)
  • just to make it clear: the Blenvy add-on replaces the old ones, you don't need them at all
sly fulcrum
dawn shell
#

@ebon zealot I forgot to mention something. While developing crazy bike, we noticed that Blenvy generates a ton of info messages, 99% percent of which should imo be debug messages. I didn't report it yet because I assumed that you did that for testing / alpha purposes and would change it anyways, but I decided I should better let you know 🙂

ebon zealot
coral anchor
#

Could we get a way to tell the blender exporter to not automatically add a material if the object lacks one?

I have a component that tells a system to automatically generate a dev texture material for a given object. However, blenvy exports automatically add StandardMaterial if the scene object lacks one. I can somewhat ignore this by adding a material in blender that's entirely transparent but I don't particularly think this is the right way to do things, so an actual way to mark an object as not needing a material would be nice.

#

Other than that, Blenvy is really cool so far! Thanks for your hard work!

coral anchor
ebon zealot
ebon zealot
ebon zealot
coral anchor
#

Yep

sly fulcrum
#

Im getting another error when loading the registry, ive checked that im using the correct plugin. heres the error

Python: Traceback (most recent call last):
  File "C:\Users\stran\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\blenvy\add_ons\bevy_components\registry\operators.py", line 24, in execute
    context.window_manager.components_registry.load_schema()
  File "C:\Users\stran\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\blenvy\add_ons\bevy_components\registry\registry.py", line 202, in load_schema
    with open(component_settings.schema_path_full) as f: 
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\windows\\Rust\\bevy\\strange-spaces\\game\\game\\assets\\registry.json'

i think the issue here is the double \ in the windows path but im not sure

dawn shell
sly fulcrum
#

i hadnt noticed that

sly fulcrum
#

and i cant manually edit the path, not really sure what the fix is here

dawn shell
sly fulcrum
#

agreed

dawn shell
#

Hack: what happens when you manually create the game subdirectory and friends as presented?

#

If that works, we know that the double \\ are at least not a problem

sly fulcrum
# dawn shell Hack: what happens when you manually create the `game` subdirectory and friends ...

moving things into another game directory so that it looks like game/game i get the following error

Python: Traceback (most recent call last):
  File "C:\Users\stran\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\blenvy\add_ons\bevy_components\registry\operators.py", line 24, in execute
    context.window_manager.components_registry.load_schema()
  File "C:\Users\stran\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\blenvy\add_ons\bevy_components\registry\registry.py", line 202, in load_schema
    with open(component_settings.schema_path_full) as f: 
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\windows\\Rust\\bevy\\strange-spaces\\game\\game\\game\\assets\\registry.json'
#

here is what my directory structure and blenvy setup look like

#

setting the root folder to strange-spaces has the same effect

#

but im pretty certain this is actually the game/game problem and not an issue with \\, i tested it in the terminal and it works there

dawn shell
round cove
#

:queues up xzibit:

tender oyster
#

Hi all. Thanks for developing blenvy!!
I encountered the bug above too. Changing the registry path doesn't work properly. When creating registry path it doubles folders. It looks like if we change the registry path and root/assets path a couple of times or in specific order it breaks and button "reload registry" shows FileNotFoundError and incorrect registry path with doubled folders.

Also, It would be nice to have a feature(button or buttons) that resets blenvy settings.

coral anchor
#

What's the Blenvy Avian workflow like by the way if anyone has an answer, do I just attach a collider component and manually enter information, or?

#

Nvm, that does seem to be the correct workflow, to add ColliderConstructor

round cove
coral anchor
round cove
coral anchor
#

Ah, I probably need to do apply scales in blender maybe yeah

#

Yep, that was it

#

Welp, off to add a skybox and get my character controller up and running again from another project

round cove
dawn shell
#

I think I may submit a PR later today to Blenvy to show how this is done

ebon zealot
ebon zealot
sly fulcrum
tender oyster
#

Registry path bug1 steps:

  1. Crate default blender project. Do not save the project.
  2. Set registry path and press reload registry button. See file not found error.
  3. Set root project folder. Button reload registry still doesn't work.
  4. Set asset folder. Button reload registry doesn't work.
#

Registry path bug2 steps:

  1. Create default blender project and save the project.
  2. Set registry path. Button reload registry works.
  3. Set the project root path.
  4. Set the project assets path.
  5. The button reload registry stopped working. Error shows that registry path is incorrectly constructed and contains duplicate folder.
  6. Setting the registry path again doesn't solve the issue.
dawn shell
ebon zealot
sly fulcrum
tender oyster
#

To reproduce bugs just use any bevy project (code side) with the default folder structure that contains the registry file.

The bug is on the blender side.

Then create a new blender project with the default cube and follow steps to reproduce bugs.

sly fulcrum
#

forgot to include screenshot of the full directory structure

ebon zealot
sly fulcrum
ebon zealot
#

Blenvy has "logical" defaults that most of time should not need changing: the default path to the registry in Blender is also the default path for the registry export in Bevy: normally you do not even need to reload it

sly fulcrum
#

ok but theres no way to manually change the paths so im not sure what the fix is

#

start a new file and dont tough the registry default i guess

tender oyster
#

Bug2 steps with screenshots:

  1. Bevy project (code side) is ready. Registry file location : "D:\TempProject\project\assets\registry.json"
  2. Create new blender project with default cube. Save the project. Location: "D:\Test6.blend"
  3. Set registry path: (see screenshot 1)
  4. Press reload registry. See error that file is not found (see screenshot 2). File is not found because blenvy additionally inserted folder "assets" after "D:\" and contracted wrong registry path "D:\assets\TempProject\project\assets\registry.json".
  5. Set root and assets folders path: (see screenshot 3)
  6. Press the reload registry button again and see the error: (see screenshot 4). On the screenshot we see that the registry path constructed incorrectly and contains duplicates. But the specified registry path is correct: (see screen 5)
  7. Attempt to set registry path directly again doesn't solve the issue. The error on screenshot 4 is shown after pressing reload registry.
tender oyster
#

How to fix this?
Possible solution 1: Maybe just hide possibility to specify registry path directly. User only needs to specify project root directory and registry file will be found automatically. Such fix should prevent braking new blender projects. Broken project can be fixed by resetting blenvy settings.
Possible solution 2: Specifying root/asset folders path should not affect registry path. Registry path should only be specified directly.

sly fulcrum
#

Quick update, creating a new project and not touching the registry default worked

tender oyster
bright harness
#

How do I add a collider to a cube in Blenvy?
I'm learning the foxtrot and bike-game projects, but I'm stuck on Blenvy. I cloned the bike-game project and I'm trying to figure out how to build a level with models.
I opened the bike-game.blend file, added a cube, and saved it. The cube spawned well in the game, but how do I add a collider to the cube?
I don't get how avina integrates with Blenvy.

dawn shell
#

I can send you a screenshot later

dawn shell
dawn shell
dawn shell
bright harness
dawn shell
sly fulcrum
#

is hot reloading a thing yet? i know it was being worked on at some point

bright harness
dawn shell
dawn shell
bright harness
#

if you don't exec cargo run on project root path, there is a panic

#

If blender language is Chinese, there is a error

dawn shell
dawn shell
#

@ebon zealot I'll write a little Avian tutorial as soon as the quickstart is merged, as I want to build on that.

tender oyster
#

If we add avian ColliderConstructor to blender object (not mesh of an object) program will start with an error about the missing mesh handle. Maybe blenvy should prevent such situations.

round cove
#

I don't know that its blenvy's responsibility to integrate with all third-party crates

dawn shell
round cove
#

having said that, I do wonder if there's a way to extend blenvy's capabilities. like an avian blender lib of empties or something with pre-applied components

dawn shell
#

If creating warnings in Blender were easy, I say we could print something as a little heads-up if you added dynamic colliders on a non-mesh, but since I've heard that it's not trivial to display such a message, I'd leave it

dawn shell
#

It would be nice to have a menu for spawning pre-made colliders or even inserting them directly as children

#

I want to outline the implementation that I think makes the most sense in the Avian writeup with a little note saying something like "In the future, Blenvy will be able to do this for you".

round cove
#

I wouldn't commit to anything ahead of time

#

like scheduling future work that nobody has committed time to implementing sort of thing

#

feels like just added stress

dawn shell
#

Fair enough

#

In any case, the approach outlined should be a good reference for a future implementation 🙂

round cove
#

do people use the built-in asset browser or is there an extension that has a better one?

dawn shell
#

If there's a good tutorial on it, I'd love to see it 😄

#

I assume you mean the thing that shows the assets you define by doing rightclick -> mark as asset, right?

dawn shell
#

Yeah exactly

#

Maybe it's a skill issue from my side and the whole world loves it, I wouldn't know 😄

round cove
#

I'm still fairly early in my blender journey so not sure 😆

#

yeah this person just has the browser open in a panel, so I assume an avian lib could show up there

dawn shell
round cove
#

yeah my thought process was "if we can integrate with blender, then it doesn't require extra code maintenance and feels natural to blender users"

#

so a .blend file with avian components attached to empties and such

#

then use that as a library, shows up in asset browser

dawn shell
#

But that would probably require more setup than just adding the addon

round cove
#

Add menu is cool too, but probably a different extension. blenvy-avian-addon

dawn shell
#

(Idk if an addon can shit its own assets)

dawn shell
round cove
#

yeah more setup, but avian probably doesn't belong first-class in blenvy right? otherwise where's the line for third-party crate inclusions?

dawn shell
#

I think a line can be drawn at "people care enough to add support" 😄

#

Physics / collider support is supremely important for any editor

round cove
#

yeah I mean if y'all are ok with the maintenance burden of that

dawn shell
#

In the meantime, I don't see many other third-party plausibly making sense in Blenvy. Maybe some navmesh crate? But in that field there are imo not clear winners yet, while for physics your options are realistically Rapier and Avian. And a rapier integration is not happening soon because of a general lack of Reflect in there, so the only physics integration that makes sense is Avian

#

At least, that's my motivation for pushing for Avian support in Blenvy directly

round cove
#

one thing I'm not sure of is how blenvy would support api changes in avian. those feel like projects would have distinct versions.

#

I guess everything would be reflected from the current avian crate for all menus?

#

but not sure how you attach the "right" empty without a hardcoded list

dawn shell
dawn shell
#

I think you kinda need to use a certain component layout

round cove
dawn shell
round cove
#

oh you mean an Add menu that just adds a Component

#

I was thinking it would add the relevant empty as well, for viz purposes

dawn shell
round cove
#

yeah, so how do you line up empty -> component without a hardcoded list that requires a specific avian version?

dawn shell
round cove
#

yeah, hence the sync upgrade. "when you upgrade blenvy you have to upgrade avian"

dawn shell
#

At least not without a lot of complexity like starting the app in rust and then analyzing the registry.json in blender

round cove
#

its fine for one crate, not for 5+

dawn shell
#

tbf you have to do that anyways for every new Bevy version

dawn shell
tender oyster
#

Bevy will have its own physics plugin. And it could be Avian or Rapier. If additional support for external physics plugins is added it probably could be reused later when bevy physics is ready.

dawn shell
#

Well, enjoy the read @ebon zealot when you get around to it 😄

dawn shell
#

But Avian has a decent chance on either being upstreamed (in years) or heavily influencing a first-party solution imo

dawn shell
#

And then you just select which version of Avian you're using?

round cove
#

yeah physics upstreaming is going to be a long time. I'd imagine we'll have editor before upstreamed physics

dawn shell
ebon zealot
ebon zealot
ebon zealot
dawn shell
ebon zealot
ebon zealot
ebon zealot
ebon zealot
round cove
#

oh I saw something about how collections can be assets, so thought it could turn out "easy"

#

now that I say that I haven't ever looked for any of my own collections as assets though 😆

ebon zealot
dawn shell
ebon zealot
round cove
#

lolol I quoted it! 😆

#

working in blender with blenvy really feels like it opened up 3d bevy dev. absolutely amazing

ebon zealot
# round cove now that I say that I haven't ever looked for any of my own collections as asset...

Multiple blend file workflows are based around collections , and it works quite well (I have used it a lot for some of my own game experiments):

  • you add your asset file (for me purely Blenvy libraries)
  • and you can drag & any blueprint you need into your other blend file (levels usually)
    it feels really intuitive, and bonus, when you update your asset file(s) they get automatically synched !
ebon zealot
# round cove so a .blend file with avian components attached to empties and such

Hmm that is not a bad Idea at all, only issue is , to have the components you would need a registry.json that has them... hmmm , multiple registry files for a more modular approach ?
hmmm that would also solve a tiny annoying issue I have: some components should ALWAYS be present in Blenvy, but I cannot always rely on the user exported one to have them ... wheels turning in brain

ebon zealot
# dawn shell Physics / collider support is supremely important for any editor

This ! In theory they could (should ?) even be abstracted away: the Blender side might not need (although that comes with drawbacks) about the specifics of a Physics component, and just generate proxy components, and the Bevy side could have feature flags (or specific crates etc) for Avian/Rapier & do the conversion to the actual components there

ebon zealot
ebon zealot
# round cove working in blender with blenvy really feels like it opened up 3d bevy dev. absol...

Thanks a lot for the kind words 🙂
ohhh btw, I have not updated the zip file , but the blenvy branch has a few upgrades you might appreciate: failure in the gltf export (so the underlying one from Blender), will NOT leave behind temporary scenes or renamed objects with __bak suffixes anymore, and you will still get a nice traceback : aka no more scene corruption when there is a Blender export error 🙂

#

A propos zip file: I want to switch to a normal alpha release asap, because for the most part I feel things are stabilising & improving enough
Things missing before that

  • save & load functionality (currently working on it)
  • additional docs & co
  • working examples
  • cleanup (not a 100% one, I would rather just have it out in a more useable way rather than a perfectly clean state)
round cove
#

ooh, actual alpha phase, excite!

dawn shell
#

@ebon zealot I added the Avian tutorial. Took a bit longer than expected, haha

#

PR is now ready

dawn shell
#

I noticed some things while writing all of this:

  • Apparently Blenvy does not work when Blender is set to Chinese according to @bright harness. I can read enough Chinese to test this out if you're curious @ebon zealot (although 我的中文很差)
  • Exporting a completely empty World and running it in Bevy will crash because the GLTF is malformed as it lacks any nodes
  • Support for bitflags is still suboptimal, but I still don't know if there's anything we can really do about that without some supreme hacks in the registry.
bright harness
#

The image select_mesh.png is missing here。

dawn shell
dawn shell
open steeple
#

@dawn shell collisionlayers and sensors deserve more than just a mention considering how useful they are
you can make a short section for coin collection and that should be enough to show how both work

tender oyster
#

Thanks for the tutorials.

dawn shell
dawn shell
#

@ebon zealot I'm quite happy with the tutorial now after working some feedback into it. I won't expand it further for the moment, so feel free to merge it if you also think it's fine like this 🙂

ebon zealot
dawn shell
#

GitHub is probs easier 🙂

ebon zealot
# dawn shell GitHub is probs easier 🙂

Ok, will do !
Btw your Avian + Blenvy tutorial made it also even clearer that I am going to add some boilerplate into Blenvy, to make it ...less boilerplate heavy for users 😄

dawn shell
#

Just don't make me redo the screenshots, that would take too long 😄

dawn shell
ebon zealot
ebon zealot
dawn shell
#

I meant Wireframe

#

whoops

#

Last time I checked, the wireframe generated this way did not result in a Mesh on Bevy's side due to the missing faces, so there should be no overhead from this.

ebon zealot
ebon zealot
dawn shell
#

So show 00111010 instead of 28 or whatever

ebon zealot
dawn shell
#

Maybe you could convert it to a list of checkboxes?

#

Bit ugly, but at least usable

ebon zealot
# dawn shell Maybe you could convert it to a list of checkboxes?

I am curious : what would each of the checkboxes represent ? I guess each of the bits
and like the other literal lists ? But without the option to add/ remove items to the list .
Wait , been a while since I used bitflags in Rapier (never tried in Avian): they have a set size right ?

dawn shell
#

It would be supremely nice if each checkbox could say the name of the layer it represents. In Avian, you can use names at compile time like this:

#[derive(PhysicsLayer)]
enum GameLayer {
    Player, // Layer 0
    Enemy,  // Layer 1
    Ground, // Layer 2
}

// Player collides with enemies and the ground, but not with other players
let layers = CollisionLayers::new(GameLayer::Player, [GameLayer::Enemy, GameLayer::Ground]);

docs

ebon zealot
dawn shell
#

But I have no idea how to export that information

round cove
ebon zealot
dawn shell
dawn shell
#

@ebon zealot ping me when the quickstart feedback has landed on GitHub 🙂

ebon zealot
# ebon zealot Good point

Then again should this not be a first class feature in Avian ? I mean the mapping between bitflags & their names

open steeple
#

godot ^

ebon zealot
open steeple
#

i'd prefer some kind of a dropdown list for the premade ones though

round cove
#

I don't think you can get the nice names without a secondary UI. The mask fields would still need to be accessible, not replaced by custom

dawn shell
#

Hmm, that should actually be easy if you register_type the GameLayer of the example

open steeple
#

i mean, i have the whole CollisionLayers as a const

dawn shell
#

Since the order of the enum variants is just binary counting up the layer bits.

open steeple
#

so each enemy has the same thing

open steeple
#

so it'd be closer to how unity has it, just a dropdown with one of the options

dawn shell
open steeple
dawn shell
dawn shell
#

So I would instead push for generic bitflag support first

round cove
dawn shell
#

I will not do so in the future then 😄

dawn shell
ebon zealot
open steeple
#

most of the stuff that needs layers would probably be in prefabs so if all environment only needs to be default then yeah, basic bitmask isn't a bad solution

dawn shell
#

This one makes me nervous, because it would invalidate most of my screenshots, as they often show the components on the side 😅

ebon zealot
dawn shell
ebon zealot
dawn shell
#

I mean the N menu

#

this guy

round cove
#

I can see components when I click on collections

dawn shell
#

(where apparently the registry.json did not get loaded automatically hmm )

ebon zealot
round cove
ebon zealot
dawn shell
ebon zealot
dawn shell
#

Because often, I care about the red building, so I click on the red building visible in my view port

dawn shell
#

Not that it makes that big of a difference, mind you

round cove
#

that seems like a per-case benefit

dawn shell
round cove
#

like if you aren't using collections as collections, but rather single object wrappers

ebon zealot
dawn shell
#

My point is that for the quickstart, it seems like that is the more ergonomic approach

round cove
#

maybe, but a collection is the unit of abstraction right?

#

like you spawn collections, not objects or meshes

dawn shell
#

But I'm fine with changing it in the quickstart for making this distinction clear

#

Just wanted to note the slight decrease in ergonomics, is all

ebon zealot
dawn shell
ebon zealot
# dawn shell Oh, that I did not know

I discovered that last week 😂 the perks of being able to set components on collections directly!
You can even change the values of components of all blueprint instances like that without leaving the level scene !

round cove
#

TIL lol

dawn shell
#

Although also a bit of a footgun since it seems like I'm overriding this for the current instance

#

But it's hidden enough, so eh

ebon zealot
round cove
#

oh sweet that works

#

"a-different-value" is the instance, "place_item" is a spawned blueprint with the default

#

I had all my colliders on collections until I started using the FromMesh variants

ebon zealot
#

I need to add more information about this in the docs, the overriding was already present pre-Blenvy but it was obscured by the need to create empties named xxx_components for blueprint level components

ebon zealot
# round cove oh sweet that works

Your "on click" observers also remind me to experiment again with creating UIs using Blenvy: flat meshes, text etc from blender, a few systems and components and it * should* be possible to create something basic but functional without too much problems

round cove
#

right now I'm dispatching via bevy_mod_picking and a custom component that uses a component hook to set up the click handler (which is to say, the same thing I've been doing with the others lol)

ebon zealot
ebon zealot
round cove
#

oh yeah, that's somewhere in the stream

ebon zealot
round cove
#

code is really simple for that one. possibly not even worth watching the stream lol. Just an observer and a component as usual.


fn test(
    trigger: Trigger<BlenderOnClick>,
    mut local: Local<u8>,
) {
    info!(?local, "old");
    *local += 1;
}

#[derive(Reflect, Debug)]
#[reflect(Component)]
struct BlenderOnClick {
    observer_name: String,
}

impl Event for BlenderOnClick {}

impl Component for BlenderOnClick {
    const STORAGE_TYPE: StorageType =
        StorageType::SparseSet;

    fn register_component_hooks(
        hooks: &mut ComponentHooks,
    ) {
        hooks.on_add(
            |mut world: DeferredWorld,
             entity: Entity,
             _id: ComponentId| {
                let observer_name = world
                    .get::<BlenderOnClick>(entity)
                    .unwrap()
                    .observer_name
                    .clone();

                world.commands().entity(entity).insert(
                    On::<Pointer<Click>>::run(
                        move |mut commands: Commands| {
                            info!(
                                ?observer_name,
                                "on click"
                            );
                            commands.trigger(
                                BlenderOnClick {
                                    observer_name: "test"
                                        .to_string(),
                                },
                            );
                        },
                    ),
                );
            },
        );
    }
}
#

its a prototype, I might switch to enums for the click events and whatnot so as to dispatch the events themselves right from the click trigger.

#

but it works with strings so, so far so good

dawn shell
#

@ebon zealot I addressed the two open comments

#

Gonna go to bed now. If there's anything else that needs addressing, let me know and I'll fix it tomorrow 🙂

ebon zealot
dawn shell
#

So recently this mipmap generator got released, with some impressive benchmarks [here](#crates message).
According to its docs, you should not do this at runtime, but modify your gltfs directly. One such example is this little script that uses kram.
Looking at the script, it's clear that the textures are being stored outside the gltfs.
Does someone here know which exporter settings I have to set to fiddle with to get gltfs without embedded textures, but instead references to external files?

ebon zealot
ebon zealot
dawn shell
#

Huh, I guess I also have to do that for performance?

#

But then it becomes a tradeoff with file size for Wasm

#

hrmm

#

meh

#

and that hammers it home

ebon zealot
dawn shell
#

Now I wonder if this is a Blender or a glTF limitation

#

Oh come on

#

What is wrong with you
Angry_Eye_flippedAngry_Eye
smirk3d_flippedsmirk3D

dawn shell
#

So I guess the workflow for having nice textures is

  • Export to glTF
  • Compress all textures and generate mipmaps
  • Convert textures to ktx2
  • Change MIME type in glTF to ktx2
  • Pack glTFs into glbs
#

@ebon zealot do you think Blenvy should one day be able to do this? Or is this the realm of hacky third-party scripts?

tender oyster
dawn shell
ebon zealot
# dawn shell <@789848437582725140> do you think Blenvy should *one day* be able to do this? O...

Honestly too early to tell, it seems relatively easy to do , but it should not need to be done in the first place 😦
I more than once thought about forking Blender's gltf exporter too, but that is not a viable long term option, as it would need to be permenantly maintained to at least keep feature parity with the standard exporter, new Blender features etc
Feel free to toss this onto Github 🙂
Btw, this might interest you : https://forum.babylonjs.com/t/glb-vs-gltf-size-performance-advantages/45347/8

Babylon.js

Draco and also MeshOpt both reduce the payload of the geometry/animation, but it shouldn’t make a difference between GLTF and GLB (ignoring the base64 embedded version). EDIT: Actually, I’m not sure what the implications of gzipping Draco or MeshOpt compressed data. If the GLB will be served compressed, that might be a consideration.

tender oyster
#

I have encountered a bug. Saving blend file using the save button didn't export gltf automatically and the button also was switching scene from main to library. I discovered that a couple of objects had a material without a name. Removing material from objects solved the issue and now the save button exports gltf and do not switches scenes anymore.

rich helm
#

Hey! Thanks for your awesome work on this tool. I started setting this up in my own project today, and was able to get started very easily with Jan Hohenheim's quickstart (thank you!). Now I'm trying to set up the multi-file workflow to make the structure nicer. I'm running into an error, though:

I'm building a modular cave level design kit in a file cave_kit.blend. I've for example got a Collection called Rock_1x1 there. It gets correctly exported into assets/blueprints/Rock_1x1.glb (and meta file). My level file, however, tries to load from path assets/./Rock_1x1 instead of from assets/blueprints/.... The relative path for the linked collections in blender does show up correctly, but for some reason the .glb file has the path as just ./Rock_1x1. What could be causing this issue?

#

Also note that it's trying to load Rock_1x1 instead of Rock_1x1.glb

#

If I manually fix the loaded level gltf file to have the correct paths (by adding the blueprints directory and the file extension) everything works.

dawn shell
#

Sounds like a bug in the Blender addon then

dawn shell
rich helm
rich helm
#

Ehh, now that I quit Blender and started it through the terminal it suddenly worked. The relevant change the auto-export now made was to actually write the blueprint assets into the level file's meta.ron. Previously this was just an empty array in the file, now it includes the blueprint links. Must've probably been some bit somewhere that got refreshed with a restart.

Can't believe I fell for the "have you tried turning it off and on again" case.. 😅

#

Another option is that there might have been a silent error that caused the auto-export to fail somehow, which caused the exported files to be at least partly out of date. 🤔

steel vortex
#

What does this mean? I'm still on the old workflow. Using bevy_gltf_components = "0.6.0", bevy_registry_export = "0.4.0", bevy_components: 0.4.2 and gltf_auto_export: 0.16.1.

#

When I was using a previous version of glft_auto_export as well as now it is EXTREMELY brittle. I set it up, then I change something, save and it tries to export (with above error message). Then after I tab back and forth into Blender again and change something in the scene it no longer tries to save. This is across two different versions of Blender as well. I can't be the only one experiencing these issues with it?

#

This setting doesn't seem to disable it either

dawn shell
#

Blenvy is way more stable in my experience than the old workflow stuff

dusky valley
#

Hey! I'm just taking a look at different crates available for bevy. I am kind of a game dev noob, but I have interest in learning more blender because I think it's a promising tool for 3d game development. I was wondering if blenvy was a good option for 2d game development with bevy as well?

sly fulcrum
#

I mean you can technically do 2D stuff in blender, so it could work but as blender is more aimed at 3D that’s where the tooling is the best you might want to check out the LDTK plugin if you’re aiming at 2D

round cove
# dusky valley Hey! I'm just taking a look at different crates available for bevy. I am kind of...

blenvy is good for anything that can export from blender, especially to gltf. This could be absolutely be used to build a "2d" game in a 3d world by locking off one of the axis and using an orthographic 3d camera etc, but so far I don't know anyone that has done this yet with blenvy and it would be a specific style choice that moves away from "flat 2d sprites".

I know astortion is a 2d game that uses a blender workflow for generating curves, which theoretically could be a blenvy workflow. but again, there are no examples of this that you could readily use afaik.

open steeple
steel vortex
coral anchor
#

Clone the blenvy repo, go into the tools folder, zip the blenvy folder, and install it in blender

dawn shell
steel vortex
#

Oh there was a pre-release just below the other one. Must have missed that.

dawn shell
rich helm
#

How are people solving entity references in their Blueprints? I see there’s an issue and a PR related to it, but it uses strings to identify references. It would be great to have something where you could select any object in the current collection/scene and the entity link reference would be hooked up on the Bevy side.

I could set up custom construction and link ups for the specific components in my project that currently need entity references, but it seems like a common enough use case to warrant a proper flow.

dawn shell
#

It's suboptimal, but luckily, I need it very rarely.

#

Oh, there's also the option of never referencing entities in Blender and spawning the "kinded" entities purely through code.

rich helm
#

Thank you for answering. Yeah, those are the solutions I’ve considered as well. They all feel like workarounds though, so I guess I’ll have to think of the problem a bit more. 😄

dawn shell
rich helm
#

Yeah, that’s true. Everything will probably change with BSN as well… let’s see how it ends up solving entity references

steel vortex
#

Really think the quickstart makes things a lot clearer for blenvy! However I'm getting the following when trying to reload the registry for the first time.

dawn shell
#

Does it work when you reload it a second time? Maybe after closing and opening Blender?

steel vortex
dawn shell
#

Maybe I should add "close and reopen Blender juuuuuuust to be sure"

steel vortex
#

Just a speculation but I had to uninstall the older addons, so maybe there was something lingering there that required a restart?

dawn shell
steel vortex
#

Does this show up even if you haven't installed any addon before? Just curious.

steel vortex
#

I assumed it meant I was overwriting a previous addon.

dawn shell
#

Pretty sure it's there all the time to ask what to do in case of conflicts

steel vortex
#

Ah ok so maybe that's the normal addon install flow. I've always installed addons from the preferences window so I hadn't seen that window before.

dawn shell
#

The Blender people are doing a huge overhaul to how addons work

#

Look, there's an official place to download them from now 😄

dawn shell
round cove
tender oyster
#

https://github.com/bevyengine/bevy/pull/6042

Will this PR allow to easily register components from external libraries and set these components in blender blenvy?
As I understand blenvy currently only supports avian and rapier external libraries and there is no simple way for a user to add support for example for tnua or dolly.

GitHub

Objective
The goal with this PR is to allow the use of types that don't implement Reflect within the reflection API.
Rust's orphan rule prevents implementing a trait on an external ...

rich helm
#

I have blueprints defined in one file and the level in another. How do I override the component values of a blueprint instance in the level? As the blueprint is from a linked file, the component field just says "Disabled: can't edit this property from a linked data-block."

tender oyster
# rich helm I have blueprints defined in one file and the level in another. How do I overrid...

Probably this is not supported at the moment. It would be nice if we could override components of "link"ed collections. Something similar to blenders "library overrides" feature that allows to edit linked objects (https://m.youtube.com/watch?v=7ho73nfgvy0).

Such a feature would allow to have a car collection with car component in the car file and 10 instances of the car with additional unique components (red_car, blue_car) in level file. There is also a blender plugin that allows editing base car file directly from level file and propagate changes to all car instances without reopening the level file. Check video for more details.

Edit Linked Libraries is an awesome feature that solves several problems with Blender's instance and collection instance mechanisms, it's awesome to work with and I show you how it will improve your workflow in this tutorial.

#blendertutorial #blender #linkedlibraries #instances

▶ Play video
dawn shell
# tender oyster https://github.com/bevyengine/bevy/pull/6042 Will this PR allow to easily regis...

The avian support is currently nothing special-cased at all. I just made a PR on Avian itself that made sure that colliders are indirectly Reflect through ColliderConstructor 😄
All third-party libraries are supported, as long as their components are Reflect. If they are not, you will have to upstream a PR (people are usually happy about this kind of fix) or, as a workaround, copy the component definition into your project, make your copy Reflect, and then spawn the real component when your copy is added. Use a hook or observer for that.

#

The linked PR won’t change this by much. You still need to create local copies of the component in question and male them Reflect.

#

At that point, you should still seriously consider upstreaming your changes to the relevant library.

dawn shell
rich helm
#

I tried adding a component of the same type onto the instance in the level file, but nothing happened. I guess I could do it in code, but I’d like to do as much of this in Blender without workarounds.

dawn shell
rich helm
#

I’ll give it another go tomorrow, at home already. It might be that I did something wrong, I just assumed it was unimplemented as nothing happened 😄

dawn shell
rich helm
#

Yes

#

The collection that is marked as an asset

round cove
#

set in blender and saw the override in my running bevy app

#

when you add an instance, it looks something like this, with the "original collection asset" nested beneath the "instance collection". Setting new values on the top "instance collection" worked for instance-level overrides

tender oyster
# dawn shell It's supported 😄

Blender was showing errors when I tried to override components of linked collection that is located in a separate file. I'll try again.

dawn shell
rich helm
#

I’ll give it a proper go tomorrow. Knowing that it should work gives me enough hope to try 😆

tender oyster
# dawn shell Huh, maybe doing it across files is buggy

There is also a difference between local "collection instance" and copies of "link"ed collection. "Collection instance" doesn't work with "library overrides" and we can't for example have instances with different materials. "Link"ed collection from separate file works with "library overrides" and we can override parts of an instance for example have 10 car instances with overridden/changed wheels and materials.

dawn shell
ebon zealot
#

Sorry for the lack of replies the past few days. Been feeling under the weather. Will reply more soon.
Also , releasing the alpha at the end of the weekend, no matter the state of things. (it is a first alpha after all), and going to be keeping the version numbers for the Bevy & Blender side in sync so there is no confusion about which version works with witch 🙂
Edit: just to be clear, that is what is going to be the case for all future releases going further

ebon zealot
dawn shell
#

Everything else works exceptionally well now imo

ebon zealot
dawn shell
#

I have not tested the following, so I cannot comment on them:

  • anything involving armatures
  • working with multiple blend files
  • overriding components
ebon zealot
dawn shell
#

I was not aware you tackled this specifically 😄

#

I could try updating Crazy Bike and seeing if it works without the hacks

#

Oh, I rememebered something small. When I'm in a scene with a camera and press numpad 0 to "see" through that camera, saving the scene causes me to exit the camera view. That also happened with the old workflow.

ebon zealot
dawn shell
ebon zealot
dawn shell
#

I guess for now I'll just have to disable Blenvy for when I'm working on first person animations

ebon zealot
ebon zealot
dawn shell
#

Haven't tried it with Blenvy though

ebon zealot
dawn shell
#

I consider that workaround unintrusive enough to not be too annoying 🙂

dawn shell
ebon zealot
#

Btw @dawn shell do you remember the issue a while back with the blender_manifest.toml when installing the zip on 4.2 ? It was breaking the add-on from the get-go (complaining about bad paths), and I cannot for the life of me reproduce the issue (I want to have a clean 4.2 extension so this is needed)

dawn shell
#

Should I try to reproduce it?

ebon zealot
# dawn shell Should I try to reproduce it?

Yes please !
adding back the manifest, creating a fresh zip file , and installing it in 4.2 (after removing the previous Blenvy if any), did not give me errors, altough I had been able to reproduce it previously

ebon zealot
ebon zealot
ebon zealot
ebon zealot
steel vortex
dawn shell