Page MenuHome

bpy.msgbus.subscribe_rna doesnt trigger with the transform system
Confirmed, NormalPublicKNOWN ISSUE


System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 431.60

Blender Version
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: rBf6cb5f54494e
Worked: (optional)

Short description of error
Callback of bpy.msgbus.subscribe_rna is never called when moving the object in the scene. It only works when changing the property in the Transform panel.

Exact steps for others to reproduce the error

  1. In the scripting view, copy/past the code from here:
  2. Run the script
  3. Toggle system console to see outputs
  4. In the 3D view, select the cube, open the transform panel and change one of the location's components -> the callback print something
  5. Now select the cube and move it directly in the scene -> no output

And an auxiliary question: how to unsubscribe?


Event Timeline

Philipp Oeser (lichtwerk) lowered the priority of this task from 90 to 80.Dec 3 2019, 12:39 PM

And an auxiliary question: how to unsubscribe?


Regarding the missing update: can confirm the behavior, but it could very well be that this is how it is supposed to work:
I am a bit on shaky ground here, but from my understanding, only the following go through RNA to write to data (in most scenarios):

  • Python API
  • User Interface
  • Animation System

(check also)

The transform system doesnt really go through RNA iirc, so subscribing wont succeed here.

Definitely going to let @Campbell Barton (campbellbarton) decide on this [also on the following suggestion as a workaround]:
If msgbus does not handle all updates, do we have to rely on handlers here (less elegant, probably less performant as well...)?

import bpy
from mathutils import *

ob = bpy.context.object
ob["locstore"] = ob.location

def my_handler(scene):
    loc_old = Vector(ob["locstore"])
    if loc_old != ob.location:
        ob["locstore"] = ob.location
        print('Object "{}" changed its location to: {}: '.format(
  , ob.location)

Maybe this also belongs more to devtalk, there is a similar thread open, see

Note that this is a general issue for operators that access struct members directly, not via RNA.

In this case we can get the transform system to send the message that the object location changed.

Philipp Oeser (lichtwerk) changed the subtype of this task from "Report" to "Known Issue".

Think we can call this a Known Issue for the time being (this is not really a bug)

Philipp Oeser (lichtwerk) renamed this task from bpy.msgbus.subscribe_rna to bpy.msgbus.subscribe_rna doesnt trigger with the transform system.May 12 2020, 3:46 PM
Campbell Barton (campbellbarton) moved this task from Bugs to Backlog on the Modeling board.
Campbell Barton (campbellbarton) added a project: Restricted Project.
Richard Antalik (ISS) changed the task status from Needs Information from Developers to Confirmed.Nov 25 2020, 7:27 PM

Confirming since the issue is classified