is it possible to controle True/False checkbox from "UV/Image Editor > UVs > Constrain to Image Bounds" via Python Console ?


Look in info area

In this case if we open an info window and toggle the setting in the image editor

enter image description here

We see the property is lock_bounds of the uv_editor settings of the image editor space. Python console code to get there, in same screen. Beware: currently trying to auto complete an image editor space from another (other than context) screen core dumps my 2.8 build

>>> for i, a in enumerate(C.screen.areas):
...     i, a.type
(1, 'CONSOLE')
(3, 'VIEW_3D')
(5, 'INFO')

>>> a  = C.screen.areas[4]
>>> s = a.spaces.active
>>> s

>>> s.uv_editor.lock_bounds = True

Although can set without, for the menu to show, mesh object needs a UV map and be in edit mode.

  • $\begingroup$ thank you batFINGER <3 $\endgroup$ – DevilSam Jun 4 '19 at 9:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.