Quat/Euler Rotation Mode Converter

This is a script based in the one that Mutant Bob wrote in BlenderStackExchange here, in request to a question of mine (aka he did the hard code). Thank him!

This script/addon:

- Changes (pose) bone rotation mode
- Converts keyframes from one rotation mode to another:
    - Creates fcurves/keyframes in target rotation mode
    - Deletes previous fcurves/keyframes.
- Converts multiple bones
- Converts multiple Actions

EDIT: @draguu fixed the installation as an addon. Thanks!

Here is the GitHub (currently 0.2).
And here I upload a file to test.
IMPORTANT: the file uploaded here has 0.1 version. Please, download last version from Github.

From Quaternion:


To Euler:


Attachments

quat_euler_rotation_mode_converter.blend (538 KB)

Thanks a lot @Mario_Mey,

Very clever idea so difficult to code! A great Thks.
Congratulations. :spin:

Hello! I have recently tried to install this super useful plugin in Blender 2.76b, however I receive the following error. Is this something that could be fixed? Thanks a lot for your work!

Modules Installed from ‘C:\Users\User\Downloads\rotation_mode_addon-master\rotation_mode_addon-master\change_rotation_mode_addon.py’ into ‘C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.76\scripts\addons’ (change_rotation_mode_addon)
Traceback (most recent call last):
File “C:\Program Files\Blender Foundation\blender-2.76b-windows64\blender-2.76b-windows64\2.76\scripts\modules\addon_utils.py”, line 324, in enable
mod = import(module_name)
File “C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.76\scripts\addons\change_rotation_mode_addon.py”, line 244, in <module>
initSceneProperties(bpy.context.scene)
AttributeError: ‘_RestrictContext’ object has no attribute ‘scene’

Hey, +peter, I’m glad this addon is usefull for you. Like I say in the post, it has a GitHub page (here), where anyone can be part of this addon development. Also, there is the place to report bugs!

Anyway, I was looking about your error… and I found what’s happening. It is about a new (from 2.6) restriction to access bpy.context (and bpy.data) when the addon is registred. As I get some code to make the addon buttons from who-knows-where… I think I did it in an old way. Soooo…

As I don’t have time to fix this, I tell you about the “workaround”. Don’t activate the addon from Preferences, but you have to run the script from the text panel. Open the file there and click in “Run script”. In this way, the addon is active and you will find in Tools Panel.

I edited the post to warn about this, thanks! Also, I reported the issue here. Maybe, another buddy has more time than me to fix it!

Hey Mario, thanks for getting back to me. Yeah, the script works fine, running from the text editor itself. Thanks for your work!

wtf is a euler?

fdfxd: before using an expression like “wtf”, you could google “euler”.

I get this error message when trying to install the addon on MAC OS, blender 2.76.5 from buildbot


Gotcha!, thanks buddy, hopefully this can be fixed sometime soon, and it would just add a button next to the EulerQuaternion dropdown, or better yet be done automatically when you change from one to the other :wink:

Hello, I’m new to blender and I’m trying to get this to work. I have pasted the text of the script on the text panel and click on run script but no tool tab as the one in the image appears. I’m using Blender 2.77 on a Mac from the terminal, I don’t get any error message, I have tried other scripts and they run ok, but this one does not do anything. I’d appreciate any help, I’ve spent two days and can’t get this to work :frowning:
Thanks!!

Eduman, try:

  • open 2.77
  • paste code in Text panel
  • click on “Run Script”
  • delete the default Cube
  • add an Armature
  • enter in Pose Mode
  • look in the Tool Shelf (left panel) (press T key if it is not there) - Tools tab.
  • Quat/Euler Converter should be there, below History.

Very helpful thanks!

here is a working code. for installing as an addon ,

try it
http://pasteall.org/95644/python

hope it helps

Thanks, man! :ba:
I upgraded to 0.2 with your fix. You are named in version log.

nice!!!, i’m glad!

Mario Mey, you are a master jedi! Great many thanks to you and Mutant Bob for creating this addon! You saved me. I found it on stackexchange while were googling the same question as was yours. May the force of blender be with you! :wink:

You’re welcome, man!
:ba: (the closest thing to a Jedi is Mister T)

THANK YOU SO MUCH!!! You just saved me like a week of manual frustration!

You’re welcome!

Remember that frustration is necessary to get stronger… if you are a kid.

Oh, you are a grown-up…? Stay away from that, it’s a pain in the ass!

Ah man, I can’t get this to work. I tried these steps:

  • open 2.77
  • paste code in Text panel
  • click on “Run Script”
  • delete the default Cube
  • add an Armature
  • enter in Pose Mode
  • look in the Tool Shelf (left panel) (press T key if it is not there) - Tools tab.
  • Quat/Euler Converter should be there, below History.
    … to enable the script for an existing blend file of mine but I just get nothing. I’ve teared out enough hair out over this quaternion business as it is. Someone help. Please?