hi,
The camera is a special beast in some cases. Fields also. They are supposed to trigger the less updates possible.
There is no direct way of fixing this issue. One workaround (pretty dirty) is to create a python tag attached to your plain effector.
As showed in this thread, this python tag can register and react to an event.
The idea is to set the effector itself or the field layer dirty. (Not the field object).
You can react to the message that have the ID c4d.MSG_GETREALCAMERADATA. If this message is received, then you can set the effector dirty. This will trigger the field layer to be recalculated and the field object to be re-evaluated.
This is a bit dirty because the effector will be re-evaluated every time you move the camera, even if this is the viewport camera.
But you can add a few lines of code to check if the active camera is the object camera linked in your field object.
For this to work, you must use the function AddEventNotification. Have a look at the c++ documentation as it is more precise in the way it describes the flags to use.
Be aware that will also slow down the viewport as maybe some useless calculation will be triggered.
import c4d
def message(msgType, data):
if msgType == c4d.MSG_NOTIFY_EVENT:
if data["eventid"] == c4d.NOTIFY_EVENT_MESSAGE:
if data["event_data"]["msg_id"] == c4d.MSG_GETREALCAMERADATA:
obj = op.GetObject()
obj.SetDirty(c4d.DIRTYFLAGS_DATA)
def main():
obj = op.GetObject()
# Chekc if the event nofication is already added otherwise add it.
if not obj.FindEventNotification(doc, op, c4d.NOTIFY_EVENT_MESSAGE):
obj.AddEventNotification(op, c4d.NOTIFY_EVENT_MESSAGE, c4d.NOTIFY_EVENT_FLAG_COPY, c4d.BaseContainer())
if __name__=='__main__':
main()
Cheers,
Manuel