Blender_bevy_components_workflow
Blender_bevy_components_workflow copied to clipboard
cannot save
on blender 4.3,
i get below error, when following the quick start guide
I hit the same wall; digging into the python side of the issue, it looks like there needs to be a check if the shadow_buffer_bias object exists on the light object, as it's apparently optional and can be None. My guess is 4.3 made it default to None, whereas before the light object would have had this value?
I'm willing to submit a patch for the python that does the check, but there's a TODO in that very spot that makes me think there might already be work in progress for this.
@cometta - if you edit add_ons/auto_export/common/auto_export.py, around line 63, there's a "TODO" with light['BlenderLightShadows'] = f"(enabled: {enabled}, buffer_bias: {light.shadow_buffer_bias})" after it.
change that to:
if hasattr(light, 'shadow_buffer_bias'):
light['BlenderLightShadows'] = f"(enabled: {enabled}, buffer_bias: {light.shadow_buffer_bias})"
else:
light['BlenderLightShadows'] = f"(enabled: {enabled})"
if you do that, and re-add the plugin you should be able to save. I don't know what that will do to the assets, but it let me save it.
the easy way to re-add the plugin is to just zip up the blenvy folder as blenvy.zip and drag and drop it over blender again, it should reinstall.
... and that breaks the app:
Couldn't create an instance of `blenvy::components::blender_settings::lighting::BlenderLightShadows` using the reflected `FromReflect`, `Default` or `FromWorld` traits. Are you perhaps missing a `#[reflect(Default)]` or `#[reflect(FromWorld)]`?
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I don't know enough about Blender objects to "fake" the buffer bias value if it doesn't exist in the python context.
I am facing the same issue. Is using blender 4.2 the way to go for now?
I am facing the same issue. Is using blender 4.2 the way to go for now?
I will try downgrading tonight when I get off work, I only tried with 4.3.
I think I broke my blenvy / blender stack and need to reinstall it all completely, I have to assume it will work since the last release came out when 4.2 was the latest Blender.
Having the same issue. So you have any luck with blender 4.2?
in ~/.cargo/registry/ .. lighting.rs i added #[reflect(Component, Default)] in :
#[derive(Component, Reflect, Default, Debug, PartialEq, Clone)]
#[reflect(Component, Default)]
#[non_exhaustive]
/// The properties of a light's shadow , to enable controlling per light shadows from Blender
pub struct BlenderLightShadows {
pub enabled: bool,
pub buffer_bias: f32,
}
getting new error :
2024-12-17T16:17:41.701000Z ERROR bevy_asset::server: Failed to load asset 'blueprints/Player.glb' with asset loader 'bevy_gltf::loader::GltfLoader': invalid glTF file: missing field nodes at line 1 column 323
Added a nodes with npm packages glb to gltf converter. But I cant see anything when i got the window with cargo run.
Made geometry nodes to mesh and it works!
shadow_buffer_bias got removed from Blender's python API in 4.3 because EEVEE doesn't use it any more.
If you want to hack around this I guess setting it to some constant value should work in a pinch, alternatively deleting the whole iteration over the lights you should only be losing shadow settings.
Downgrade to Blender 4.2.5 LTS helped me
The rust side doesn't actually do anything with the bufferbias, so I just set it to 0.
~/.config/blender/4.3/extensions/user_default/Blenvy/add_ons/auto_export/common/auto_export.py
https://github.com/kaosat-dev/Blenvy/blob/03cc100caca642b9386630e203e86500208fecf6/tools/blenvy/add_ons/auto_export/common/auto_export.py#L64
light['BlenderLightShadows'] = f"(enabled: {enabled}, buffer_bias: {0.0})"
If you deleted the point light in the default scene you can just reload the blend file and it will clear the cache. Then you can save. Worked for me.