Copy Global Transforms addon ignores global transforms when used on a bone with a Child of constraint #105118

Closed
opened 2024-01-13 09:10:29 +01:00 by Raymond-Luc · 5 comments

System Information
Operating system: Windows 10 Pro 64-bit (10.0 Build 19045)
Graphics card: Nvidia Geforce RTX 2060 Super

Blender Version
Broken: Version 4.1.0 Alpha, 4.01, Version 3.6
Date 2023-11-16 14:21
Hash: 3343a3fc4d
Branch: PR114407

The Copy Global Transforms Addon does not apply global transformations once there is a Child of Constraint active on the selected bone. In 3.6 the paste operator in Copy Global Transforms does not paste the Global transforms buts still sets a keyframe, however in 4.0 and above it errors out (see error message below).

Steps to reproduce the Copy Global Transforms issue:

  1. Enable the Copy Global Transforms addon
  2. Open the N panel and go to the Animation Tab, then expand the Global Transforms menu
  3. Select the AutoRigPro armature in the viewport named rig and go into pose mode
  4. go to the first frame, select the foot control and use the Copy operator.
  5. Go to the last frame and use the Paste operator.

Repeat steps 3-5 using the Armature in the Simplified Rig collection.

File "E:\Programs\Blender\Experiemtnal Builds\blender-4.1.0-alpha+main.29b1658124b8-windows.amd64-release\4.1\scripts\addons\copy_global_transform.py", line 370, in execute
    return applicator(context, mat)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Programs\Blender\Experiemtnal Builds\blender-4.1.0-alpha+main.29b1658124b8-windows.amd64-release\4.1\scripts\addons\copy_global_transform.py", line 436, in _paste_current
    set_matrix(context, matrix)
  File "E:\Programs\Blender\Experiemtnal Builds\blender-4.1.0-alpha+main.29b1658124b8-windows.amd64-release\4.1\scripts\addons\copy_global_transform.py", line 171, in set_matrix
    AutoKeying.autokey_transformation(context, bone)
  File "E:\Programs\Blender\Experiemtnal Builds\blender-4.1.0-alpha+main.29b1658124b8-windows.amd64-release\4.1\scripts\addons\copy_global_transform.py", line 150, in autokey_transformation
    cls.key_transformation(target, options)
  File "E:\Programs\Blender\Experiemtnal Builds\blender-4.1.0-alpha+main.29b1658124b8-windows.amd64-release\4.1\scripts\addons\copy_global_transform.py", line 132, in key_transformation
    keyframe("location", target.lock_location)
  File "E:\Programs\Blender\Experiemtnal Builds\blender-4.1.0-alpha+main.29b1658124b8-windows.amd64-release\4.1\scripts\addons\copy_global_transform.py", line 129, in keyframe
    cls.keyframe_channels(target, options, data_path, group, locks)
  File "E:\Programs\Blender\Experiemtnal Builds\blender-4.1.0-alpha+main.29b1658124b8-windows.amd64-release\4.1\scripts\addons\copy_global_transform.py", line 106, in keyframe_channels
    target.keyframe_insert(data_path, group=group, options=options)
ValueError: bpy_struct.keyframe_insert(): 'INSERTKEY_XYZ_TO_RGB' not found in ('INSERTKEY_NEEDED', 'INSERTKEY_VISUAL', 'INSERTKEY_REPLACE', 'INSERTKEY_AVAILABLE', 'INSERTKEY_CYCLE_AWARE')```

System Information Operating system: Windows 10 Pro 64-bit (10.0 Build 19045) Graphics card: Nvidia Geforce RTX 2060 Super Blender Version Broken: Version 4.1.0 Alpha, 4.01, Version 3.6 Date 2023-11-16 14:21 Hash: 3343a3fc4d Branch: PR114407 The Copy Global Transforms Addon does not apply global transformations once there is a Child of Constraint active on the selected bone. In 3.6 the paste operator in Copy Global Transforms does not paste the Global transforms buts still sets a keyframe, however in 4.0 and above it errors out (see error message below). Steps to reproduce the Copy Global Transforms issue: 1. Enable the Copy Global Transforms addon 2. Open the N panel and go to the Animation Tab, then expand the Global Transforms menu 3. Select the AutoRigPro armature in the viewport named rig and go into pose mode 4. go to the first frame, select the foot control and use the Copy operator. 5. Go to the last frame and use the Paste operator. Repeat steps 3-5 using the Armature in the Simplified Rig collection. ``` File "E:\Programs\Blender\Experiemtnal Builds\blender-4.1.0-alpha+main.29b1658124b8-windows.amd64-release\4.1\scripts\addons\copy_global_transform.py", line 370, in execute return applicator(context, mat) ^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Programs\Blender\Experiemtnal Builds\blender-4.1.0-alpha+main.29b1658124b8-windows.amd64-release\4.1\scripts\addons\copy_global_transform.py", line 436, in _paste_current set_matrix(context, matrix) File "E:\Programs\Blender\Experiemtnal Builds\blender-4.1.0-alpha+main.29b1658124b8-windows.amd64-release\4.1\scripts\addons\copy_global_transform.py", line 171, in set_matrix AutoKeying.autokey_transformation(context, bone) File "E:\Programs\Blender\Experiemtnal Builds\blender-4.1.0-alpha+main.29b1658124b8-windows.amd64-release\4.1\scripts\addons\copy_global_transform.py", line 150, in autokey_transformation cls.key_transformation(target, options) File "E:\Programs\Blender\Experiemtnal Builds\blender-4.1.0-alpha+main.29b1658124b8-windows.amd64-release\4.1\scripts\addons\copy_global_transform.py", line 132, in key_transformation keyframe("location", target.lock_location) File "E:\Programs\Blender\Experiemtnal Builds\blender-4.1.0-alpha+main.29b1658124b8-windows.amd64-release\4.1\scripts\addons\copy_global_transform.py", line 129, in keyframe cls.keyframe_channels(target, options, data_path, group, locks) File "E:\Programs\Blender\Experiemtnal Builds\blender-4.1.0-alpha+main.29b1658124b8-windows.amd64-release\4.1\scripts\addons\copy_global_transform.py", line 106, in keyframe_channels target.keyframe_insert(data_path, group=group, options=options) ValueError: bpy_struct.keyframe_insert(): 'INSERTKEY_XYZ_TO_RGB' not found in ('INSERTKEY_NEEDED', 'INSERTKEY_VISUAL', 'INSERTKEY_REPLACE', 'INSERTKEY_AVAILABLE', 'INSERTKEY_CYCLE_AWARE')```
Raymond-Luc added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2024-01-13 09:10:29 +01:00

Thanks for the report. Could you perhaps take some time to minimize the example blend file? It now contains a full rig, with custom bone shapes and a whole bunch of hidden layers. The title of this report suggests that it's only about the Child Of constraint. A simple example that has only a few bones will help me a lot trying to figure out what's going on exactly.

Update: having said that, I don't think the error shown is caused by the Child Of constraint. It seems to be an issue with the auto-keying code of that add-on. I'll fix that first.

Thanks for the report. Could you perhaps take some time to minimize the example blend file? It now contains a full rig, with custom bone shapes and a whole bunch of hidden layers. The title of this report suggests that it's only about the Child Of constraint. A simple example that has only a few bones will help me a lot trying to figure out what's going on exactly. **Update:** having said that, I don't think the error shown is caused by the Child Of constraint. It seems to be an issue with the auto-keying code of that add-on. I'll fix that first.

I've fixed the keyframe_insert() error (c2caf1f3f5). Please check with tomorrow's daily build of 4.1.0 (alpha) to see if your issue was fixed.

I've fixed the `keyframe_insert()` error (c2caf1f3f5b56a7884f7cf138560d399ff04cd9c). Please check with tomorrow's [daily build of 4.1.0 (alpha)](https://builder.blender.org/download/daily/) to see if your issue was fixed.
Sybren A. Stüvel added
Status
Needs Information from User
and removed
Status
Needs Triage
labels 2024-01-15 11:39:05 +01:00
Author

Sure thing Will test the new build when its ready!

Sure thing Will test the new build when its ready!
Author

Update, the error no longer shows up! The paste however still doesn't copy the global transformations. Here's a simplified test file:

Update, the error no longer shows up! The paste however still doesn't copy the global transformations. Here's a simplified test file:

Update, the error no longer shows up! The paste however still doesn't copy the global transformations.

This is a limitation of the add-on. It just adjusts the bone's loc/rot/scale properties so that it matches the global transform. This doesn't take any constraints into account. You'll see that, when you disable the Child Of constraint, the bone is exactly at the spot that you copied.

As this is not seen as a bug, just a limitation, I'll close this report.

Do know that I'm working on a different way to do this copy-pasting, that should work with any offsetting constraint as well. It'll take a while to get production-ready though.

> Update, the error no longer shows up! The paste however still doesn't copy the global transformations. This is a limitation of the add-on. It just adjusts the bone's loc/rot/scale properties so that it matches the global transform. This doesn't take any constraints into account. You'll see that, when you disable the Child Of constraint, the bone is exactly at the spot that you copied. As this is not seen as a bug, just a limitation, I'll close this report. Do know that I'm working on a different way to do this copy-pasting, that should work with any offsetting constraint as well. It'll take a while to get production-ready though.
Blender Bot added
Status
Archived
and removed
Status
Needs Information from User
labels 2024-01-22 14:16:06 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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-addons#105118
No description provided.