BGE: Python-driven armature animation got buggy after 2.70 #42919

Closed
opened 2014-12-16 11:19:38 +01:00 by inactive account · 11 comments

System Information
Tested on Kubuntu 14.10 64-bit

Blender Version
Broken: 2.71 and newer, tested up to Git version 72341537e8
Worked: all releases from 2.69 up to and including 2.70a

Short description of error
In the BGE: Updating an armature at runtime with Python doesn't work, unless there is a Copy Rotation constraint on one of the bones. The constraint can be turned off (eye symbol) or given influence=0, but still it needs to be there.

Exact steps for others to reproduce the error

  • Open attached blend file bge_skelanim_test.blend with Blender 2.72b or a development version.
  • Check that there is a disabled "Copy rotation" constraint on bone "Bone.001". I pre-selected the bone for you, so it should be immediately visible.
  • Start the game engine, and see that the "rot" debug property is increasing its value. As it increases, bones rotate, and the capsule-shaped mesh deforms.
  • Stop the game engine.
  • Delete the bone constraint on bone "Bone.001"
  • Start the game engine, and see that the "rot" debug property is still increasing its value. However, the capsule-shaped mesh doesn't deform.

To verify, open the same blend file in Blender 2.70a (I tested the 64-bit Linux build), remove the constraint, and start the game engine. You can see that here it works just fine (as expected) without the constraint.

**System Information** Tested on Kubuntu 14.10 64-bit **Blender Version** Broken: 2.71 and newer, tested up to Git version 72341537e872f2870e785d9fb8a24d2dbdd71471 Worked: all releases from 2.69 up to and including 2.70a **Short description of error** In the BGE: Updating an armature at runtime with Python doesn't work, unless there is a Copy Rotation constraint on one of the bones. The constraint can be turned off (eye symbol) or given influence=0, but still it needs to be there. **Exact steps for others to reproduce the error** - Open attached blend file [bge_skelanim_test.blend](https://archive.blender.org/developer/F132200/bge_skelanim_test.blend) with Blender 2.72b or a development version. - Check that there is a disabled "Copy rotation" constraint on bone "Bone.001". I pre-selected the bone for you, so it should be immediately visible. - Start the game engine, and see that the "rot" debug property is increasing its value. As it increases, bones rotate, and the capsule-shaped mesh deforms. - Stop the game engine. - Delete the bone constraint on bone "Bone.001" - Start the game engine, and see that the "rot" debug property is still increasing its value. However, the capsule-shaped mesh doesn't deform. To verify, open the same blend file in Blender 2.70a (I tested the 64-bit Linux build), remove the constraint, and start the game engine. You can see that here it works just fine (as expected) without the constraint.

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @sybrenstuvel

Added subscriber: @sybrenstuvel

PS: This is the code that runs in the BGE, just so you can look at it without downloading/opening the blend file:

def update(ctrl):
    skel = ctrl.owner
    
    chan = skel.channels['Bone.001']
    chan.rotation_euler = (skel['rot'], 0, 0)

    chan = skel.channels['Bone']
    chan.rotation_euler = (-skel['rot'], 0, 0)

    skel.update()
    
    skel['rot'] += 0.02
PS: This is the code that runs in the BGE, just so you can look at it without downloading/opening the blend file: ``` def update(ctrl): skel = ctrl.owner chan = skel.channels['Bone.001'] chan.rotation_euler = (skel['rot'], 0, 0) chan = skel.channels['Bone'] chan.rotation_euler = (-skel['rot'], 0, 0) skel.update() skel['rot'] += 0.02 ```

After using git bisect to find the bug-introducing commit, I found this one:

fe05f97841 is the first bad commit
commit fe05f97841
Author: Mitchell Stokes mogurijin@gmail.com
Date: Sun Apr 6 16:30:59 2014 -0700

  BGE: Multi-threading animation updates and skinning.
  
  This required BL_ArmatureObject to have tighter control over armatures and poses.
  Also, (Blender) armature objects are now copied instead of shared between
  BL_ArmatureObjects to avoid race conditions. Also, due to the armature copy,
  shape key drivers need a bit of extra fiddling to get the correct armature copy.
  
  Initially OpenMP was used for threading, but then BLI_task was used due to being
  less compiler dependent.
  
  This commit also places time spent on skinning updates in the Animation
  profiler category (was previously under the Rasterizer category).
After using `git bisect` to find the bug-introducing commit, I found this one: fe05f97841c0ee3e2a6e15f2252ad160fefc3509 is the first bad commit commit fe05f97841c0ee3e2a6e15f2252ad160fefc3509 Author: Mitchell Stokes <mogurijin@gmail.com> Date: Sun Apr 6 16:30:59 2014 -0700 ``` BGE: Multi-threading animation updates and skinning. This required BL_ArmatureObject to have tighter control over armatures and poses. Also, (Blender) armature objects are now copied instead of shared between BL_ArmatureObjects to avoid race conditions. Also, due to the armature copy, shape key drivers need a bit of extra fiddling to get the correct armature copy. Initially OpenMP was used for threading, but then BLI_task was used due to being less compiler dependent. This commit also places time spent on skinning updates in the Animation profiler category (was previously under the Rasterizer category).

Added subscribers: @Moguri, @dr.sybren

Added subscribers: @Moguri, @dr.sybren

@Moguri do you have any idea what could be the root cause?

@Moguri do you have any idea what could be the root cause?

Added subscriber: @bobson

Added subscriber: @bobson
Sybren A. Stüvel self-assigned this 2015-02-14 22:30:52 +01:00

Removed subscriber: @sybrenstuvel

Removed subscriber: @sybrenstuvel

This issue was referenced by bf157ce927

This issue was referenced by bf157ce9277ba1011a6e317c7629bab0dd8c36a5

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit bf157ce927.

Closed by commit bf157ce927.
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
Interest: X11
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
No Assignees
4 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#42919
No description provided.