#Blenvy
1 messages · Page 3 of 1
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.
Damn, hierarchy issues are absolutely the worst 😦
But that is odd, that would imply some hierarchy change as part of the gltf export
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
Note that these multiple meshes don't exist on the Blender side, as Blender supports multiple materials per mesh. The multiple meshes only exist in the GLTF and in Bevy. Maybe that's related?
That is my fear, yes , but, looking at your log for example, there does not seem to be a redundant target object for the MaterialInfos
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)
Ok, this at least gives me enough to go off of:
- a single object with multiple materials
- random applying of materials
- MaterialInfo on the parent of meshes
Plus, everything relevant should be part of the repo at this commit: https://github.com/Bevy-Jam-5/bike-game/tree/1551acc218c80c2854650f3f7e408816a9272022
Actually, let me commit my changes after producing said log.
I'll take a look early tomorrow, brain-dead tired , sorry Jan
If you find more information so that I can narrow it down to very simple, easy to reproduce setup, don't hesitate to share, thanks 🙂
This is right after producing the log: https://github.com/Bevy-Jam-5/bike-game/tree/a6e344540911f4b186fc666bdacf100e5ab939cf
No worries! At least I know now that in the worst case I can use a single material per object and it will work. Changing all models will be quite time-consuming, but at least there's a workaround in case we can't fix it in time 😄
I am (overly ?) confident I can solve it tomorrow 😄
I just had a thought, could you please just share a screenshot of one of your meshes with multiple materials please ?
In Blender or Bevy?
Blender
Sure, let's take the car
hierarchy
model
materials
The individual materials all look the exact same other than the color
What's your thought?
Oh, that TODO looks relevant 😄
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
Good night 🙂
( MaterialInfos would need to store more than one material, how that can be mapped to the different meshes generated by gltf remains an issue)
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)
Is it possible to insert the material infos into the meshes that only exist in the GLTF and Bevy? That way, MaterialInfo can keep storing only one material.
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
uuid 44636785-0bbb-4705-a0d3-d0711563c304 is the offending one. I believe its because I was messing around with Blenderkit --
https://gist.github.com/ChristopherBiscardi/2e64a9d59b82831b433b093950cd85f4
materials file is actually fine now that its being generated. This is data in the Scene.glb
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
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)
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 ?
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 😄
Yeah I can understand that 😆
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.
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...
Oh I very much believe that. Thanks for looking into it 🙂
I like how colorful it looks 😄
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.
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
Oh, I forgot to report that! Got the same thing. The bug happens specifically when I have a blueprint as a child.
@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 😄 )
I think so, but I'll check again
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
Next update is almost ready to push 😉
If you go the way of enabling panics in dev mode, I'd be happy if it was behind a feature flag, similar to how glam has extra checks and panics if you enable a feature
😄 it reminds me that I feel kinda sad to not actually be doing some fun & colorful game dev instead of more tooling dev, hopefully once Blenvy is out
😄
Looks like it. Here's my setup
Seeing all the cool stuff all of you are working on makes happy 😉
And here's the Children of World. As you can see, there is both Bike and PlayerViewModel -> Bike
Our jam entry would not be possible without Blenvy ❤️
In my case it's like this:
Huh, so yours is not even a blueprint?
Nope
Does your hierarchy in Bevy also look like this?
- World
- Empty.001
- Cube.004
- Cube.004
- Empty.001
(That would explain why the duplicated cube is at origin)
Oh I think I found it: I had everything in a nested collection
o_O what in ze . I really cannot reproduce it:
When I put everything at the top level instead, it works as expected
Nesting level should not have any impact at all normally 🙂
Ok now I'm just confused, I put it back in the collection and there's still no duplicate 😅
o_O
I don't know how I fixed it 😅
I love how easy these bugs are to trace down and reproduce 😄
😄
Lucky for me, the bike happens to spawn low enough to be under the floor, so it doesn't impact the game 😄
Jan, I am guessing you do not have the additional root collection ?
I do not
Trying that one then 😄
Nope, does not change anything for me
Who wants to see a magic trick? :p
I had the same duplication when using the following setup:
World:
- Foo instance
Library: - Foo collection
- Cube
- ColliderCube instance
- Cube
- ColliderCube collection
- Empty holding
ColliderConstructor
which resulted inColliderCubebeing duplicated
- Empty holding
My solution for now is to manually duplicate ColliderCube and make that duplicate a child of Cube.
That is .... fascinating 😄 🖖
@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.
sec
This good?
Before and after the "magic trick"
This here looks like the duplicate
So quantum effects going on 👀
Thanks! Can't wait to see if our level actually looks alright ingame 😄
My duplicate is called "Cube.004____bak" where the original is "Cube.004"
Bingo !!!
That will help a LOT in pinning down the issue, although that confuses me more than anything 😄
Mostly as I have never been able to reproduce that issue locally ...
I also found a __bak
This is the blender file btw
In fact, I have both a __bak and a non __bak bike in there 😄
These should AFAIK both not be there
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
Oh, I'm probably wrong about this, since one Bike is the child of PlayerViewModel, so that should in fact be there
I think I had it happen as a child of a non-empty. Let me see if I can reproduce it.
I am 99% that the issue comes from this function (and if I could reproduce it locally, I could pin it down exactly)
Cannot reproduce
hmm, can you reliably (100%) reproduce it with empties
Let me check
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 ??
It just happened to me without an empty (with a torus)
o_O whaaaat ?
Just a simple mesh in the world ?
Yeah
I cannot
this setup does not trigger the duplicate
FYI I'm using the Blenvy addon you posted recently, not the one on GitHub
It is fine, there has been no change in that area
For me this sequence of actions seems to cause the bug most reliably
@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.
Does it also happen if you use the basic set parent ?
just a sec, trying it out now
This one? yes it happens too
ok , great ! thanks 🙂
I noticed that if I create the parent first, it doesn't seem to happen 🤔
Yes ! It is also failing 🙂
Not accounting for Blender's internal weirdness that should not have any impact, as Blenvy's export internals are essentially just iterating over the scene's hiearchy and doing a partial duplicate of it
In general the question that is nagging me is : why can't I reproduce the error in any of my test blend projects ?
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.
I'll try that out later, I am seing some very very weird things right now while debugging 😄
Maybe it could be changing some kind of iteration order? I tried a bunch times more and I'm pretty sure it depends on the order I create the objects
@lime pasture is this a fresh project/blend file ? (ie the old blender add-ons have never been used with it), right ?
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>"
Mmh for the specific scene I sent, I'm not 100% sure. But on another scene of mine the bug is also present and I'm sure it's fresh
Good bandaid idea ! ironically I have already got something like this on the Blender side ...
hehe
Here it is again on a fresh new empty scene. Note: If I remove the nested "Collection", the bug doesn't happen anymore
My conclusion so far: Blender is doing some REALLY weird stuff with parenting under the hood.
If you left out the "Blender" part this would be a great addition to https://discord.com/channels/691052431525675048/1256006995656441898
Don't even get me started with parenting & Bevy 😄 (looking at you , AnimationPlayer & co)
Also as a dad of 3 , soon 4 , this makes me laugh even more 😄
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
Definitely a bug
oh yes
I need to see if there is a way to detect this
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 🙂
@dawn shell your game looks awesome btw
Car looks good, but what happened to the street and bike textures?
Thanks 😄
New update is out !
- reworked materials handling:
- each material now gets its own gltf file
- multiple materials per mesh are now supported !
- big cleanups & improvement to how the material exports are done
- fixed the issue with duplicate entities when using parenting in Blender
- updated zip for the Blender side : https://github.com/kaosat-dev/Blenvy/releases/download/blenvy_v0.1.0_pre_alpha/blenvy.zip
- please use the latest version of Blenvy for the Bevy side !
TIL
Compiling now, let's see how it looks 😄
I think I turned off something related to textures (not in Blenvy, in my local copy of your game)
It COULD be another bug though 😄 Although with seperate gltf+textures things work fine ?
Ah heck, the materials file again is not created
Or is that file now superfluous?
The error comes from my own preloading
ahh yes, that is not needed
I nuked it locally:
I see 😄
but wait, are the rest generated correctly ?
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
Bevy
better angle in Bevy
note how the fire exit is red
Oh boy are you soon going to be happy then 😄
The current stop gap solution with the preloading of assets is not making me happy, so I will very soon be switching to writing the asset lists out to external (.ron) files that will likely be very close to the format of bevy_asset_loader
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
Man that test level looks really nice
but mutiple assigned materials
Thanks, I tried to recreate the screenshot used here: https://poly.pizza/bundle/City-Pack-kJqRAIGsw0
Download 57 fbx, obj + gltf models for free. No login required. Optimised for Unity, Unreal, Godot and AR/VR.
Everything is CC0 or CC-BY
I made none of the models, credit goes to the artists 🙂
hmm it means I would need to check for the number of materials vs number of meshes
I did however spend a long time scaling everything, optimizing the polygon count and manually creating colliders for everything 😄
Otherwise it will apply the last one
Looks more like the first one to me
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
Actually I am not even sure how I can deal with that scenario, because I have no simple way to know how many materials are actually in use on the mesh 😢
I removed everything except the metal material and it's still red in Bevy. I assume change detection didn't pick up my changes.
Materials change detection is limited (caching issue, it is in the todos :D)
Removed all folders and regenerated everything, now it looks good!
Let me drive around the scene a bit
I also notice that regeneration now seems to work correclly ?
something went wrong with a collider here, but I don't think that's Blenvy's fault
Yep, like a charm 🙂
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?
The colliders being that way are an Avian bug, confirmed.
For others running into this: negative scales are not properly supported by avian colliders yet
Still wondering about this, but I assume that’s just Blender being Blender
That annoyed the hell out of me as well, until I realised that the standard gltf exporter seems to be outputing negative scales
I wonder if it has something to do with the z-up to y-up conversion
Glad to hear this is a known phenomenon then 😅
used a blenvy blueprint to build a navmesh with vleue_navigator today
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)
So is the navmesh inside a blueprint ?
the mesh is constructed using blender boolean modifiers and such, then grabbed from the blueprint as a named mesh and processed into a navmesh
so this would turn into a navmesh that avoided the center
That is awesome! Looking forward to trying this out too !
Any QOL changes I could do on the Blenvy side to make this even easier ?
maybe something around loading, not sure yet. I'm going to keep working with it and I'll let you know if something comes to mind. I still have to implement the dynamic navmesh functionality so there's still a bit to learn on the navmesh side
did you guys figure out the material issue?
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
A lot of material issues got fixed today 😄 which one in particular do you mean ?
As in the blueprint loading, or asset loading ? Anyway, I am always open for feedback 🙂
I ended up putting the blueprint in bevy_asset_loader so that I could control the loading and processing easier. Right now my levels still kind of depend on blenvy loading the assets "on demand" it feels like, which can mean the level starts and the level or whatnot isn't actually there yet.
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
well im not sure lol, last time i openened discord i saw something about materials, no clue which one, i think blender was not exporting materials (either that or bevy wasnt adding them), nice to see issues resolved, closer and closer to actual release of blenvy
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)
Yes , most if not all of these (and a few more !) are now fixed, I think the pre-alpha can soon be an alpha 😄
About that: sometimes the Jam game does not load on Wasm. The UI loads, timers tick, everything is great, but no 3D models are shown on screen. This may be a user error or a bug in Blenvy, I don't know
If it really is a bug in Blenvy, I can imagine that HideUntilReady is causing it. I'll experiment with that
is it just a really long load? or does it never actually load
Fairly sure it's not loading anymore when this happens, yes.
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
Any tips on that front?
nothing more than the usual you're already aware of
It can be a long load, and ooh that reminds me there is some internal code tracking the loading progress I wanted to expose
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.
Hmm 🤔 I really need to remove the double loading of gltf files, that is a loading time and memory killer.
Can't wait to remove this code 😄
Ok I am very confused, normally you do not need any of that in Blenvy (or it is a bug!). Blenvy has built in asset loading
oh, I've been getting these all the time and just assumed I had to preload stuff myself
My bad , I haven't communicated it clearly enough.
Are these issues still present in the latest version?
Depends on what you mean by "latest". I ran a cargo update -p blenvy when the material fixes came out
And the issues are still present?
Yeah, I just created a new build at https://janhohenheim.itch.io/bike-game
That's where I took the screenshot above
@ebon zealot that build uses Blenvy at this commit: https://github.com/kaosat-dev/Blenvy/commit/ab7a0cab650e42327ba83517b0cfcc469bef972b
I'm uploading a new version right now using my own preloading, so don't be surprised if you open that link in 15 min and the error is no longer there.
Wait I thought you already had your own preloading?
Yeah, but I had to append new materials and blueprints to it that I added to the blend file in the meantime
namely, a bunch of these
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.
That is very strange as the Bevy side code is meant to explicitly only progress to the spawning stage IF all the assets have been loaded.
I removed all asset handles from my local copy of your code, and cannot reproduce it (again ! this seems like a recurring issue 😄 )
😄 strange happenings but not Strange-Knoll 😉
Specifically this part:
https://github.com/kaosat-dev/Blenvy/blob/blenvy/crates/blenvy/src/blueprints/spawn_from_blueprints.rs#L315
😄
Try running trunk serve, Wasm should run into this more reliably
That code looks correct from a quick glance, assuming blueprint_assets_to_load indeed always contains the full collection
Good old "works on my machine", eh? 😉
https://github.com/kaosat-dev/Blenvy/blob/9b50d77790f4845c4268ceeac701626ead93d8cb/crates/bevy_gltf_blueprints/src/materials.rs#L174 this is the part that is panicking
Exactly this 😄
Yep , I know it by heart 😄
hehehe
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
Huh, really? How do I do that? Also, when does the preloading start?
For your first question , gimme a sec 🙂 For the second part, what do you mean by when it starts ?
Does the asset loading start when the app starts (that's impossible), when I load the World.glb or when I spawn the world?
When you spawn the Blueprint
so as soon as bevy picks up the added SpawnBlueprint with BlueprintInfos
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
Yep 😄
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
And it means there is a memory leak most likely 😦
The asset handle or the "world blueprint" handle ?
Both, really
No wait, then again, the assets are loaded normally, when the last handle is dropped, it is released, Blenvy only keeps handles
- while loading (untyped handles)
- all the time if hot reload is active
you know what I have to double check these parts, I am honestly not sure anymore
Hehe, no problem
I have a reproduction of my issue of "infinite loading" open right now, including an inspector.
no errors in the console
The handles for blueprints are not staying alive for sure, because I had the issue with dropping the scene handle and they all dissapeared
this is how the World looks. Notice the BlueprintSpawning component
as you can see by the gizmos of the colliders, the level seems to have loaded in theory
Expanding the children of the Entity looks like this. It seems to me again like everything has loaded
"in theory" is the key here, I had a few nasty bugs where the information about the children spawning was not propagated to the root world, and it stayed hidden forever
That sounds very much like my case
If you want to be sure they all have loaded, check if all of them have the "BlueprintReady" component
From a glance, it seems to trigger about 25% of the time when loading the level in Wasm
Let me see
Btw I can reproduce your issues in Wasm:
you mean the highlighted one?
yes
Nice!
That's a local build and not the one of itch, right?
yes
Still odd that it is only on the material files
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?
Could be failing at any other point:
- assets loading
- components & hierarchy cleanup
- AAbb calculation (the last step)
If not a blueprint then no, it is not taken into account
So all non-blueprints should have no BlueprintInstanceReady?
If an empty has a child blueprint, the parent should have no BlueprintInstanceReady, but the child should, correct?
Yes, as the name implies, BlueprintInstanceReady is only for blueprints
exactly
For reference, here's how that setup is looking
Am I understanding it right that this screenshot is looking correct then?
yes, it seems ok
Btw, the given material is in the list of assets of the level, so it should have been loaded
Two solutions:
- the preloading using the
gltfcrate is not working correctly - some other bug in the asset loading stage
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
That fits with my observation that this (rarely) also happens on native. If it were not in that list, it would probably not ever work on native.
I am spent for tonight, I'll take a look at things again tomorrow 🙂
You were preloading things, so it would not happen at all in that case 🙂
happened on native when I forgot to add something to the list of stuff to preload*
Dang, then it is as I feared , it is the "bubbling up" of the Blueprint instance readyness that somehow fails sometimes ?
Sure! I can reliably reproduce it by refreshing the page on Wasm a bunch of times 🙂
Though it is purely based on hierarchy, so it should not vary, but I wanted to replace parts of the code there with observers/hooks
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
Is there a bandaid I can apply? Maybe insert BlueprintInstanceReady into World as soon as everything with a BlueprintInfo also has a BlueprintInstanceReady?
Thanks!
That is a brutal bandaid, but I think it would work 😉
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?" 😄
Would it make more sense to add BlueprintReadyForFinalizing manually? That way, blueprints_finalize_instances can still run
Yes even better!
FYI this check looks a bit suspicious to me
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);
}
}
Hmm not sure, but I think this still does not resolve all cases. Could some of you run the game on itch and let the level spawn for a while?
Can confirm that sometimes I still run into the infinite loading glitch
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 🙂
Update: here's a more sophisticated version of the hack that seems to work so far. It includes some ugly memoization 
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,
}
}
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.
Sorry Jan, but you will need a disclaimer , no time for fixes today.
No problem, my little hack I posted above seems to work reliably 🙂
@dawn shell have you been using any of the dynamic mesh creation ColliderConstructor variants?
We were using ConvexHullFromMesh before, yeah
Place it on the mesh in Blender, not the parent
i.e. on the green triangle, not the orange one
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
Huh, that's weird
You can also use the ColliderConstructorHierarchy anywhere and it will build stuff for all children. Maybe that helps?
Avian crashes or Blenvy crashes?
blenvy crashes while building the temp scene, so I end up with temp_scene.001, etc when trying to save out
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
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 
Do you get any error message with the crash ?
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.
Looks like an issue with your UVs?
I was going to say that 😄
yeah that's also what I was thinking. I created a mesh via solidify + boolean modifiers and applied them
so cube + solidify + boolean
Maybe manually unwrap the UVs after applying the modifiers?
Btw since that error is on the gltf export side (so not Blenvy itself), you might be able to reproduce the issue by trying to export the mesh itself using the standard exporter
I guess the only way Blenvy could mess this up would be by copying something weird into the temp scene? But why would that do something to the UVs?
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
Yes, that could be, but I simplified & streamlined the copying a ton, so it might be (yet another ) edge case.
same
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 ?
yes it did. I wasn't looking at my Scene so didn't notice that at first.
Damn, very sorry about that, I thought I patched all the cases where that happens, will add a fix asap
no stress for me, I work in temporary things and convert over to "production .blend" after 🙂
behavior of a serial pre-release user 😆
I have a "sacrifical scene" where I try materials out too
Crap, it already should be cleaned up correctly :
reminder that I'm one zip version behind right now
upgrading after I play with uvs
This has been in there a long time unfortunatly
this was the uv map btw
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
the export is fine... unless it uses a specific variant of the ColliderConstructor component. So I don't think its the export? unless there's some logic for processing UVs only if a specific variant is used
There is currently no Avian to Blenvy interaction. The collider constructor is a regular component as far as Blenvy is concerned, so this is weird.
Which variant(s) is/are affected?
yeah my thought exactly. A couple of the "FromMesh" types have had issues. I can try to trigger them again.
I'm wondering if the crashing ones are the ones that have extra params
Does ConvexHullFromMesh crash? That one has no params.
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
Are you using negative scales somewhere?
no, but I applied all scale and cleaned everything up and its good now.
hurray!
@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.
I already thought about this , and I believe the original Visibility would need to be stored at the start & restored at the end, I do not see any other way to restore it to the original ?
Why does it get changed at all when not using HideUntilReady?
? it should'nt ?
But I agree for the case where one uses HideUntilReady
That's what confused me as well 😄
As you can see, I'm not using that component in this snippet
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 😅
https://github.com/kaosat-dev/Blenvy/blob/blenvy/crates/blenvy/src/blueprints/spawn_from_blueprints.rs#L846
unless I have gone crazy this should only happen with HideUntilReady
Yeah, you’re right
The moment I hit "send" with my disclaimer, I figured out where I reset the visibility 😅
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)
What was the source of the issue ?
Sure! By the first point, do you mean how I need to do manual preloading?
Yes !
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!
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 😄 )
I'm fairly sure that the issues I reported are related to scheduling ambiguities because of how they behave. I think listing those with Bevy's builtin tools and resolving all of them would be good in general and probably "accidentally" solve a few bugs.
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?
is blenvy built for blender 4.1 or 4.2?
Both work
But in my experience, 4.2. is nicer for exporting stuff in general
So you may want to use that
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'
o.O
No one was able to reproduce a whole bunch of my issues without copying the entire project, so I think most Blenvy issues just are spurious like that ATM 😄
added another warn-instead-of-crash: https://github.com/kaosat-dev/Blenvy/pull/207
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
That reads a bit more like an error! than a warn! to me imo
Oh wait, no, this is a legitimate use-case
I change my opinion
You maybe still want to insert GltfProcessed. Not sure, but logically it seems like it is done processing when it cannot reflect, isn't it?
yeah, fixed
to me this indicates that your registry file is malformed in some way or another:
Could you please copy & paste it here if you are ok with it ? (or send it to me in private)
Thank you for this, merged 🙂
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 ?
I don't know, but if it is, it sounds like a Bevy bug.
Maybe that emits an AssetEvent::Removed ?
Events that occur for a specific loaded Asset, such as “value changed” events and “dependency” events.
Oh, nvm, there's another variant specifically for that: AssetEvent::Unused
Events that occur for a specific loaded Asset, such as “value changed” events and “dependency” events.
Emitted when the last
Handle::Strongof an Asset is dropped.
Awesome , thanks !
I think I have an idea why it gets dropped on wasm; investigating
The error you're investigating happens fairly often on native as well FYI
So I don't think it's something Wasm-specific
timing issue , very likely, my pc is rather fast, so it might explain why I never had that issue.
The error only happens with materials ?
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 :
I would highly recommend using ambiguity detection to debug that
Oh wow, that's great!!
That is an awesome tool thanks ! Will come very handy 🙂 But if I am right in this specific case, it is user error, aka me 😄
format is nothing final, just wanted to get something rolling
Btw is there some tooling/pattern in Bevy to easilly "wait until this asset is loaded" (thinking of async /await type stuff)
I find the boilerplate just to do something after an asset has been loaded absolutely horrendous, so it might my poor knowledge
Hell yeahhhhhh !!!
As you can see from https://github.com/bevyengine/bevy/blob/main/examples/asset/multi_asset_sync.rs, this boilerplate is currently inherent to Bevy.
Is that before or after a fix? 😄
After ! It works with Blenvy's asset preloading ! In wasm ! after removing all the gltf asset handles from your asset files !
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 😄
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
Sorry about that 😄
But nice for next projects!
so just commenting one line out fixed this 😄
Considering the whole project would not be possible without Blenvy in the first place, I cannot complain 😉
Aaaaah I see 😄
Hot reload results in my scene crashing most of the time
So I'm not running it at all
😂 seriously your game jam entry is like the best bug finder for me
Hehehehe
This is really needed, thanks for putting it out there !
Can you ping me when you pushed that commit?
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)
That results in a crash when exported on Windows and run on Linux, as is the case when I work on Windows locally and then do an itch.io deployment
Note that this naming is of course nothing a sane person would do, BUT I imported a whole bunch of 3D models, and some of them happen to use a material called "white" while others use "White".
So wait, the issue is when exporting from Blender or running from Bevy ?
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
When exporting from Blender on Windows, only one material file gets created instead of two
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"
Honnestly I do not see what I can do about this ?
Can you maybe display a warning when two materials have the same name but with different casing?
would have to be file hash names or something I'd imagine to truly "fix" it
not terribly fun 😅
Right, the generated files don't need to be "pretty" 
they would just be white-IONTHPFPNXO.glb
Agree to disagree there 😄
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
I'll be honest this is such an edge case ( building on windows, releasing on linux + same name with different casing ?) that is very very low priority for me
Hmm, Windows is the most common build system together with Linux, releasing on Linux is the only option for itch.io uploads which is the de facto standard for sharing your small games and using the same name with different casing will happen very quickly when importing models from other people
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 😄
fix it when more people are using and run into it 😆
its deff not "polish" time for blenvy anyway imo
its "first release"
For reference, among the imported materials are the following lovely names:
- Black
- Black.001 (autorenamed because it already clashes)
- white
- White
- Grey
- Gray
- Orang
- Orange
- DarkGrey
- Dark_grey
Agreed, I just think this is a really hard to debug footgun that I just came across.
But yeah, leaving a warning or something like that is probably enough for now.
while I agree on that, my time is limited and I have to set priorities, and this would require updating materials handling in multiple places in the Blender add-on, so please add this as an issue on github so other can see it , but I am not going to deal with it asap 😄
Sure!
if only displaying warnings in Blender was trivial 😢 edit: or perhaps that has changed , hopefully
It's not? o.O
Never tried it, but I just assumed it had to be
But then again, it is Blender

"welcome to the crazy crazy world of Blender"
This 😄
the world of wacky waving arm flailing inflatable blender 😆
Thanks for that mental image 😄
Fellas, I present: https://janhohenheim.itch.io/bike-game
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 ❤️
an absolute blast! ran into a small physics bug in a weird corner that sent me flying, but that made it more fun XD, i really enjoy the wild momentum you can get up, and crashing into walls
hehehe, we intentionally decided early on to not patch the wild flying physics 😄
Thanks for checking it out!
You can be, it is really very fun, and the occasional wacky physics add to the fun 🙂
Grabing pizzas and flying off above buildings is awesome 🙂
I am very offended !! Shocked even ! 😄 jokes aside, thanks for the mention 🙂
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.ronfiles 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
- added
bevy_common_assets/ ron as dependency for the file loading - big cleanup & partial restructure of the spawning steps
- fixed premature removal of the
BlueprintAssetsLoadStatecomponent that was leading to missing material gltf files in
setups without hot reload - added
OriginalVisibilitycomponent & 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 !
Woah, those look like some very good changes 😄
Glad I no longer have list out all of my assets for preloading, haha
Oh and this should make you happy @round cove (well not just you but still), failure to load materials will not panic anymore 😁
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 😅
I find your description of the issue very good & detailed (way more than I expected, much apreciated ::) Thanks !
@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 🙂
hyped about these changes 
@ebon zealot sorry i missed this yesterday, heres that registry file :)
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_componentsif it was Blenvy it would be4.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
Yep, didnt realize the change and grabbed the release plugins rather than the blenvy alpha. Thank you ✨ sorry about that
@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 🙂
It is exactly that, alpha artefacts 😄 waaay too much verbiage for a real release 😉
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!
I can also work on a PR for this if you'd like
Hi ! That is very odd, normally MaterialInfo components should only be added by the Blender add-on to objects that actually have materials, so good job finding a bug I missed 🙂 And I agree , Blenvy should not be adding materials where there are none !
That would be great and much appreciated 🙂 I have very limited time, so any PRs are very appreciated 🙂
Just to be sure : you are using Blenvy from the blenvy branch on the repo right ?
Yep
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
game\\game\\ also looks suspicious. Is that your actual setup?
i hadnt noticed that
this is the path the blender file explorer gives me
D:\windows\Rust\bevy\strange-spaces\game\assets\
and i cant manually edit the path, not really sure what the fix is here

agreed
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
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
Oh no, now it’s game/game/game 😄
:queues up xzibit:
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.
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
yeah, ColliderConstructor is what I've been using. Either manual or one of the "from mesh" variants
Hm, doesn't seem to like my meshes lol
are they scaled? I've been applying my scales in blender generally
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
nice, glad it was an easy fix
For primitive shapes, I like to
- create either empties with preview shapes or line-only objects without faces
- let them hold the collider constructor
- set them to be children of my object
- transform them into place with the default blender gizmos and shortcuts
That way, I get nice previews of them right in blender 🙂
I think I may submit a PR later today to Blenvy to show how this is done
I think the issue comes from your root folder, it should be the (relative) path to your Bevy project (relative to the .blend file).
Good idea about the reset to default settings button ! will add it
The root folder should be the relative path between your blend file and your bevy project it works by default with a folder structure something akin to this
- your Bevy project folder
--Art (where blend files are)
--Assets
if tried setting the root path to game which is the root of my rust project, but i get the same error with the duplicated game//game dir
Registry path bug1 steps:
- Crate default blender project. Do not save the project.
- Set registry path and press reload registry button. See file not found error.
- Set root project folder. Button reload registry still doesn't work.
- Set asset folder. Button reload registry doesn't work.
Registry path bug2 steps:
- Create default blender project and save the project.
- Set registry path. Button reload registry works.
- Set the project root path.
- Set the project assets path.
- The button reload registry stopped working. Error shows that registry path is incorrectly constructed and contains duplicate folder.
- Setting the registry path again doesn't solve the issue.
Could you post a screenshot of your project setup and the config used in Blenvy? Otherwise this is not really reproducible
Could you please post a picture of your registry path please?
included screenshots of the main blenvy panel, the registry path, and where blender says the path is
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.
forgot to include screenshot of the full directory structure
Thanks for the screenshots !
Your registry file path is wrong , it should be relative to your assets folder (registry file is an asset)
but registry is in the assets folder?
Yes , but as is shown in the tooltip for the registry path, it is relative to the assets folder:)
So if it is in the assets folder the path should be as it was set by default ie *./registry.json"
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
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
Bug2 steps with screenshots:
- Bevy project (code side) is ready. Registry file location : "D:\TempProject\project\assets\registry.json"
- Create new blender project with default cube. Save the project. Location: "D:\Test6.blend"
- Set registry path: (see screenshot 1)
- 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".
- Set root and assets folders path: (see screenshot 3)
- 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)
- Attempt to set registry path directly again doesn't solve the issue. The error on screenshot 4 is shown after pressing reload registry.
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.
Quick update, creating a new project and not touching the registry default worked
Yes. It seems that the button reload registry only breaks if we specify registry path before root/asset path.
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.
You add a collider constructor to the mesh in Blender. That's the one with the green triangle as an icon 🙂
I can send you a screenshot later
Foxtrot does not use Blenvy yet, so that will not help. Crazy Bike should be alright, but did not use the newest Blenvy addon yet, so the whole mess inside the assets directories is not needed anymore
@ebon zealot I think you will like this. I was about to write how to use Avian, but then I realized that the even more basic guide I was personally missing as a complete beginner did not exist yet. So I wrote that instead 🙂
Depending on how much I feel like it later, I might write a little tutorial about exactly this
Thanks for getting back to me. I'll take a look at this PR right now.
Oh, I don’t think that PR in particular will help you much if you already know how to use Blenvy without Avian
is hot reloading a thing yet? i know it was being worked on at some point
I don't really get how Blenvy's workflow works, even though there are videos explaining bevy_gltf_*. I'm still a newbie and can't figure out their differences. By learning step by step through this PR, the workflow might become clearer.
Ah, go ahead then and let me know if anything in there is confusing 🙂
In theory, yes. I personally only ever got crashes, but that might also a user error
This tutorial was very helpful. It helped me understand the basic process of Blenvy. No problem at all, just two more things to add:
if you don't exec cargo run on project root path, there is a panic
If blender language is Chinese, there is a error
谢谢! I'll fix those later
Edit: done 
@ebon zealot I'll write a little Avian tutorial as soon as the quickstart is merged, as I want to build on that.
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.
I don't know that its blenvy's responsibility to integrate with all third-party crates
That's just how the Avian API works
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
FYI that is only the case for generating colliders from meshes. You can attach primitive colliders to whatever you want.
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
Yes, agreed!
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".
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
Fair enough
In any case, the approach outlined should be a good reference for a future implementation 🙂
do people use the built-in asset browser or is there an extension that has a better one?
I wanted to use it a couple of times and never got the hang of the most basic usage of it.
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?
maybe? 😅 like this: https://docs.blender.org/manual/en/latest/editors/asset_browser.html
Yeah exactly
Maybe it's a skill issue from my side and the whole world loves it, I wouldn't know 😄
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
Huh, that would be a possibility, you're right. I was imagining expanding the Add menu with an own menu point named Avian Collider, but maybe assets would be easier? No clue.
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
But that would probably require more setup than just adding the addon
Add menu is cool too, but probably a different extension. blenvy-avian-addon
(Idk if an addon can shit its own assets)
I don't think the extra complexity introduced by splitting addons is worth it tbh
yeah more setup, but avian probably doesn't belong first-class in blenvy right? otherwise where's the line for third-party crate inclusions?
I think a line can be drawn at "people care enough to add support" 😄
Physics / collider support is supremely important for any editor
yeah I mean if y'all are ok with the maintenance burden of that
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
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
Well, the code that spawns the colliders needs to already know how the component looks.
exactly
I think you kinda need to use a certain component layout
I mean the blender/ui side of things, not the bevy side
I also mean the Blender side
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
I imagine it like this:
Add -> Avian Collider -> Cuboid adds an empty with the right component
yeah, so how do you line up empty -> component without a hardcoded list that requires a specific avian version?
That's what I meant. I think you can't get around it.
yeah, hence the sync upgrade. "when you upgrade blenvy you have to upgrade avian"
At least not without a lot of complexity like starting the app in rust and then analyzing the registry.json in blender
Hmm, good point.
its fine for one crate, not for 5+
tbf you have to do that anyways for every new Bevy version
but yeah, that is a good argument for keeping the amount of directly supported third-parties low
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.
Well, enjoy the read @ebon zealot when you get around to it 😄
I will bet money on rapier never ever being integrated within Bevy as a first-party solution.
But Avian has a decent chance on either being upstreamed (in years) or heavily influencing a first-party solution imo
I guess a crappy way would be to have a hardcoded list of component layouts for multiple versions 
And then you just select which version of Avian you're using?
yeah physics upstreaming is going to be a long time. I'd imagine we'll have editor before upstreamed physics
I think that's a fairly safe bet, yeah
Thanks for the bug report ! I think I know where the issue comes from.
Small note: in 99% of cases you should not need to set any path or reload the registry 🙂
It is not 100% feature complete, but works pretty well from my various tests, although @dawn shell did not have as much luck with it
Thanks a lot for this ! much appreciated 🙂 I am reading through it
I'm currently writing the avian guide, so if you wait 5-10 minutes, I'll add that to the PR 🙂
This is 100% something I want to look into more after Blenvy's actual release. There was a discussion about this a while back , including the use of a gltf physics toolkit (or at least re-using some ideas of it) with a nice, domain specific UI
It should not be too hard to have something relatively modular (I already built parts of Blenvy's python side with some modularity in mind)
Sure ! 🙂 I am busy working on some other Blenvy stuff also anyway, so take your time 😉
do you mean Blender one's or Blenvy's one ?
edit: never mind, Blender's 🙂 Oh boy, do I wish it was working better, there are a lot of "future features" listed somewhere on Blender's website that are really badly needed, so it works but is pretty basic imho
Unless they radically changed how the asset library works in 4.2 (did not try it out much), then no, Avian & any modular stuff would not really be practicaly to use via the asset lib, as the way to add assets and what can be an asset & how is .....convoluted ?
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 😆
Add menu with something specific is WAY more likely, I am done trying to leverage some of Blender's internals , I found domain specific, custom UI works way better (this is a highly subjective opinion, that is strenghened by Blender's not so great code documentation)
I think I trust your judgement on this one 😄
You used a Blender feature and "easy" in the same phrase !😱
Mean joke aside (I really love Blender despite its little quirks , most of which I would have never seen if I did not need specific features )
lolol I quoted it! 😆
working in blender with blenvy really feels like it opened up 3d bevy dev. absolutely amazing
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 !
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
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
likely, although, by jove, I just wish we could have better UI first before all that (a requirement for the Editor anyway). It is literally the only part of Bevy that I really dislike so far.
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)
ooh, actual alpha phase, excite!
@ebon zealot I added the Avian tutorial. Took a bit longer than expected, haha
PR is now ready
@bright harness you may care about this as well: Avian Tutorial
If the direct Blender-physics thing does not work out, my recommendation would be to use the approach outlined under Using Wireframes for the custom Add menu.
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
Worldand running it in Bevy will crash because the GLTF is malformed as it lacks anynodes - 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.
Thanks for your avian tutorial.
It might be easier to understand if we explain how to add a rigid body with a collider to a cube and run it in Bevy. After that, we can move on to more complex colliders.
The image select_mesh.png is missing here。
Good point, thanks for taking a look
I overhauled the tutorial based on your feedback 🙂
@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
Thanks for the tutorials.
Fair enough, although that kinda straddles the line to just becoming a generic Avian tutorial. I'm a bit exhausted from writing today, but we can track that in a follow-up issue 🙂
https://github.com/kaosat-dev/Blenvy/issues/215 opened an issue so we don't forget
@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 🙂
Absolutely stupendous work, for both the documents ! Really top notch quality, thanks a lot 🙂
They are very pleasant to read, clear & to the point, & well illustrated & with good "gotchas" !
I do have a tiny bit of feedback & some very minor nitpicks, would you prefer if I post them here or on Github ?
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 😄
Just don't make me redo the screenshots, that would take too long 😄
Yeah, makes sense. I hope that the Wiremesh approach I present makes sense, as I think that is what Blenvy could do via a menu.
Hahaha , god , I hate that part of the documentation the most, it takes ages ! so no worries there 🙂 If I need to make some changes I'll do them myself
Wait, I think I missed that ?
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.
Ahh ok now I got it 😄
I'll explore all this further after the main release.
Btw, about Bitflags, what kind of UI did you have in mind (other than the one you outlined in the docs) ?
I can create custom UIs for specific types, but I have zero clue on how a Bitflag UI should even look like
Well, Blender had a sort of bitflag UI for bone layers and it was notoriously awful, so I am also not sure how to best do this. A minimum step would be to just show the bits instead of interpreting them as numbers.
So show 00111010 instead of 28 or whatever
Hmm as I have not coded anything specific for this, there might be an implicit "cast" to numbers somewhere
A bit afraid that Blender might not offer the option to display bits directly as part of the UI
That's what I suspect as well.
Maybe you could convert it to a list of checkboxes?
Bit ugly, but at least usable
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 ?
Exactly.
Yes, it's a u32: LayerMask
A bitmask for layers.
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]);
Defines the collision layers of a collider using memberships and filters.
Ah yes, the same method @round cove used as well !
But I have no idea how to export that information
This makes things easier
a component hook and a custom enum
Something to do with docstrings / annotations ? 😉
Sounds like you would need to repeat the enum variants' names then :/
Good point
@ebon zealot ping me when the quickstart feedback has landed on GitHub 🙂
Then again should this not be a first class feature in Avian ? I mean the mapping between bitflags & their names
godot ^
Ahhh yes !! I remember those from Godot, thanks 🙂
i'd prefer some kind of a dropdown list for the premade ones though
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
I mean, it already has, at compile time. From my code above you can see that GameLayer::Player is used directly instead of LayerMask(b10000000). Translating an enum name to a string and vice versa sounds like a generic, orthogonal concept.
Hmm, that should actually be easy if you register_type the GameLayer of the example
i mean, i have the whole CollisionLayers as a const
Since the order of the enum variants is just binary counting up the layer bits.
so each enemy has the same thing
so it'd be closer to how unity has it, just a dropdown with one of the options
That is exactly how it works with the code I posted above. You add the CollisionLayerPreset as a component in Blender and you get a dropdown
i think you could just use use CollisionLayer::*; there to reduce boilerplate
Good point, I'll do so in the future, thanks 🙂
In that case, I don't think Blenvy can do anything to help you. Any setup required by a helper would be pretty much the same code as that boilerplate imo
So I would instead push for generic bitflag support first
you don't want to do that in the left hand side of a match (because you open yourself up to those being variables, not variants when code changes)
Oh shoot, good point.
I will not do so in the future then 😄
On the Avian side however, there is definitely a discussion to be had about how to do collision layers, starting with https://github.com/Jondolf/avian/pull/476
Posted a review with a few points, almost good to merge 🙂
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
Thanks, responded to everything
This one makes me nervous, because it would invalidate most of my screenshots, as they often show the components on the side 😅
A promise is a promise, I will take care of screenshots;)
@ebon zealot regarding your response: I see how adding the components to the collection makes more sense logically, but it has worse ergonomics, as I cannot just click on an object to see its components on the right anymore. I think. Let me double-check
? To the right? You mean in the custom properties?
I can see components when I click on collections
(where apparently the registry.json did not get loaded automatically
)
In that case no, the components are displayed regardless of the type of objet you have selected
This 🙂
I mean when I click on something in the viewport
Viewport is only for physical object
Because often, I care about the red building, so I click on the red building visible in my view port
Yep. That's why it's a little bit more ergonomic to have the component on the physical object in this case
Not that it makes that big of a difference, mind you
that seems like a per-case benefit
exactly
like if you aren't using collections as collections, but rather single object wrappers
Yep, exactly right
I get your point, but I still think it is very important to make the distinction between blueprint level components and contents -of blueprints components: you can also have blueprintswithout meshes for example
My point is that for the quickstart, it seems like that is the more ergonomic approach
maybe, but a collection is the unit of abstraction right?
like you spawn collections, not objects or meshes
That is true, but not really relevant for ergonomics when you have single object collections. Meanwhile "I click on thing, I get thing's components" is
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
Exactly!
Also you can see the components of a blueprint when you click on an instances "original collection" (on cellphone can't post a screenshot)
Thanks 😄
Oh, that I did not know
Indeed, there they are! That's neat.
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 !
Woah
TIL lol
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
Extra bonus : if you override a component value for a given instance that also exists on the blueprint, you can see the original value and the per instance value in close proximity in the UI, just a click away!
That is extremely neat
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
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
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
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)
Also this is something I actually tried before Blenvy, including animations for "UI" elements and it was clunky but it worked
Ohh was that what you were doing in your stream today? I did not have time to watch it in full yet
oh yeah, that's somewhere in the stream
Awesome! I need to check it out and the code too !
With the upstreaming of bevy_mod_picking in v0.15 this should be a breeze soon !
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
@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 🙂
All good 👍🏽😊 thanks a lot, merged!
Awesome ! Thanks for sharing
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?
As far as I know only .gltf files allow this, not .glb files (which is a damn shame)
oh whaaat
Yep, rather annoying, it is one of the reasons I switched to using.gltf files for projects with textures 😢
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
Now I wonder if this is a Blender or a glTF limitation
Oh come on
What is wrong with you




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?
https://github.com/mrtripie/Blender-Super-Batch-Export?tab=readme-ov-file
not sure if this will help
Blenvy already does this by default, but thanks 🙂
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
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.
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.
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.
Sounds like a bug in the Blender addon then
Happy to hear that you found it useful 😄
Yeah, I'm reading through its code now to figure it out 😆
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. 🤔
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
Blenvy is way more stable in my experience than the old workflow stuff
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?
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
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.
blender is definitely worth learning, the rest depends on the kind of 2d game
I see. I thought I read somewhere it's in pre-alpha so the old workflow felt safer. Are there newer alternatives to the blender plugins? Do I need to just zip together the files? Because there doesn't seem to be a blenvy release if I'm looking in the right place.
Clone the blenvy repo, go into the tools folder, zip the blenvy folder, and install it in blender
Follow the quickstart
Oh there was a pre-release just below the other one. Must have missed that.
Yeah it’s ordered lower, so it’s really easy to miss 😄
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.
I use either
- Strings, as you describe
- Enums
- Marker structs
- Any of the above combined with hierarchies, i.e. "go up the hierarchy and look at siblings there until you find one with the marker component Foo"
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.
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. 😄
Agreed, there is not a really clean way to do this yet as far as I know. Might also be an extension of the fact that relations are not yet implemented in Bevy proper.
Yeah, that’s true. Everything will probably change with BSN as well… let’s see how it ends up solving entity references
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.
Huh, looks like a bug @ebon zealot
Does it work when you reload it a second time? Maybe after closing and opening Blender?
Yeah that worked. I'm dumb for not trying that directly 🤦♂️
Disagree, it's supposed to work the first time 😄
Maybe I should add "close and reopen Blender juuuuuuust to be sure"
Just a speculation but I had to uninstall the older addons, so maybe there was something lingering there that required a restart?
May very well be. Blender is a strange, magical, and ultimately mysterious beast.
Does this show up even if you haven't installed any addon before? Just curious.
yep
(at least for me)
I assumed it meant I was overwriting a previous addon.
Pretty sure it's there all the time to ask what to do in case of conflicts
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.
It's new in 4.2!
The Blender people are doing a huge overhaul to how addons work
Look, there's an official place to download them from now 😄
But yeah, since that whole thing is still new, expect it to be a bit rough around the edges with bugs like these
the top of any documentation tbh. "have you tried turning if off and on again?"
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.
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."
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
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.
Just add your overwritten components onto the instance. It’s not documented yet, but that will overwrite the collection components 🙂
I think this only works if your added your components to the collection in the library, not the object within it.
It's supported 😄
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.
I can’t help you debug that in detail as I’ve never used that feature myself, but I know for certain @ebon zealot has implemented it. @round cove, has you done overrides before?
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 😄
In the library, are your components on the collection?
I tried it the other day and it worked when we were talking about it, but its not a feature I use regularly
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
Blender was showing errors when I tried to override components of linked collection that is located in a separate file. I'll try again.
Huh, maybe doing it across files is buggy
I’ll give it a proper go tomorrow. Knowing that it should work gives me enough hope to try 😆
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.
Oooh I see. I was talking about collection instances the whole time. Thanks for clarifying.
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
Get well soon! 🙂
Thanks !
The parts I tested at least work pretty well, the only issue I would consider important is https://github.com/kaosat-dev/Blenvy/issues/205
Everything else works exceptionally well now imo
I will be honest , I never quite got the hang of "library overrides" I would need to dig into their logic again at some point
I have not tested the following, so I cannot comment on them:
- anything involving armatures
- working with multiple blend files
- overriding components
Did you run into that issue again in the most up to date version from github ? (NOT the zip file, that is not up to date), I did a number of changes that were supposed to solve this one 🙂
Did not check yet!
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.
My semi outdated version of Crazy Bike did not run into the issue across multiple (10+) runs but we have seen quite a bit of "works on my machine" 😄
hehehehe
Forgot to ever report it. Do you have any idea on where this is on a scale of "Oh, let me just change a line" to "This is literally impossible to fix thanks to Blender"?
That annoyed the hell out of me as well , but I vaguely recall that this is not a solvable problem, as the standard gltf exporter (not Blenvy ) has the same issue
That's what I feared
I guess for now I'll just have to disable Blenvy for when I'm working on first person animations
It had to do with setting specific frames when exporting (a MUST , I can go into the details some other time)
just uncheck auto export and you should be good
That unfortunately did not fix it on the old workflow
Haven't tried it with Blenvy though
Works completely differently in Blenvy 😉
Ah, then I'm fairly confident it will work
I consider that workaround unintrusive enough to not be too annoying 🙂
Yeah that sounds like Blender 😄
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)
Yeah, I got it as well
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
I will take a look at this , haven't tried multiple file workflows since the last few changes
Very odd one ! Could you please report this one on Github ? 🙂
It feels like there are lots of smaller , weird issues with first time starts of the add-on with Blender 4.2 Feels like a strange pattern,
There is no mention of any significant change to add-ons' initialization in v4.2 but it feels like a weird coincidence that most of these issues go away after a restart?
No clue why Github ordered it that way, but once the actual alpha is out it should be clearer (hopefully :D)
I created an issue.
Got a link to the commit that removed the manifest?