JacquesLucke / blender_vscode

Visual Studio Code extension for Blender development.
MIT License
540 stars 70 forks source link

Changing or deleting scene in blender when running through this VS code addon seems broken? #152

Closed AhmedSalih3d closed 5 months ago

AhmedSalih3d commented 8 months ago

Hello!

I have the following code:

import bpy

def change_scene(scene_name):
    """Function to change the active scene."""
    if scene_name in bpy.data.scenes:
        new_scene = bpy.data.scenes[scene_name]
        bpy.context.window.scene = new_scene
    else:
        print(f"Scene '{scene_name}' not found.")

# Use the function to change the scene
change_scene("Your_Scene_Name")  # Replace with your target scene name

Which works well when running from blenders internal script editor. When I execute it through VS code though, when I "stand" in another scene, then it will crash completely:

ExceptionCode : EXCEPTION_ACCESS_VIOLATION

Anyone knows how to fix this?

Kind regards

AhmedSalih3d commented 7 months ago

I had made a mistake my self. I was crashing blender by using depsgraph code while changing scenes - this function had no issue in and off it self

Ladvien commented 6 months ago

Hello @AhmedSalih3d, if that's the case, shouldn't we close this issue?

AhmedSalih3d commented 5 months ago

@Ladvien apologize for my late response, definitely yes.

Closed now.