0

Tried this code, but it seems have some issue, can't figure it out (need your help):

import bpy

def my_handler(scene): #print("Active object:", scene.objects.active.name) print("Active object:", bpy.context.view_layer.objects.active.name)

#bpy.app.handlers.scene_update_post.append(my_handler) bpy.app.handlers.depsgraph_update_post.append(my_handler)

the old original code is commented.

APEC
  • 570
  • 3
  • 12
  • can u please elaborate the issues? syntax error? isn't called? if yes, when isn't it called...? – Chris Dec 01 '22 at 09:43
  • oh sorry, I restarted blender and used it again and it seems to work as expected. So I'll leave the question so others can do the same. – APEC Dec 01 '22 at 10:07
  • Note this won't fire only every time the object is changed, it will fire every time anything is changed. – Gorgious Dec 01 '22 at 11:59
  • Gorgious, you are right. How to handle here https://blender.stackexchange.com/questions/150809/how-to-get-an-event-when-an-object-is-selected – APEC Dec 01 '22 at 15:31

0 Answers0