3

I want to listen for a change of perspective in the 3d area, maybe can use msgbus api.The code I try as followed.But it does't work.How can I choose the correct properties.

def notify_test(*args):
    print('change123')

subscribe_to = bpy.types.RegionView3D,'view_rotation' bpy.msgbus.subscribe_rna( key=subscribe_to, owner=object(), args=(1, 2, 3), notify=notify_test, ) bpy.msgbus.publish_rna(key=subscribe_to) ```

fage
  • 109
  • 7
  • Some suggestions: https://blender.stackexchange.com/a/249814/60486 – Markus von Broady Feb 24 '24 at 19:27
  • 1
    Yup I think the only one which will work here is the 3D view handler. The depsgraph doesn't get updated when the viewport camera moves and I wouldn't count on msgbus. – Gorgious Feb 25 '24 at 09:45
  • @MarkusvonBroady Thank you for your helpful suggestiion! I will learn more about them. – fage Feb 26 '24 at 06:22
  • @Gorgious Oh. thanks.Moreover, is there any links for me to learn about the 3D view handler? – fage Feb 26 '24 at 06:26

0 Answers0