Blender rig exporter/animation importer

I’ve developed a plugin for Roblox that can export any Roblox rig into Blender and generate a Blender Armature (rig) equivalent to the Roblox one using the accompanying Blender addon. Then, in Blender an animation can be designed. When done, the Blender addon can be used to generate Roblox animation data equivalent to the animation designed in Blender. Using the Roblox plugin, this can be imported back into Roblox again.

Note: Skinned meshes/bones are not supported. If you want to animate a skinned mesh you probably want to use the built-in .fbx animation importer instead.

Experiencing issues? Check the “Common issues” section in this post for solutions to common problems!

Installing

Use this Roblox plugin: Blender rig exporter/animation importer - Roblox

Use this Blender addon (save as “something.py”):
Blender 2.80, 2.82, 2.91, 2.93+: https://pastebin.com/raw/V5aBemWL
Blender 2.79: No longer maintained.

Modified addon code from @XAXA which auto-adds various constraints for R15 rigs to limit rotations of some joints and properties to selectively disable transformations of certain bones on export: Blender rig exporter/animation importer - #214 by XAXA (Mostly useful to adjust imported animations and blocky rigs, see the post for details…) (note: now very slightly outdated, but still compatible as long as you use the older Blender 2.79)

Old Blender addon version

2.80+: https://pastebin.com/raw/Ehh9epGZ
2.79: https://pastebin.com/raw/B3cTejNi

(Blender 2.80 beta version)
https://pastebin.com/raw/TwaP10Vx

(Also current version)
https://hastebin.com/raw/xomulazalu

(Old version)
https://gist.githubusercontent.com/anonymous/a3f3401e8bc607366111cbdc2bdfbc71/raw/94a1280b5cab39a1575dc4c1f070ddf38d5ae747/rbxblender.py

(Older version)
https://gist.githubusercontent.com/anonymous/53c9a149b35e5f2910276cf4657fd4e1/raw/aa4aaae4c0c15e6c69cb8b738dd3a41fb1c1a423/rbxblender.py

(Prehistoric version)
https://gist.githubusercontent.com/anonymous/7740bb5685cc60632563cb3536fe5ddd/raw/728194dfd4dd4b5dc3d3b6d46b769c31dbf1d60a/rbxblender.py

(Pre-earth version) https://gist.githubusercontent.com/anonymous/08965641f2fe3825c480eb7faacf9fb6/raw/429fed6ff0670e2612feca8e9d537c1b9dfe4b62/rbxblender.py

Blender 2.80: Install Blender addon though Edit → Preferences → Add-ons → Install from file → (select that one)
Blender 2.79: Install Blender addon though File → User preferences → Add-ons → Install from file → (select that one)

Example use cases

  • Using a more sophisticated animation editor than Roblox Animation Editor plugin. You can use all constraints in Blender to help designing animation, most notably the inverse kinematics constraints.
  • Record physics simulations in Blender to an animation which can then be played in a reliable way in Roblox.
  • Motion capture animations.
  • Import animations from external sources into Blender, then import back into Roblox.

Cool Mixamo animation I’ve stolen from @Santa_Root :stuck_out_tongue:

https://i.gyazo.com/aee78132723103855e33b6d9e3e2389c.mp4

Common issues

If you experience issues while importing, check the following things first:

  • Make sure you’re using the most recent plugin and addon versions. Incompatible versions can lead to various errors! Check the top of this post for the latest versions. If you’re getting an error containing object.name = partnames[-index] in Blender you’re definitely using an outdated addon version!
  • Ensure no warnings are shown in the importer/exporter plugin when clicking the rig in Roblox.
  • Ensure the rig loads properly when using the default Roblox animation editor. The importer/exporter Roblox plugin barely does any error checking, but the Roblox animation editor can provide helpful error messages indicating issues with your rig.
  • Humanoid appearances (like clothing) do not get imported automatically anymore to work around Roblox changes interfering with this plugin. This is does not affect animation imports. Want those Humanoid-specific things to be visible anyway? You can manually export an obj of the character from Studio and import that into Blender (using the regular .obj importer), then manually link each imported mesh to the bones generated originally by this plugin.
  • Rig Motor6Ds are expected to be a direct child of the parent part in the rig tree (typically a direct child of Part0). Other locations may cause the plugin to not find the joint. For regular R6/R15 rigs this is the case by default, usually.

Very basic how-to-use guide for Blender 2.80

  • In Roblox, enable the plugin, click a Rig
  • If successful, the GUI will appear
  • Click “Export rig”, save the .obj file somewhere
  • In Blender, go to File → Import → Import the .obj file.
  • In Blender, in the right panel in the 3D view (press N if invisible), open the Rbx Animations tab, then click Rebuild rig. (Bones should be generated after clicking this button.)

  • Select the created Armature, enter Pose mode (Tab → Pose mode).
  • Move/rotate a bone, then create a keyframe (Make sure to select the LocRot keying set) (Or enable auto keying):
  • Create another keyframe at another timestamp.
  • Click Export animation in the right panel. This copies text to the system clipboard.
  • In Roblox, click “Load large animation”, paste the text copied to the system clipboard. The animation will now be loaded in Roblox.
  • Click “Upload animation” to upload it to Roblox as a Roblox animation.

Very basic how-to-use guide for Blender 2.79

Very basic how-to-use guide for Blender 2.79
  • In Roblox, enable the plugin, click a Rig
  • If successful, the GUI will appear
  • Click “Export rig”, save the .obj file somewhere
  • In Blender, on the left panel in the 3D view (press T if invisible), open the Animation tab, under Rbx Animations, select Import model. Import the .obj file.
    c4d59cc5c9f4ce6071eaf7b7c34395865e95ee9a.png
  • Click Rebuild rig in the left panel. (Bones should be visible now)
  • Select the created Armature, enter Pose mode.
  • Move/rotate a bone, then create a keyframe (Make sure to select the LocRot keying set) (Or enable auto keying):
  • Create another keyframe at another timestamp.
  • Click Export animation in the left panel. This copies text to the system clipboard.
  • In Roblox, click “Load large animation”, paste the text copied to the system clipboard. The animation will now be loaded in Roblox.
  • Click “Upload animation” to upload it to Roblox as a Roblox animation.

Video tutorial of the above steps (Blender 2.97): Roblox | Blender rig exporter/animation importer | Tutorial - YouTube (by @Santa_Root)

Importing FBX animation data into the generated armature

(Thanks to @Santa_Root for the awesome idea to use Mixamo animations!)

Just use the “Import FBX” button. The FBX file should contain one rig/armature with animation data. That animation data is then loaded and mapped to the generated armature. Technique used to convert is the same as described in the next section, but animation length is automatically derived too during import.

See also Blender rig exporter/animation importer - #30 by Den_S

Mapping arbitrary armatures to the generated armature (__Rig)

Mapping arbitrary armatures to the generated armature (`__Rig`) (Advanced)

If you export the Blender armature to another tool to animate using something other than Blender, then later import the armature back again (for example, Mixamo animations), you cannot just replace the original __Rig armature. This armature contains some important metadata.
The utility script below can map bones from one armature (called __Rig2) to the __Rig armature (based on bone names). This mapping is done in armature space. This script will also convert transformations done on the HumanoidRootPart to all childs of the HumanoidRootPart (In Roblox, the HRP should be stationary). It is assumed that all bones existing in __Rig also exist in __Rig2.
Before running the script, go to __Rig its Pose mode and select all the bones you want to create keyframes for (typically all).

Just use the “map keyframes by bone name” button within Blender. It will map the selected armature onto the generated armature by bone name. You have to set the frame range properly first though, as only frames during the set frame range will be mapped!

Generate IK constraints

In the left panel, click “Create IK constraints” to quickly generate IK constraints. In Pose mode, first select one or more bones at the end of the IK chain (e.g. feet, hands), then use the tool to generate the constraints. You can optionally generate pose bones too (recommended for long chains). You probably need to tune some constraint parameters after generating one, though…

Parameters

The scene frame start and end times determine how long the animation is in frames. The frames per second value determines how long each frame is during the conversion. The frame step parameter can be increased to reduce the sampling rate. For high quality animations, use a step rate of 1 at 30 fps. Increasing the value to a value between 2 and 5 results in smoother animations, typically (but it varies depending on the type of animation you create).

Sample rig

If you just want to try it out, you can use this place file containing a single R15 rig: RigSample.rbxl (20.3 KB)

Enjoy :stuck_out_tongue: .

1236 Likes
Custom Rigs and Animations from Blender
Tips on meshing? ( I have no idea how to make a mesh )
Different Movements upon Animation being Played
Rig wont move, only bones (BLENDER)
Rig not exporting into blender properly
[FILLED] $75 - Import a bunch of animations from mixamo to roblox
I'm having a little bit of trouble with blender
Alternatives to Den_S' Blender Rig Importer / Exporter plugin?
Importing meshes wont import animations
First Blender Animations: AKM (Feedback)
Blender Animation import?
How to import 2 animations from Blender to Roblox?
Best way to handle moving animations
How to export blender animation?
Animation > Importing to blender the character
How do I make IK constraints for custom rigs?
How do I import a Roblox character rig into Blender? (Efficiently)
How to import blender animations to roblox studio?
Is it possible to export Blender animations to Roblox Studio?
How to rig a blender model?
Roblox Rig Won't Work When I Rig it in Blender
Can someone please give me a Pre-Rigged r15 model?
Fix animation not importing from blender
Blender Traceback Error when "Rebuild rig"
Roblox Studio crashes everytime I try to animate with IK
Blender Development Resources
How to import model with bones to blender?
Importing/Exporting a Roblox R6 rig to/from Blender?
Is there a way to convert .rbxm animations in .fbx format?
How to make animating tool easier
Maya animations --> Roblox
Rigging your Roblox character in Blender for GFX
I'm can't import blender animation to roblox
Need Help Importing animation from blender to roblox
Built in Video to Motion Captured Animation
Camera Manipulation Rig + Effects Module
How to use blender for animation?
What are you working on currently? (2017)
Looking for an animator to do several character animations
What are you working on currently? (2019)
Blender 2.8 View Model Tutorial (FPS ARMS)
What are you working on currently? (2019)
How to align mesh accesories?
Feedback on my first GFX!
Way to port roblox anims to blender?
List of a few useful game development resources
Is there a way to animate Roblox characters without using the standard Roblox animation editor?
Creating a realistic build and animation
Links to Useful DevForum Posts About Blender
Model Animation Tutorial ( Blender and Studio )
Bloxxer's Studio Development Setup
Feedback on second GFX (ft. pig121343)
How do i export a roblox model to separated parts?
Animation cubic easing direction reversed
Best way to make cutscenes
How to make bone stay still while animating using r6 rig in blender?
Does roblox allow us to upload R15 animations with a different hierarchy?
How to export roblox models into blender (not in one)
Animation is working correctly when in animation editor, but not in game?
I need help for Blender 2.8
[CLOSED] [5000 R$] Import 11 Animations from Mixamo to Roblox
Free Blender Light Set Up For Character Renders
Roblox studio blender plugin crash
Feedback on 4 animations
Help rigging view models for Blender animations
1.0 [Blocky] Layered Clothing - Resources
Blender Animation on Roblox Studio
Coroutine.yield() not yielding
How do I play an animation exported from blender
Writing an FPS framework (2020)
Issue with IK constraints on rig when imported to Roblox (Blender)
Prompt user to load/save file from plugin
Any Good Moon Animator Alternatives?
How do you export Roblox animations into blender
Skinned/Deformation Rigs: Your Pro Guide
How do I animate two people at a time?
So how do you animate R15 models now in Blender?
R15 Animations support
Blender animations
This way in blender, but imports like this in roblox
Are there any Good Roblox Rigs for Blender 2.82?
Importing animations from blender to roblox
Blender animations
How to Import/Fix Skinned Mesh Rigs/Custom Rigs and Animations from Blender To Roblox
Mixamo animations
[OUTDATED] Fix Blender Animations
Using Mixamo to make easy animations for skinned meshes (A full tutorial! Be prepared) (Bug fix included)
How to freely animate tools/items
Can't export my animation (R6) from blender to roblox
How to import model with bones to blender?
[CLOSED] Nanie_l (3D Animation/Rigging)
Best way to make roblox animations on blender
Excellent R15 animations🤩
[R6]: Run + Walk Animations
Inserting Object Animations from Blender into Studio

Enjoy!

I’ll provide a video tutorial soon.

114 Likes

Wow, that’s great!

Hey @maplestick, check this out!

64 Likes

i love you

148 Likes

Looks like its time to start animating furry packages!

(whenever I get the time)

53 Likes

https://www.youtube.com/watch?v=rksbvwG7x9o Video tutorial :slight_smile:

82 Likes

Custom rig support such as FPS animations(reloads etc)???

43 Likes

It supports custom rigs too.

46 Likes

this has to public its so amazing

38 Likes

Omg omg omg thanks +1^1000000000000

33 Likes

Now all I have to do is learn how to animate in Blender… and use Blender.

Edit: Just learned how animating in Blender works since I never use Blender. I know the basic controls but this is wonderful.

54 Likes

Don’t you have a motion capture suit at your university/college ;)?

31 Likes

When using R15 with no package, could you add a option to lock the lower arms/legs to only rotate forward/back?

29 Likes

If you use IK, just lock the proper local bone axes in the IK panel of the Bone in Pose mode:

47 Likes

I do! Though i can only use the equipment at very special occasions. If i break one sensor on the suit i’ll have to pay over a thousand bucks.

39 Likes

Can you make a video on Mapping arbitrary armatures to the generated armatures?

23 Likes

See this for a demo on how to use it. Note how __Rig.001 is imported (armature + keyframe data in an imported fbx file). This rig is first renamed to __Rig2. Then I select the original generated __Rig, enter Pose mode, select all bones, then run the script. It will then (try to) match the bone state at each keyframe.

https://streamable.com/nmf42

27 Likes

Really dumb question, but how can i create a copy of myself in studio so i can import it in Blender?

31 Likes

Easiest is probably adding a new LocalScript called Animate in game.StarterPlayer.StarterCharacterScripts (the script has no contents). That way, whenever a character spawns, everything stays in the rest position w.r.t. the HumanoidRootPart.
Copy the character, then go out of play mode, then make sure to Anchor the HumanoidRootPart in your character before running the plugin.

28 Likes

You lost me at LocalScript, but i’ll see if i can find it. Thanks for the help!

27 Likes