Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blender 2.9x Attribute Error: '_Restrict Context' object has no attribute 'scene' #18

Open
adnanmunawar opened this issue Mar 27, 2023 · 2 comments

Comments

@adnanmunawar
Copy link
Member

File "ambf_addon.py", line 120, in set_view_transform_orientation_to_local:
    bpy.context.scene.transform_orientation_slots[0].type = 'LOCAL'
Attribute Error: '_Restrict Context' object has not attribute 'scene'

This line works for Blender 3.x and not for 2.9x.

@adnanmunawar
Copy link
Member Author

Temporary fix, comment out line 120 and replace with a pass statement. I.e.

Original

def set_view_transform_orientation_to_local():
    bpy.context.scene.transform_orientation_slots[0].type = 'LOCAL'

Edited

def set_view_transform_orientation_to_local():
    #bpy.context.scene.transform_orientation_slots[0].type = 'LOCAL'
    pass

@adnanmunawar adnanmunawar changed the title Blender 2.9x Attribute Error: '_Restrict Context' object has not attribute 'scene' Blender 2.9x Attribute Error: '_Restrict Context' object has no attribute 'scene' Mar 27, 2023
@jtzhangLogan
Copy link

File "ambf_addon.py", line 120, in set_view_transform_orientation_to_local:
    bpy.context.scene.transform_orientation_slots[0].type = 'LOCAL'
Attribute Error: '_Restrict Context' object has not attribute 'scene'

This line works for Blender 3.x and not for 2.9x.

This doesn't seem to work for 3.5 too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants