# Importing rigged/animated 3D models from Blender

**URL:** <https://discourse.slicer.org/t/importing-rigged-animated-3d-models-from-blender/1432>\
**Category:** Support\
**Tags:** 3d-model\
**Created:** [November 10, 2017, 3:14pm UTC](https://discourse.slicer.org/t/importing-rigged-animated-3d-models-from-blender/1432 "2017-11-10T15:14:22Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdx-john](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@jdx-john](https://discourse.slicer.org/u/jdx-john)\
**Post date:** [November 10, 2017, 3:14pm UTC](https://discourse.slicer.org/t/importing-rigged-animated-3d-models-from-blender/1432/1 "2017-11-10T15:14:22Z")

</div>

1. I know Slicer has some built-in support to load static polygon meshes, where is it documented what formats? I think I saw mention of STL and OBJ so far
2. We have a medical device being modelled, with animations, in Blender. As I understand, multiple poses of a skeletally-rigged model. We’ve come across some VTK support from skinned animations ([https://www.vtk.org/doc/nightly/html/classvtkWeightedTransformFilter.html](https://www.vtk.org/doc/nightly/html/classvtkWeightedTransformFilter.html) seems most likely) but I don’t know what capabilities Slicer has to actually load from this file… writing a bespoke loader would be a pain. Does Slicer support any standard file formats such as FBX?

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [November 10, 2017, 3:36pm UTC](https://discourse.slicer.org/t/importing-rigged-animated-3d-models-from-blender/1432/2 "2017-11-10T15:36:00Z")

</div>

> [@jdx-john](#):
>
> where is it documented what formats? I think I saw mention of STL and OBJ so far

[Slicer Wiki](https://www.slicer.org/wiki) → User Manual → [Supported Data Formats](https://www.slicer.org/wiki/Documentation/Nightly/SlicerApplication/SupportedDataFormat)

> [@jdx-john](#):
>
> We have a medical device being modelled, with animations, in Blender. As I understand, multiple poses of a skeletally-rigged model. We’ve come across some VTK support from skinned animations ([VTK: vtkWeightedTransformFilter Class Reference](https://www.vtk.org/doc/nightly/html/classvtkWeightedTransformFilter.html) seems most likely) but I don’t know what capabilities Slicer has to actually load from this file…

That makes me think of [Bender - KitwarePublic](https://public.kitware.com/Wiki/Bender) a Slicer based project for repositioning voxelized anatomical models.

Note that it is named **Bender** and not **Blender**

It applies the rigging, skinning and posing technique to volumes by providing an additional step to resample the volume. It internally uses Cleaver and SOFA.

> [@jdx-john](#):
>
> Does Slicer support any standard file formats such as FBX?

Part of the Bender project could probably be turn into a Slicer extension.

@lassoan What do you think ?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 11, 2017, 3:22pm UTC](https://discourse.slicer.org/t/importing-rigged-animated-3d-models-from-blender/1432/3 "2017-11-11T15:22:58Z")

</div>

Yes, I think it would be a good idea to port Bender to an extension.

---

<div class="post-metadata">

**Author:** ![jdx-john](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@jdx-john](https://discourse.slicer.org/u/jdx-john)\
**Post date:** [November 13, 2017, 1:19pm UTC](https://discourse.slicer.org/t/importing-rigged-animated-3d-models-from-blender/1432/4 "2017-11-13T13:19:29Z")

</div>

Thanks for the replies.

If you’re suggesting we actually use Bender instead of Blender for creating  
the animations I don’t _think_ this would work. We are working from  
supplied polygonal models I think (although it might be solidworks) and I  
think need to use industry-standard tools like Blender/3DSMax for modelling  
and rigging/animating.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 13, 2017, 4:17pm UTC](https://discourse.slicer.org/t/importing-rigged-animated-3d-models-from-blender/1432/5 "2017-11-13T16:17:14Z")

</div>

Bender = special build of Slicer with additional modules for animation and physically realistic simulation of tissue deformations.

Bender includes readers for BVH motion capture files and armature files. The armature file format seems to be some VTK-based format, so it would need to be modified to be able to read some other format that Blender/3DSMax can export.

See a couple of videos about what it can do:

- [https://vimeo.com/73247670](https://vimeo.com/73247670)
- [https://vimeo.com/63601648](https://vimeo.com/63601648)
- [https://vimeo.com/63601647](https://vimeo.com/63601647)

While you can do basic rigging and animation in Slicer (Bender), for more sophisticated animations it is probably better to work in Blender or other professional modeler software, export results to files, and import those into Slicer.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 13, 2017, 5:08pm UTC](https://discourse.slicer.org/t/importing-rigged-animated-3d-models-from-blender/1432/6 "2017-11-13T17:08:34Z")

</div>

There is also an [armature exporter Blender plugin](https://public.kitware.com/gitweb?p=Bender/Bender.git;a=blob;f=Utilities/Blender/io_export_armature.py;h=f814440c1ad86f34b0efa4b91cc88d4db7b7327b;hb=HEAD) in Bender utilities. I think Blender can export motion capture data as .bvh and models as stl or obj. So, I think these may cover all data export/import needs.

---

<div class="post-metadata">

**Author:** ![jdx-john](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@jdx-john](https://discourse.slicer.org/u/jdx-john)\
**Post date:** [November 13, 2017, 7:23pm UTC](https://discourse.slicer.org/t/importing-rigged-animated-3d-models-from-blender/1432/7 "2017-11-13T19:23:18Z")

</div>

I’m unsure… It appears Mo-Cap is exported via BVH but as I understand it,  
STL/OBJ only store raw polygon data. Isn’t there a 3rd piece missing, the  
actual rigging (armature as you describe it?)

---

<div class="post-metadata">

**Author:** ![Johan\_Andruejol](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/johan_andruejol/32/3639_2.png) [@Johan\_Andruejol](https://discourse.slicer.org/u/Johan_Andruejol)\
**Post date:** [November 13, 2017, 8:08pm UTC](https://discourse.slicer.org/t/importing-rigged-animated-3d-models-from-blender/1432/8 "2017-11-13T20:08:17Z")

</div>

Hey John,

Bender is able to directly read BVH files, so you can import the rigging  
(armature) with its pose.

When importing a BVH in Bender, you can choose the frame of the animation  
(as demonstrated in this video: [https://vimeo.com/90788904#t=1m20s](https://vimeo.com/90788904#t=1m20s))  
or you can manually adjust it from within the Armature module in the  
armature pose panel (see the documentation here  
[https://public.kitware.com/Wiki/Bender/Documentation/2.0/Modules/Armatures](https://public.kitware.com/Wiki/Bender/Documentation/2.0/Modules/Armatures))

You can also create (rig) and pose the armature directly from Bender.

Thanks !  
Johan

---

<div class="post-metadata">

**Author:** ![jdx-john](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@jdx-john](https://discourse.slicer.org/u/jdx-john)\
**Post date:** [November 13, 2017, 8:55pm UTC](https://discourse.slicer.org/t/importing-rigged-animated-3d-models-from-blender/1432/9 "2017-11-13T20:55:31Z")

</div>

Hi, I’ve maybe misunderstood what data is stored in the BVH file? So not  
just the raw motion of points, but the rigging/weighting as well?  
We don’t have mo-cap data, can we use BVH as a generic transport for this  
sort of data?

And then - how do I get this into Slicer rather than Bender?  
I can’t use Bender for the rigging because we want to use the same models  
in realtime 3D engines, etc, and these really need to use more standard  
formats like PBX… plus our artists will want to stay with familiar tools.

Many thanks.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 13, 2017, 9:33pm UTC](https://discourse.slicer.org/t/importing-rigged-animated-3d-models-from-blender/1432/10 "2017-11-13T21:33:02Z")

</div>

I’ve checked and .bvh has both armature and motion capture data. Blender has a .bvh exporter, so I guess if you can import something to Blender then you can export it as .bvh and then Bender (=Slicer+extra modules) can use it for creating animations.

@Johan_Andruejol @finetjul Can you confirm?

---

<div class="post-metadata">

**Author:** ![Johan\_Andruejol](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/johan_andruejol/32/3639_2.png) [@Johan\_Andruejol](https://discourse.slicer.org/u/Johan_Andruejol)\
**Post date:** [November 14, 2017, 12:08am UTC](https://discourse.slicer.org/t/importing-rigged-animated-3d-models-from-blender/1432/11 "2017-11-14T00:08:56Z")

</div>

Yes, BVH has both the rig and the animation information.)  
Also, I seem to recall Blender having support for exporting under the BVH  
format.

However, BVH import does NOT contain the weight information. You will have  
to supply/create that yourself.  
Since Bender is aimed toward posing/animating labelmaps,we need a weight  
map that is also a labelmap.  
That weight map can be created using a few modules:

- The Volume Skinning module create a 1-to-1direct mapping between a bone  
and a voxel. This is a very simple skinning. See  
[https://public.kitware.com/Wiki/Bender/Documentation/2.0/Modules/VolumeSkinning](https://public.kitware.com/Wiki/Bender/Documentation/2.0/Modules/VolumeSkinning)  
.

- This simple skinning can be edited using any labelmap editor. I would  
advise using the Segment Editor in Slicer  
[http://slicer.readthedocs.io/en/latest/user\_guide/module\_segmenteditor.html](http://slicer.readthedocs.io/en/latest/user_guide/module_segmenteditor.html),  
though Bender still uses the old Editor  
[https://www.slicer.org/wiki/Documentation/4.8/Modules/Editor](https://www.slicer.org/wiki/Documentation/4.8/Modules/Editor)

-This 1-to-1 map can further refined to obtain smooth transition with the  
Compute Armature Weight module:  
[https://public.kitware.com/Wiki/Bender/Documentation/2.0/Modules/ComputeArmatureWeight](https://public.kitware.com/Wiki/Bender/Documentation/2.0/Modules/ComputeArmatureWeight)

In any case, I encourage you to download Bender and try it yourself, it’s  
free 🙂  
Bender’s Workflow module takes you through all the steps needed to create,  
rig and pose a labelmap. This should give you a better idea of what it can  
do.

I hope this helps,  
Johan

---

<div class="post-metadata">

**Author:** ![jdx-john](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@jdx-john](https://discourse.slicer.org/u/jdx-john)\
**Post date:** [November 14, 2017, 11:57am UTC](https://discourse.slicer.org/t/importing-rigged-animated-3d-models-from-blender/1432/12 "2017-11-14T11:57:24Z")

</div>

Thanks Johan. Since we’re talking about animating a 3D model rather than  
medical dataset, not being able to import the weightings sounds like a  
problem to me. That’s surely one of the key things an animator/modeller  
would do, making them do it twice seems a bad idea.

I think I’ll ask the animator to peruse this thread in case we’re talking  
at cross-purposes, though I think the terminology might be slightly  
different anyhow.
