Jump to content
Hash, Inc. Forums
nemyax

A:M importer for Blender

Recommended Posts

A:M importer for Blender

 

This add-on imports Animation:Master models into Blender. The following happens during model import:

  • Patches are converted to polygonal meshes without any subdivision. This happens only for explicitly saved patches listed in the file; if your patch is stamped, it will come through.
  • Faces are not created for implicit patches. If you need to make a surface from your edge net, use Blender's excellent family of Fill tools.
  • Hooks turn into regular vertices.
  • A:M bones and nulls turn into Blender bones.
  • CP attachments and weights are converted to vertex weights. For hooks, weights are copied from their hook bases.
  • Constraints, limits and all other rigging relationships are ignored.
  • Stamps turn into UV layouts, using the / naming convention.
  • CP groups turn into vertex groups and are added to the groups that Blender uses for vertex weighting.

The add-on also imports animations in .xform format, as exported by this plugin.

 

Get the add-on here: https://sourceforge.net/projects/blenderbitsbobs/files/
The name of the file is io_scene_am_import-*.*.*.zip.

 

The add-on requires Blender 2.77a or later.

 

How to use

Important: A note on bone orientation specifics. Blender and A:M use different rest-pose orientations for bones. In Blender it's +Y that looks "down" the bone, and in A:M it's +Z. Therefore, if you try to apply A:M animations unchanged to a normal-looking Blender armature, it'll come out wrong.
The add-on supports both orientations for models and animations; the bone orientation import option can be set to either A:M-native or Blender-friendly. Whichever option you use for model import, stick with the same option for animation import to get correct results.
To help you track which option was used during the model import, the add-on names the imported armature object and associated armature data either "mdl_armature_am" (for "A:M-native") or "mdl_armature_blen" (for "Blender-friendly"). You might want to rename the armature object, but you're unlikely to rename the armature data, because nobody ever bothers, so it's a simple hint that won't get lost.

Importing models
To import a .mdl file, click File | Import | Animation:Master model (.mdl).

 

Importing animations

To import an animation in .xform format:

  1. Set the time slider to the frame you want the sequence to start at.
  2. Select an armature that matches the animation you want to import, or a mesh associated with such an armature. This should preferably be part of a model imported with this add-on.
  3. Click File | Import | Bone Transformations as Animation (.xform).
    Specify the bone orientation used by the target armature: A:M native or Blender-friendly. (An "A:M-native" armature is bound to look weird, with bones jutting sideways; if unsure which to select, check the armature data name.)

For details about the .xform format, see this topic.

How to install

  1. Open Blender's User Preferences window and go to the Add-ons tab.
  2. Click Install from File and specify the downloaded .zip file or the unpacked .py file.
  3. Enable the Import-Export: Animation:Master Import add-on.
  4. To make your changes persistent, click Save User Settings.
  • Like 1

Share this post


Link to post
Share on other sites

How interesting!

 

I know nothing of Blender but I shall be interested to hear of others' results.

 

i suspect the unsubdivided patches will look a bit raw. :unsure:

Share this post


Link to post
Share on other sites

i suspect the unsubdivided patches will look a bit raw. :unsure:

A real model is bound to be detailed enough to look OK with subdivision turned on.

6aedb2103b0ce3d435063528ce50d503.png

Even the keekat looks decent as a subdiv mesh.

Share this post


Link to post
Share on other sites

Not bad.

 

If you export a KeeKat model from a chor you could get the eyes properly in place.

Share this post


Link to post
Share on other sites

Very, very cool stuff :).

 

Thank you very much for your affords and that great import-plugin. That looks very promising indeed.

I'll link it on the Hash page this evening and will test it then again :).

 

See you and thanks again

*Fuchur*

Share this post


Link to post
Share on other sites

Looking very good. :)

Share this post


Link to post
Share on other sites

Very Awesome!!!!

 

If animations can be exported to blender in the future as you mentioned in the above post, that will

unlock some very interesting horizons.

 

Great work Nemyax

Share this post


Link to post
Share on other sites

Waow! Nice plugin!
Thank you Nemyax!

No need to have a detailed model, it is possible to have a close enough model of the original.
For that use the modifier called "Smooth", apply a negative value.
place it before your subdivision modifier.
In edit mode, select "non manifold", invert the selection, and create a vertex group.
In the "smooth" modifier, choose this vertex group.
Play with the negativ value to found the good volum.
Here a picture to show the result with "smooth modifier"

blender.jpg

Thank again Nemyax!

  • Like 1

Share this post


Link to post
Share on other sites

Update 0.1.20160630

The script now skips hair definitions. I wasn't familiar with that markup until I tried and failed to import the stock wookie. The model loads correctly with this update.

Please report any issues you find.

Share this post


Link to post
Share on other sites

VERY INTERESTING!!!

Share this post


Link to post
Share on other sites

Update 0.1.20160701

Some parsing improvements; now all the stock characters should import successfully.

Funnily, robcat2075 helped fix one of the issues without even knowing it. In Shaggy.mdl the script was stumbling over the "é" in "Robert Holmén". Turns out .mdl files aren't Unicode, so the importer now assumes they are Windows-1252.

Share this post


Link to post
Share on other sites
Funnily, robcat2075 helped fix one of the issues without even knowing it. In Shaggy.mdl the script was stumbling over the "é" in "Robert Holmén". Turns out .mdl files aren't Unicode, so the importer now assumes they are Windows-1252.

 

Robert is a handy guy. Always fixing things without lifting a finger. :)

And... note to self about .mdl files not being unicode. That might be something worth attending to in the next major update of the A:M file formatting.

 

Thanks for the quick updates!

Share this post


Link to post
Share on other sites

I've put this very handy plugin on the A:M website under "Third Party Software". :)

Thank you very much again :).

 

This is a really great addition.

 

See you

*Fuchur*

Share this post


Link to post
Share on other sites

Hi Nemyax,

 

I tried your addon with this mdl of mine.

It seemed to have imported something , but I can`t see a mesh.

i am not blender fit. maybe some user bug?

 

Any advise?

 

Jake?

bat15-040509.mdl

BlenderImport.JPG

Share this post


Link to post
Share on other sites

Wow! Very promising! Seems I have to learn some blender.

Fantastic addon. Thank you for your work!

 

Here is some more pictures:

 

 

 

 

BatTest.JPG

BatTest2.JPG

BatTest3.JPG

BatTest4.JPG

BatTest5.JPG

BatTest1.JPG

Share this post


Link to post
Share on other sites

What does that guy look like in A:M? I don't like the lengths of those bones.

Share this post


Link to post
Share on other sites

Sorry I just took the firstbest old model with bones rather senslessly.

KunoTest.JPG

Share this post


Link to post
Share on other sites

I will guess that this is going to be the most straighforward way to get from A:M to Sketchfab.

Share this post


Link to post
Share on other sites

I will guess that this is going to be the most straighforward way to get from A:M to Sketchfab.

We can already export to sketchfab via the obj file format as I did on these models:

https://skfb.ly/Gy79

https://skfb.ly/DUyN

What we NEED and this may provide is a way to get ANIMATION to sketchfab... A:M to Blender via the 'future' A:M export to Blender utility from NemYax... Blender to Sketchfab via FBX file format...

 

altho I see Nemyax's plugin will allow bones- but not constraints... so I wonder how he plans to allow for animation... perhaps via baking or using a baked file like BVH or MDD...?

Share this post


Link to post
Share on other sites

Yes, I meant from A:M to Sketchfab with animation.

Should the animation pipeline through this plugin eventually support it. :)

Share this post


Link to post
Share on other sites

I wonder how he plans to allow for animation

At this time the plan is to support only transformation animation curves. And yes, the transforms will need to be baked. It shouldn't be a problem to duplicate a chor and bake the animation in the copy. Or will it?

 

 

Blender to Sketchfab via FBX file format

Sketchfab accepts .blend files just fine. But for animation, it only supports FBX.

Share this post


Link to post
Share on other sites

Thank you nemyax.

 

This is very well done and very useful.

Share this post


Link to post
Share on other sites

Update 0.1.20160815

Fixed the bug that jakerupert's Santa exhibited. I didn't get any tracebacks with either of the models, by the way.

Share this post


Link to post
Share on other sites

jakerupert

The details in error popups that begin with "Traceback (most recent call last):".

Have you retried it on the models you had problems with?

Share this post


Link to post
Share on other sites

Update 0.2.20170410

The add-on now supports two kinds of bone orientation. Bone animation import is also available through a custom format (.xform).

I've been meaning to add animation import for a long time, and initially I thought I could rely on A:M's built-in baking feature. But I was frustrated by A:M's baker, because it couldn't record constraint-driven transformations properly. Then I thought I'd write .blend files with baked animations straight out of A:M, but that's just too much trouble: the .blend format is a major pain to write unless you're Blender. So eventually I settled on a simple custom binary format and made an exporter for it.

Share this post


Link to post
Share on other sites

Nice progress. I remain impressed by your ability to build bridges between A:M and Blender.

Share this post


Link to post
Share on other sites

Yes- nice work nemyax! I would be all over this if I was not already spread thin in software I am trying to learn, I would be interested to know if A:M animation could successfully export over to SketchFab via A:M>BlenderXporter>Blender export FBX>import and play on SketchFab. Would be COOL! Can someone try?

 

 

I am working on a A:M animation MDD export> C4D FBX export> SketchFab import route... but the bottleneck now is that Sketchfab does not support PLA (Point Level Animation or what we would call Muscle Mode animation) and that is what the MDD creates... I could export an OBJ sequence into but that seems to convert to PLA as well (not bone driven deformations)

 

Another issue I wonder about- Now that the 'Poobah' is back... are 3rd party software discussions (importer/exporter/converters etc) going to be frowned upon like they once were and the slavish forum bylines dictate...?

Share this post


Link to post
Share on other sites
I would be interested to know if A:M animation could successfully export over to SketchFab via A:M>BlenderXporter>Blender export FBX>import and play on SketchFab. Would be COOL! Can someone try?

 

I'd have to recheck but I believe there is a direct export from Blender to Sketckfab.
A fairly recent addition.

Share this post


Link to post
Share on other sites

I would be interested to know if A:M animation could successfully export over to SketchFab via A:M>BlenderXporter>Blender export FBX>import and play on SketchFab.

Barring bugs in the .xform exporter, I can't see why not!

Share this post


Link to post
Share on other sites

I see the Blender installer download is only 85mb(windows 64 bit) How big does the program become on your HD once installed? (I have C:drive issues...)

Share this post


Link to post
Share on other sites
Another issue I wonder about- Now that the 'Poobah' is back... are 3rd party software discussions (importer/exporter/converters etc) going to be frowned upon like they once were and the slavish forum bylines dictate...?

 

I tend to sigh deeply whenever a question like this is asked.

People should know better but they don't.

 

Martin can speak for himself... has never shied away from that.... but intelligent discussions have always been welcome.

For proof of that we need only look at the discussions that are recorded here in the forum.

It is the condescending attitudes, misinformation, personal attacks and disrespect that tend to torpedo those discussions.

Inevitably someone sees an opportunity to air a personal grievance, demand new features or press an agenda.

The secret to posting any topic (unless you're Martin who can post anything he wants) is to consider how A:M and A:M Users can benefit from the discussion.

 

 

(Matt: I sent you a PM as I don't want to stray further off topic here)

Share this post


Link to post
Share on other sites

How big does the program become on your HD once installed? (I have C:drive issues...)

400MB should be enough.

Share this post


Link to post
Share on other sites

Thanks for addressing that rather eloquently, Sarge. I generally just refrain- 'times were' we could'nt even mention other packages... but today A:M has newfound relevance as 'part of the team' of 3D packages and renderers available, and converters-exporters-importers and discussing workflows and discoveries is vital.

Share this post


Link to post
Share on other sites

I'd have to recheck but I believe there is a direct export from Blender to Sketckfab.

You probably mean direct .blend import into Sketchfab. That's only for static geometry, unfortunately.

Share this post


Link to post
Share on other sites

and we are ANIMATORS, by gumm!

SO- nemyax's new updated plug-in (as seen in post #32 of this thread)- would do animations from A:M to Blender to SketchFab?

Share this post


Link to post
Share on other sites

I'm cross posting with Matt so please see/answer his question above.

 

 

 

@Nemyax:

 

 

I'd have to recheck but I believe there is a direct export from Blender to Sketckfab.


You probably mean direct .blend import into Sketchfab. That's only for static geometry, unfortunately.

 

 

I don't know enough about it to comment much.

However, some basic animation is supported by Sketchfab although I can't speak to the current import/export processes's success.

Here's a relevant page:

xhttps://help.sketchfab.com/hc/en-us/articles/206223646-Blender-Animation

 

Support for animation itself even from FBX is relatively new in Sketchfab so I'm sure many improvements will be made.

 

Share this post


Link to post
Share on other sites

SO- nemyax's new updated plug-in (as seen in post #32 of this thread)- would do animations from A:M to Blender to SketchFab?

Yes, it should.

 

However, some basic animation is supported by Sketchfab although I can't speak to the current import/export processes's success.

Here's a relevant page:

xhttps://help.sketchfab.com/hc/en-us/articles/206223646-Blender-Animation

Thanks for this info. The feature set described on that page is more than enough. It looks like you can safely skip FBX if you take the A:M→.xform→Blender route.

Share this post


Link to post
Share on other sites

Okay nemyax- I am going thru this thread with a closer eye... in the 1st post you explain how to use it... importing models seems straightforward- but importing animations... do you import an A:M action file, choreography, pose? How do you get A:M actions to the .xform file format?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×