rigify: rigs don't export well to game engines
#57536
Closed
opened 4 years ago by PaoloAcampora
·
35 comments
No Branch/Tag Specified
main
asset-shelf
brush-assets-project
blender-v2.93-release
blender-v3.3-release
blender-v3.4-release
xr-dev
blender-v3.2-release
blender-v3.1-release
screenshots-manual
gltf_vtree
blender-v2.83-release
blender-v3.0-release
xr-controller-support
studio-sprite-fright
asset-browser-poselib
blender-v2.92-release
blender-v2.91-release
blender-v2.90-release
greasepencil-addon
xr-world-navigation
soc-2019-openxr
blender-v2.82-release
blender-v2.81-release
filebrowser_redesign
blender-v2.80-release
blender2.7
blender-v2.79b-release
blender-v2.79a-release
blender-v2.79-release
fbx_experiments
blender-v2.78b-release
collada-2
blender-v2.78-release
rigify_fixes
fbx_io_export_ignore_parents
v2.93.14
v3.3.3
v2.93.13
v2.93.12
v3.4.1
v3.3.2
v3.4.0
v3.3.1
v2.93.11
v3.3.0
v3.2.2
v2.93.10
v3.2.1
v3.2.0
v2.83.20
v2.93.9
v3.1.2
v3.1.1
v3.1.0
v2.83.19
v2.93.8
v3.0.1
v2.93.7
v3.0.0
v2.93.6
v2.93.5
v2.83.18
v2.93.4
v2.93.3
v2.83.17
v2.93.2
v2.93.1
v2.83.16
v2.93.0
v2.83.15
v2.83.14
v2.83.13
v2.92.0
v2.83.12
v2.91.2
v2.83.10
v2.91.0
v2.83.9
v2.83.8
v2.83.7
v2.90.1
v2.83.6
v2.90.0
v2.83.5
v2.83.4
v2.83.3
v2.83.2
v2.83.1
v2.83
v2.82a
v2.82
v2.81a
v2.81
v2.80
v2.80-rc3
v2.80-rc2
v2.80-rc1
v2.79b
v2.79a
v2.79
v2.79-rc2
v2.79-rc1
v2.78b
v2.78a
v2.78
v2.78-rc2
v2.78-rc1
v2.77a
v2.77
v2.77-rc2
v2.77-rc1
v2.76a
v2.76
v2.76-rc3
v2.76-rc1
v2.75
v2.75-rc2
v2.75-rc1
v2.74
v2.74-rc4
v2.74-rc3
v2.74-rc2
v2.74-rc1
v2.73a
v2.73
v2.73-rc1
v2.72
v2.72-rc1
v2.71
v2.71-rc1
v2.70a
v2.70
v2.70-rc
v2.68
v2.67b
v2.67a
v2.67
v2.66a
v2.66
v2.65a
v2.65
v2.64a
v2.64
v2.63a
v2.63
v2.62
v2.61
v2.60a
v2.53
v2.54
v2.55
v2.56
v2.56a
v2.57
v2.57a
v2.57b
v2.58
v2.58a
v2.59
v2.60
v2.69
Labels
Apply labels
Clear labels
good first issue
legacy module/Animation & Rigging
legacy module/Core
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/User Interface
legacy module/VFX & Video
legacy project/2.81
legacy project/2.82
legacy project/2.83
legacy project/2.90
legacy project/2.92
legacy project/2.93
legacy project/3.0
legacy project/3.1
legacy project/3.2
legacy project/3.4
legacy project/Add-ons (BF-Blender)
legacy project/Add-ons (Community)
legacy project/Alembic
legacy project/Animation & Rigging
legacy project/Asset Browser
legacy project/Automated Testing
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Blender Cloud
legacy project/Code Quest
legacy project/Collada
legacy project/Compositing
legacy project/Core
legacy project/Cycles
legacy project/Datablocks and Libraries
legacy project/Dependency Graph
legacy project/Documentation
legacy project/EEVEE & Viewport
legacy project/Freestyle
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Physics
legacy project/Game Python
legacy project/Game UI
legacy project/Geometry Nodes
legacy project/Good First Issue
legacy project/Grease Pencil
legacy project/Images & Movies
legacy project/Import/Export
legacy project/Infrastructure: Blender Buildbot
legacy project/Infrastructure: Blender Web Assets
legacy project/Infrastructure: Websites
legacy project/Modeling
legacy project/Modifiers
legacy project/Motion Tracking
legacy project/Nodes
legacy project/Nodes & Physics
legacy project/OpenGL Error
legacy project/Overrides
legacy project/Papercut
legacy project/Physics
legacy project/Pillar
legacy project/Pipeline, Assets & I/O
legacy project/Platform: Linux
legacy project/Platform: macOS
legacy project/Platforms, Builds, Tests & Devices
legacy project/Platform: Windows
legacy project/Python API
legacy project/Render & Cycles
legacy project/Render Pipeline
legacy project/Sculpt, Paint & Texture
legacy project/Straightforward Issue
legacy project/Text Editor
legacy project/Tracker Curfew
legacy project/Translations
legacy project/USD
legacy project/User Interface
legacy project/UV Editing
legacy project/VFX & Video
legacy project/Video Sequencer
legacy project/Virtual Reality
papercut
Priority › High
Priority › Low
Priority › Normal
Priority › Unbreak Now!
Status › Archived
Status › Confirmed
Status › Duplicate
Status › Needs Information from Developers
Status › Needs Information from User
Status › Needs Triage
Status › Resolved
straightforward issue
Type › Bug
Type › Design
Type › Known Issue
Type › Patch
Type › Report
Type › To Do
No Label
good first issue
legacy module/Animation & Rigging
legacy module/Core
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/User Interface
legacy module/VFX & Video
legacy project/2.81
legacy project/2.82
legacy project/2.83
legacy project/2.90
legacy project/2.92
legacy project/2.93
legacy project/3.0
legacy project/3.1
legacy project/3.2
legacy project/3.4
legacy project/Add-ons (BF-Blender)
legacy project/Add-ons (Community)
legacy project/Alembic
legacy project/Animation & Rigging
legacy project/Asset Browser
legacy project/Automated Testing
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Blender Cloud
legacy project/Code Quest
legacy project/Collada
legacy project/Compositing
legacy project/Core
legacy project/Cycles
legacy project/Datablocks and Libraries
legacy project/Dependency Graph
legacy project/Documentation
legacy project/EEVEE & Viewport
legacy project/Freestyle
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Physics
legacy project/Game Python
legacy project/Game UI
legacy project/Geometry Nodes
legacy project/Good First Issue
legacy project/Grease Pencil
legacy project/Images & Movies
legacy project/Import/Export
legacy project/Infrastructure: Blender Buildbot
legacy project/Infrastructure: Blender Web Assets
legacy project/Infrastructure: Websites
legacy project/Modeling
legacy project/Modifiers
legacy project/Motion Tracking
legacy project/Nodes
legacy project/Nodes & Physics
legacy project/OpenGL Error
legacy project/Overrides
legacy project/Papercut
legacy project/Physics
legacy project/Pillar
legacy project/Pipeline, Assets & I/O
legacy project/Platform: Linux
legacy project/Platform: macOS
legacy project/Platforms, Builds, Tests & Devices
legacy project/Platform: Windows
legacy project/Python API
legacy project/Render & Cycles
legacy project/Render Pipeline
legacy project/Sculpt, Paint & Texture
legacy project/Straightforward Issue
legacy project/Text Editor
legacy project/Tracker Curfew
legacy project/Translations
legacy project/USD
legacy project/User Interface
legacy project/UV Editing
legacy project/VFX & Video
legacy project/Video Sequencer
legacy project/Virtual Reality
papercut
Priority › High
Priority › Low
Priority › Normal
Priority › Unbreak Now!
Status › Archived
Status › Confirmed
Status › Duplicate
Status › Needs Information from Developers
Status › Needs Information from User
Status › Needs Triage
Status › Resolved
straightforward issue
Type › Bug
Type › Design
Type › Known Issue
Type › Patch
Type › Report
Type › To Do
Milestone
Set milestone
Clear milestone
No items
No Milestone
Projects
Set Project
Clear projects
No project
Assignees
Assign users
Clear assignees
No Assignees
11 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#57536
Reference in new issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
No
Yes
Characters generated with rigify 0.5 won't work well when they are imported in external game engines, (Unity, Unreal etc.)
The reason is that rigify splits the deformation bones (layer 29) into separate chains for each module.
Once non deformation bones have been deleted, baked animations are likely break, and limbs won't follow the body.
We'll investigate how we can rework the hierarchy, in the meantime a conversion tool is being tested
Added subscriber: @PaoloAcampora
The attached addon converts rigify human (other rigs need testing) to a hierarchy that will work in Unity rigify_convert_gamefriendly.py
The panel Rigify Games will appear in the Armature properties when a rigify rig is in edit mode
Added subscribers: @dfelinto, @icappiello, @LucioRossi
Added subscriber: @angavrilov
Be mindful of blender/blender#54159, blender/blender#52063.
Specifically, animations for rigs that use non-uniform scaling on parented bone chains (i.e. all common stretchy rig setups with Stretch To) cannot be correctly baked, and thus often cannot be correctly exported. The only workarounds are to either not use non-uniform scaling (no fancy stretchy rigs), or unparent all bones.
Added subscriber: @viadvena
Could you Please refresh this script for 2.81? I am stuck: when I exporting rigify there is damn distortion only in fbx, in original scene all just fine. I tried many ways but no luck((( And fbx only deform doesnt work with rigify - a lot of ORG bones in fbx file.
Your call for help was heard, brave blenderhead. I tried a quickfix and it worked on my characters.
Please check the attachment and update the addon. Hit "Make Game Friendly" in edit mode (Armature properties)
It will change the deformation hierarchy and hopefully fix your exports
rigify_convert_gamefriendly_1.01.zip
regards,
Paolo
@PaoloAcampora Hello! Thank you for your attention, but may be I am too slow or too tired but: I deleted old version of script and install new one but no sign of life in the list of addons. Blender just said that he is copied script in my config folder(( I am sorry that I still bringing not successful news.
Hi, that's correct: it won't display in the addons. Not sure why, probably I am missing some description required by 2.8. I cannot check that today, but please select your rig and look in your Armature properties
On my system the button is present once the addon has been installed, even if it does not show up in the list. If you have no such button, please load the .py file in the text editor and execute (Alt+P).
P.S. I have tried to export an fbx and load it into Unity. Now the animation is usable, but there is still the skew problem from the other ticket (expect big head around frame 99). I have to study the problem before I can fix this: this might be due to the stretch constraints used on the spline bones. Temp fix: add Limit Scale constraints to the DEF-spine and hat bones
regards,
Paolo
@PaoloAcampora, check if this feature https://developer.blender.org/D5588 implemented by @angavrilov can be of any help once the rig goes to fbx
@PaoloAcampora Thank you, sir! Now it's working from text editor. Unwanted scale still there after exporting but now I can just delete all scale keys and distortion gone. Hierarchy much better but there is still ORG Spine bones. I hope this things will be fixed soon and your addon will be perfect. And it would be awesome seeing it inside Rigify toolbar natively in Blender master.
I think your addon need thread on Blender Artists, not everybody reach this place) Thank you for your work!
@icappiello
Not tested yet but I'm pretty sure that would fix the shear
@viadvena
Yes, there is still some work to do: this tool has been written last year in a hurry to help people left stuck with non working .fbx files.
We should definetely give a round of tests and eventually add it to rigify tools, possibly along some UE4 and Unity metarigs. Then spread the good news to the world
Please keep us updated
regards,
Paolo
Added subscriber: @mzprox
I like rigify and a good game export option is on my wishlist on highest priority.
Besides getting the export deform only work right, which your script hopefully solves, (I couldn't test it as for me the button was greyed out..) there is an other problem that somewhat breaks ue4 compability: the position of the twist bones, I mean the hand shouldn't be parented to the twistbone, but rather the forearm bone. The "rigify way" can make some ik setup problematic (two bone ik when there are actually four bones in the chain.
I1m not sure how this could be fixed, the way I tried is to generate single segmented bones for rigify and wrote a small script to duplicate the limb bones which serve as twists. Then set up the hiearchy and constrains.. the problem this is quite crude method and I can't really code.. just collecting codepieces i find on the net.
There is a good script btw:
https://github.com/chichige-bobo/BlenderPython/blob/master/RigifyToUnreal/RigifyToUnreal.py
Which solved the export issue by generating a new skeleton and baked the animations onto the new rig with correct hiearchy. Unfortuanatelly it doesn't work above 2.79.
Would be nice if it was fixed and maybe improved.. (The original author seems to have abandoned coding/blender)
Added subscriber: @Frizzil
Take a look at this script:
https://gitlab.com/ioflowstudios/rigify-ue4-exporter
Would be cool if this addon was built into rigify and expanded upon to probably support different bone sets, different game engines etc.
Added subscriber: @TodorNikolov
Added subscriber: @carlosmu
Awesome!! It works for me!
The only change I was made is in the line 8.
I change this to:
Otherwise it was impossible to install the addon.
Do you have it on github?
Hi Carlos, great it works for you too
Yes, you can find it here
https://github.com/pKrime/python-snippets/blob/master/blender_addons/rigify_convert_gamefriendly.py
And yes, theat 01 was preventing the script from showing up, how lame of me! :)
Cheers
Added subscriber: @phelioz
The rigify_convert_gamefriendly.py dosen't show up in the menu, have to run the it in the text editor to show up. And when it shows up nothing happens when clicking the button. I am in edit mode and have the Rigify generated armature selected.
But found a Rigify fork made for games and it works great for me
BlenderGameRig: https://github.com/SAM-tak/BlenderGameRig
Hi Gustav,
That's correct for the script that has been posted here, yet it is fixed in the github repo
https://github.com/pKrime/python-snippets/blob/master/blender_addons/rigify_convert_gamefriendly.py
If it's possible, you can attach a .blend file containing your rig (armature only), and I will try to see what's not working in the script
Looks great indeed, I wonder if it can be made into a rigify extension. My script was intended as a first aid for those who wanted to export already made characters. I agree that starting with a game oriented solution in the first place would be a better approach until rigify will support game engines explicitly
regards,
Paolo
I don't mean to say that your script isn't nice, most of all I would like to have a solution where I can just use a regular Rigify rig in my games. Because Rigify is officially included which this BlenderGameRig is not. It doesn't have the same support in that way.
So if your script worked for me it would be great :)
The github version was the one I used. Running Blender 2.83. I get this error on the most simple of scene, I newly generated Rigify rig. Appreciate that you want to fix the script :)
rigify_test.blend
Also check this! Is very similar.
https://github.com/AlexLemminG/Rigify-To-Unity
Hi Gustav,
please worry not: no offence was ever taken! At the moment, all that the script does is to reorder the deforming bones into a single hierarchy, so that an fbx exported with "Only deform bones" enabled, will retain the animations and a nice tree. No renaming will happen.
I have tried it on your .blend and it seems to work. I have never used Mecanim so far, so I cannot tell you which steps can be taken from then on.
Please make sure the one you got is up to date: as reported by Carlos, a typo was responsible for the addon not being listed. Also, I have just fixed a version warning, so you might want to download again
Kind regards,
Paolo
Good :) Will then test it again when I get back home in a couple of days. Seems I have done something strange on my end. Will redownload it and try again. Not using Mecanim because I am not using Unity. I use Godot. Thanks for the help!
Carlos that rigify to unity script seems nice but made only for humanoids plus I don’t use unity. I am using Godot.
Hello Gustav!!
"Rigify to Unity" is usefull not only for Unity. This addon fix the deformable bones hierarchy (like a tree), and delete some unnecesary bones (at least for mobile performance requirements, like wrist rotation bone).
That's cool Carlos, could be useful then :). But I am creating non humanoid characters and it seams like it only supports humanoid unfortunately
Added subscriber: @Loganahogan
This is incredible! Thank you so much!
Added subscriber: @OscarFranco
Changed status from 'Confirmed' to: 'Archived'
I think this task can be closed: AFAIK there are no plans, and few reasons, to change rigify architecture only to accomodate games.
The issue is now well known and there are many solutions around, my original solution has evolved into a bigger add-on that can be found here
https://github.com/pKrime/Expy-Kit