Keyframed properties do not update in 'Render' context #72513

Closed
opened 2019-12-17 14:49:41 +01:00 by Christopher Gearhart · 8 comments

System Information
Operating system: Windows
Graphics card: Irrelevant

Blender Version
Broken: 2.81a
Worked: 2.79

Short description of error

I recently discovered that ever since the 2.80 release, there has been a critical discrepancy between the viewport context and the rendering context with respect to the location, rotation and scale properties (and perhaps more) from frame to frame. Visually, everything behaves correctly, but when running very basic scripts on app_handlers.frame_change_post, the objects' transform properties seems to be frozen in time.

Exact steps for others to reproduce the error
Based on the default startup, with the System Console open:

  • Select the default cube, and add a LocRotScale keyframe
  • In the timeline, change the active frame and end frame to frame 50
  • Move, rotate, and scale the cube
  • Add a second LocRotScale keyframe
  • Run the following basic script from the Text Editor:
import bpy

@bpy.app.handlers.persistent
def update_values(scn):
    print(bpy.data.objects["Cube"].location)  # and/or 'rotation_euler'/'scale'

bpy.app.handlers.frame_change_post.append(update_values)
  • Play the animation, and note that the object's location will update every frame in the System Console.
  • From the Render dropdown, hit Render Animation. Notice now that the object's location does not change in the System Console.
**System Information** Operating system: Windows Graphics card: Irrelevant **Blender Version** Broken: 2.81a Worked: 2.79 **Short description of error** I recently discovered that ever since the 2.80 release, there has been a critical discrepancy between the viewport context and the rendering context with respect to the `location`, `rotation` and `scale` properties (and perhaps more) from frame to frame. Visually, everything behaves correctly, but when running very basic scripts on `app_handlers.frame_change_post`, the objects' transform properties seems to be frozen in time. **Exact steps for others to reproduce the error** Based on the default startup, with the System Console open: - Select the default cube, and add a `LocRotScale` keyframe - In the timeline, change the active frame and end frame to frame 50 - Move, rotate, and scale the cube - Add a second `LocRotScale` keyframe - Run the following basic script from the Text Editor: ``` import bpy @bpy.app.handlers.persistent def update_values(scn): print(bpy.data.objects["Cube"].location) # and/or 'rotation_euler'/'scale' bpy.app.handlers.frame_change_post.append(update_values) ``` - Play the animation, and note that the object's location will update every frame in the System Console. - From the `Render` dropdown, hit `Render Animation`. Notice now that the object's location does not change in the System Console.

Added subscriber: @bblanimation

Added subscriber: @bblanimation

#72707 was marked as duplicate of this issue

#72707 was marked as duplicate of this issue

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Christopher Gearhart self-assigned this 2019-12-17 15:01:08 +01:00
Please disregard. Found the fix: https://wiki.blender.org/wiki/Reference/Release_Notes/2.81/Python_API#Handlers
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Have a look at #71234 (Custom property doesnt update when rendering animation) also.
Or here (under Handlers): https://wiki.blender.org/wiki/Reference/Release_Notes/2.81/Python_API

Basically it boils down to having to do something like this instead:

import bpy

@bpy.app.handlers.persistent
def update_values(scene, depsgraph):
    ob = bpy.data.objects["Cube"]

    # access evaluated objects prop [these are updated fine in frame_change_post]
    ob_eval = ob.evaluated_get(depsgraph)
    print(ob_eval.location)  # and/or 'rotation_euler'/'scale'

bpy.app.handlers.frame_change_post.append(update_values)
Have a look at #71234 (Custom property doesnt update when rendering animation) also. Or here (under Handlers): https://wiki.blender.org/wiki/Reference/Release_Notes/2.81/Python_API Basically it boils down to having to do something like this instead: ``` import bpy @bpy.app.handlers.persistent def update_values(scene, depsgraph): ob = bpy.data.objects["Cube"] # access evaluated objects prop [these are updated fine in frame_change_post] ob_eval = ob.evaluated_get(depsgraph) print(ob_eval.location) # and/or 'rotation_euler'/'scale' bpy.app.handlers.frame_change_post.append(update_values) ```
Member

Oops, you were faster :)

Oops, you were faster :)
Member

Added subscriber: @lowercase

Added subscriber: @lowercase
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#72513
No description provided.