System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: GeForce GTX 780 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.59
Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-12-04 11:32, hash: rBf1aa4d18d49d
Worked: (optional)
Short description of error
Changing a part of evaluated object.original during animation resets all object attributes to those of the last visible frame before rendering of animation started.
Exact steps for others to reproduce the error
https://github.com/leomoon-studios/leomoon-textcounter/blob/master/src/leomoon-textcounter.py#L353
I enountered a problem (and possible bug) with API in this add-on. This script alters Font object text (body) on every frame.
This is achived by handler:
@persistent
def textcounter_text_update_frame(scene, depsgraph=None):
for object_inst in depsgraph.object_instances:
text = object_inst.object
if text.type == 'FONT' and text.data.text_counter_props.ifAnimated:
textcounter_update_val(text, scene.evaluated_get(depsgraph))Depsgraph is used to get evaluated object for each animation frame. Simply taking object from bpy.context.scene.objects will not work either in viewport or during rendering animation (don't remember which one). To be specific, PropertyGroup text_counter_props, that is part of Font object, will not refresh during animation until it is taken from evaluated object.
Then, new body (text) is assigned to the Font object:
text.original.data.body = out
At this moment all other properties of this object (like location, rotation, scale etc.) will reset to those of the last visible frame before rendering of animation started.
I think it is a bug because, in my understanding, only body attribute should be changed by this code.
To reproduce:
- Open file
- Run script
- Start animation in viewport - all works fine (timer counts and moves right to left)
- Start rendering animation - timer counts but sits still
Edit. I messed up file attachments.