Jump to content
Hash, Inc. Forums
nemyax

MDL exporter for Blender

Recommended Posts

If you do not use hooks in your models , this allows the use of external modeling, UV , paint, retopology ... that is graet. :)

If you bring bones in import ( I suppose the weights too? ) , It will be graet.
Export to Blender AM's actions intrigues me , eager to see the result.

Share this post


Link to post
Share on other sites

Hooks are good for detail reduction and flow management, but they aren't strictly required for making an animatable character. If you use Blender to model for A:M, then create a nice mesh as you normally would (using box or extrusion modelling techniques), keep the valency of your poles under six, and finally use the remesher that comes with the exporter. The model should be good to go, even without hooks.

Share this post


Link to post
Share on other sites

This one works really well and opens up for a lot of possibilities! Thanks so much!

The example shows a head I am working on for my current film. It is modeled and painted/textured in ZBrush, then exported to Blender via .obj format, and finally exported from Blender to A:M via the new plugin, and then rendered in A:M. No problems whatsoever! :-)

 

 

Share this post


Link to post
Share on other sites

ToreB

Would you be interested enough in animation interchange between A:M and Blender to test it (when the time comes)?

Share this post


Link to post
Share on other sites

Nemyax, it all depends...don't have the time to dedicated beta testing, but I could propably give it a spin. :-)

Share this post


Link to post
Share on other sites

Hi there,

I am also doing quite some work in Blender (I like the UVing there so much).

Rest assured, that I would do also do some testing, one way and the other way around as well.

Share this post


Link to post
Share on other sites

Trying to tackle bone and CP weight export. Not much luck so far, but it should be ready soon.

Share this post


Link to post
Share on other sites

I dont know if someone else already stumbled over this, but if you just load a exported MDL file into AM

as a new model, it has the old problem with the twisted splines.

When you import it into a existing model or a newly created empty model, the problem is not there.

 

Ah, and I would like to ask, where I may get that "select" plugin, which was mentioned in this thread earlier?

 

Cheers

Heiner

Share this post


Link to post
Share on other sites

I dont know if someone else already stumbled over this, but if you just load a exported MDL file into AM

as a new model, it has the old problem with the twisted splines.

When you import it into a existing model or a newly created empty model, the problem is not there.

 

 

Yes, Nemyax addresses that issue in the first post thusly:

 

Note:

There's a quirk in the current version that results in patches getting twisted around in Animation:Master. This is easily corrected. Just nudge any CP a little and undo; the twist should go away. Save the auto-corrected model immediately.

I might fix this when I work out the cause, but the workaround is easy enough, so it can stay that way for now.

 

As for the Select plugin, I thought it came with A:M. I'll look into that.

Share this post


Link to post
Share on other sites

Ahhh, Rodney, caught me again not doing my homework: Select is there! You are right ...

 

Regarding the twisted spline thing: Yes, Neymax mentioned it, and said it can be fixed by nudging the model. Worked fine back then.

With the current version: When you do the import in a exsisting/empty model, it does not have the twist issue any more. But when

you import the whole model file as it comes out of Blender, it has the old twist issue und it can not be fixed with the nudge trick.

Share this post


Link to post
Share on other sites

Heiner

If the one trick works, the other should also work. How heavy is the model you're working with? Did you try cutting everything and pasting it back? Saving and reopening?

 

Anyway, weights are already exported correctly, but bone transforms still come out wrong.

Share this post


Link to post
Share on other sites

Hi Nemyax,

the model is not overly complex, see picture.

I tried again to do the loading of the exported model

directly. The nudge trick is not working but copy and

paste fixes the issue.

Cheers

Heiner

Import.jpg

Share this post


Link to post
Share on other sites

Saving the model should fix the twisting as well.

In short, anything that causes A:M to process the model should cause it to 'fix' the twists.

That's what is going on with the nudging as well although in your case it appears to not be sending the signal to A:M that the layout of the model needs to be recalculated.

 

Don't forget that nemyax added the option to his converter to remove the dangling splines as well.

I find those dangling splines useful for identifying areas that need some extra attention.

Share this post


Link to post
Share on other sites

Yeah, the option for removing the dangling splines works just fine as you can see in the attached picture.

The quality of the imported model is awesome! I am just doing the texture painting for the pirate, based on UVs

done in Blender! With the way open between A:M and Blender you can now do the modeling in AM, eport

the model to Blender, do the UVing there, and come back to A:M.

If there is a interest, I can do a video on how to do that! It is really not overly complicated and saves a heck

of a lot of time!

Cheers

Heiner

Import_v1.jpeg

Share this post


Link to post
Share on other sites

you can now do the modeling in AM, eport

the model to Blender, do the UVing there, and come back to A:M

You can even 3D-paint the model in Blender if you like.

And starting tomorrow, you can also construct the skeleton and do the CP weighting =)

Share this post


Link to post
Share on other sites
And starting tomorrow, you can also construct the skeleton and do the CP weighting =)

 

That should be useful. :)

Share this post


Link to post
Share on other sites

Hi nemyax,

yeah, I know that and I also use it quite often.

Regarding the skeleton and the CP weighting, I am a little confused: AM to Blender or the other way around?

 

Cheers,

Heiner

Share this post


Link to post
Share on other sites
AM to Blender or the other way around?

Blender to A:M. It'll be part of the following (at this stage, theoretical) workflow:

  1. Model, texture and skin in Blender.
  2. Rig and animate in A:M.
  3. Bake the animation and save it.
  4. Import the animation into Blender and attach it to the original armature.

Share this post


Link to post
Share on other sites

Hi,

what you have done so far makes my life and work much more easy.

It looks a little bit different from what you suggest but nontheless can be

archived with the tool you made so far.

I can not stress enough the fact that you now can do the UVing outside of

A:M. When you look at the attached picture you see a UV layout, which

you can not (or almost not) make happen in A:M, not to mention,

that it is done so much faster. BTW, the picture shows the UV layout as

stamp in A:M!

An then you go back to A:M and do the riging and animating, which is so

much better, easier, more intuitive then all other apps i worked so far

(including Blender).

Long talk cut short: You sir, did an awesome job!

Cheers

Import_v2.jpeg

Share this post


Link to post
Share on other sites

Update 0.2.20150804

Skeleton and skinning support has landed.

 

400_0ebee8a0229ac78ebf4d35241e851ee8.jpg

 

If you want to skip the export of an existing armature, you can temporarily break the reference to it in your modifier.

A few minutes after the update I found a stupid division-by-zero bug in sloppily-skinned meshes. That's very lame of me, and I'll fix it soon. Meanwhile, as always, make sure your models are perfect before you export =) Fixed—Update 0.2.20150805 pushed.

 

This update also improves the spline-tracing function, so that topologies such as these are handled correctly:

 

658c48f721b5d8bbd23ab0f163976e3c.png

Share this post


Link to post
Share on other sites

Update 0.2.20150806

Changelog:

  1. Bone roll export fixed.
    Bone roll in A:M should now match the original value.
  2. Spline tracing improved (again).
    The previous update corrected some cases but broke others. Both kinds of issues should be fixed now.

Share this post


Link to post
Share on other sites

I've got two things on my to-do list:

  1. Export of shape keys (aka blend shapes and morph targets elsewhere) as .act files containing spline actions
    These actions are the only way I've found to bring a shape key into A:M as an independent entity. It's also very easy to do. How useful would that be? For example, can you reuse data from such an action in a smartskin?
  2. Import of .act files with skeletal animation as Blender actions
    I need your help on this one. Could you give me some of your real-world action files—the more, the better? This would save me a lot of time trying to figure out the format. The files should contain bone transforms, diverse f-curve tangent and continuity settings, and cycling options. Model files aren't necessary.

Share this post


Link to post
Share on other sites

These are the once available in the Data-Section of the libraries.

It should give you something to start with.

 

See you
*Fuchur*

actions.zip

Share this post


Link to post
Share on other sites

Hi there,

I thought I do a little but ambitious test and get a riged model out of Make Human into Blender and then from there int A:M.

As you can see, that worked pretty nice including the naming!

Let me know, if I can be of assistance in any way!

Cheers

Heiner

Import_v3.jpg

Share this post


Link to post
Share on other sites

looks very nice :).

cool stuff! keep on rocking :)

 

is it weighted or are those points only assigned?

 

see you

*fuchur*

Share this post


Link to post
Share on other sites

To answer my own question: yes, the PWS makes it possible to drag CP data from a spline action into a smartskin. Only moving appears to be allowed though, not copying.

Share this post


Link to post
Share on other sites

Very cool! Thanks Heiner... I'll see how I can use that... till now I did not get very useful UV-sets from blender, but I am sure I just need to define a seam to get better once... just have to figure out how to do that...

 

//////////////////////////////////////

(Somehow my following post got deleted which would have been below this one... so I put it in again here to match the ordering)

//////////////////////////////////////

 

Okay, got it working. Nice stuff :).

 

I exported Edi to Blender using the OBJ-Exporter (polyperpatch: 4).

Then I used Blender with the help of the tutorial (and reseting the interface to be able to follow Heiners tutorial).

Then I selected a few edges and marked them as seams for the UV-map (I am sure it can be done better than what I came up with) and used the automatic UV-mapping-method in Blender to UV-map the model for me.

Then I exported it using the MDL-Exporter (which works very well... be sure to import it into an already existing MDL-file and you may need to rotate the model afterwards and flip the normals once,,, seems like blender is using a different coordinate system). One more thing to note: Blender recognized the groups from Edi and brought it in the blender-interface from the OBJ nicely, but the plugin does not export them back as A:M groups currently, as it seems. Not a big deal, since you are likely using a full body texture, but it would be cool if that could be added somewhere in the future.

 

After that I exported the model as OBJ again and brought it to 3dCoat to paint on it. (I recently got a Wacom Cintiq and with it, it really is fun to paint quite freely on the model).

And after saving the textures out of 3dcoat, I had my own little painted eddy-model in A:M.

 

This is just an workflow test! Please do not expect something fancy, but it really is doable and did not cost me too much of my nerves (okay, okay, blender was hard for me as always ;) but it did a good job UVmapping the model).

 

See you

*Fuchur*

 

PS: This is a screenshot of my 2 monitors (blender and A:M) and the Cintiq ("3. Monitor" > 3dcoat). The order of the steps would be a little different (first A:M, then Blender, then A:M again, then 3dCoat, then A:M again), but you get what I want to show you. And there are two renderings of Edi in A:M with SSAO.

 

PPSS: For anyone who did not notice till now: This is a VERY BIG THING! Being able to export from A:M to Blender and then back to A:M is a very long awaited thing! It opens up quite many possibilities... I used 3d Coat with it, but you can practically use anything you want with it...!

 

screenshot_am_blender_3dcoat_am_workflow2.jpg

edi_workflowed3_0.jpg

edi_workflowed4_0.jpg

Share this post


Link to post
Share on other sites

From another topic:

 

 

you may need to rotate the model afterwards and flip the normals once,,, seams like blender is using a different coordinate system

The model must have been rotated during OBJ import. The addon gets the vertices' local coordinates and doesn't use the world matrix for correction (it could, but I have objections to that now that armatures are supported). It only rotates the geometry to match A:M's notion of "front" and "up". The coordinate systems in Blender and A:M are both right-handed.

To avoid this situation, you can apply the transforms to your object in Blender (Ctrl+A) before export.

 

Blender recognized the groups from Edi and brought it in the blender-interface from the OBJ nicely, but the plugin does not export them back as A:M groups currently, as it seems. Not a big deal, since you are likely using a full body texture, but it would be cool if that could be added somewhere in the future.

I suppose I might do that some day. However, vertex weighting is based on vertex groups in Blender, so this could get messy in a variety of ways. For example, a group you really want to keep may match the name of a bone and be discarded because of that.

Share this post


Link to post
Share on other sites

From another topic:

 

 

you may need to rotate the model afterwards and flip the normals once,,, seams like blender is using a different coordinate system

The model must have been rotated during OBJ import. The addon gets the vertices' local coordinates and doesn't use the world matrix for correction (it could, but I have objections to that now that armatures are supported). It only rotates the geometry to match A:M's notion of "front" and "up". The coordinate systems in Blender and A:M are both right-handed.

To avoid this situation, you can apply the transforms to your object in Blender (Ctrl+A) before export.

 

Blender recognized the groups from Edi and brought it in the blender-interface from the OBJ nicely, but the plugin does not export them back as A:M groups currently, as it seems. Not a big deal, since you are likely using a full body texture, but it would be cool if that could be added somewhere in the future.

I suppose I might do that some day. However, vertex weighting is based on vertex groups in Blender, so this could get messy in a variety of ways. For example, a group you really want to keep may match the name of a bone and be discarded because of that.

 

I would not have a bigger problem with a prefix for the groups, if that helps. Something like "B2AM_" or even something more random. It would not be very likely, that a custom group would be called like that and it should help get rid of such a problem, or am I unstanding something wrong?

See you

*Fuchur*

Share this post


Link to post
Share on other sites

Update 0.2.20150901

Vertex groups are now exported as CP groups, as requested by Fuchur.

Note that groups used for bone deformations (these groups are named after the bones that influence them) are skipped. If you want to keep such a group, make a copy of it: click the down arrow icon and select Copy Vertex Group.

 

Regarding the other feature that almost made the update:

Export of shape keys (aka blend shapes and morph targets elsewhere) as .act files containing spline actions

These actions are the only way I've found to bring a shape key into A:M as an independent entity. It's also very easy to do.

Well, it was only easy in theory. In practice, there's a bug in Blender that gets in the way. It should be fixed in Blender 2.76, but until then, shape key export will remain hidden.

 

Download page: http://sourceforge.net/projects/blenderbitsbobs/files/

Share this post


Link to post
Share on other sites

Very cool :)

I'll test it out as soon as I come home.

See you
*Fuchur*

Share this post


Link to post
Share on other sites

Sorry that it took me that long to try it out... but I do not really see the groups in A:M again.

 

What I did:

1.) Export an OBJ from A:M (the result is in Eddie_obj_mtl.zip)

2.) Import it into Blender (see image "import_blender.jpg", see the version I am using there and see that there are groups available there in blender)

3.) Export using the Blender-MDL-Exportplugin.

4.) Import into an existing model in A:M. (reimport_am.jpg)

 

See you

*Fuchur*

import_blender.jpg

reimport_am.jpg

edi_test.mdl

Eddie_obj_mtl.zip

Share this post


Link to post
Share on other sites

Fuchur

The model doesn't have vertex groups. The element names in the outliner belong to materials, and the vertex group list for the mesh is empty. Try creating some groups in Blender and populating them with vertices by material.

Share this post


Link to post
Share on other sites

Okay I understand now... in terms of A:M, wouldn't it make sense to create groups from material-groups too? (name problems could be overcome again with somethiing like "m_[name]" (material group) or "vg_[name]" (vertex group)

In A:M you use Groups very often to assign surface-attributes or materials and much more rarely to save just a selection.

(at least that is the way I work)

 

See you

*Fuchur*

Share this post


Link to post
Share on other sites

Fuchur

How would you like a button that created vertex groups based on material assignment? If you come to think of the difference in how Blender and A:M assign materials, you realise that fully automatic conversion isn't very useful.

Suppose you want a material layout as in the attached image. In Blender, you'll just assign materials directly to faces and be done with it. But you don't assign to patches in A:M, only to CPs. And selecting the CPs for the green patches will also select the CPs for the orange patch, so the orange patch will be lost. In A:M, you'll probably work around this by using two L-shaped groups around the orange patch. But you don't do that in Blender, where you have a face-to-material correspondence without any grouping.

A conversion button would give you a chance to fiddle with vertex reassignment in order to please A:M. And a prefix could prompt the exporter to include a material shortcut.

mats.png

Share this post


Link to post
Share on other sites

the option would be cool.

 

what i am after is, that an export from A:M2blender and then back from blender2am should result in exactly the same again (of course only of the stuff obj-files can save). that would be what I would expect as a user of a full export circle and it would be useful if you want to 3d paint in blender for instance and then bring it back to A:M again (for selecting stuff, etc). the groups would be already defined right because they have been created in A:M (very likely with two groups for instance or as i do it: one additional cp/intersection in the middle so i can just not select the one in the middle.

 

if you model in blender and you want to export then from blender2am for animation for instance the behaviour you describe is more useful. like that it would be good to be able to select one behaviour.

Share this post


Link to post
Share on other sites

Hot on the heels of the Blender 2.76 release, here is Update 0.4.20151003.

  • The patch twist bug should be fixed now.
  • Group CPs by material option: if enabled, the exporter creates CP groups named after assigned materials (requested by Fuchur). These groups override any vertex groups with the same names, so make sure your vertex groups and materials have different names.
  • Export shape keys option: if enabled, the exporter creates a spline action file for each shape key that is different from the base mesh. These .act files can be useful, for example, if you want to transfer spline shapes to your smartskins. Due to this feature, the minimum required Blender version is 2.76, because prior versions have a bug that prevents correct export. Please update your Blender: http://www.blender.org/download/.

I have no further plans for this addon. I consider it feature-complete. If there are requests for new features, I'll see if I can add them. If anything comes of the A:M to Blender action transfer effort, it will be a separate addon.

Share this post


Link to post
Share on other sites

Very very cool :).

Thank you very much nemyax.

 

Seems like a great addition.

 

See you

*Fuchur*

Share this post


Link to post
Share on other sites

Your efforts (and Blender's grease pencil function) are the prime movers in my continued interest in an A:M/Blender solution.

The two features added in this latest update strike at the core of two areas of great interest to me (specifially Named Groups and Bone-less (Mesh) Animation).

 

On the surfaced I'd say its also just really cool to see the creation of named groups and animation of shapes created outside of A:M.

I don't think folks truly appreciate what can be done in A:M with groups and simple animation.

 

I don't have the chops to even entertain such things but the fact that this code is python-based relying on open source Blender code opens up all manner of possibilities and room for growth. Imagine for instance, compiling a Blender branch that strips away all unnecessary Blender code and tailors what is remaining for direct use with A:M... the world can always use more ways to interact with A:M and its resources.

 

MANY THANKS Nemyax for your explorations and even more importantly for producing code that works! I can't speak for others but this certainly emboldens me to consider other productive workflows and endeavors of the future.

 

Now, if I can only learn to program... :P

 

Thanks!

Share this post


Link to post
Share on other sites

Imagine for instance, compiling a Blender branch that strips away all unnecessary Blender code and tailors what is remaining for direct use with A:M...

That's a bit radical =) What would you like to see in a branch like that?

Shape animation is indeed an interesting domain. With this update, you can probably do pose-to-pose (quite literally) shape transitions without much hassle. The shapes are still static though.

I just wish Grease Pencil had the option of using Bezier in addition to polylines.

Share this post


Link to post
Share on other sites

Your effort is greatly appreciated. I will look into this process

Share this post


Link to post
Share on other sites

That's a bit radical =) What would you like to see in a branch like that?

 

Definitely radical. ;)

 

I'd have to take a really hard look before answering (but I'll wait into the deep end anyway and flounder around trying to swim)

 

I suppose from a practical aspect a Blender/A:M branch might begin by turning almost everything off and removing each part of the build from the User Interface to get to the most streamlined interface possible that is compatible with A:M). Then, as each element was proven to work well with A:M it would be turned on and made available in the (A:M) master branch.

 

Itemizing what I"d like to see in such a build beyond what is currently there is complicated by what I think would be useful as opposed to what I expect others would consider useful.

For instance, leveraging tools to access popular/standardized file formats (FBX and USD) isn't of specific interest to me except where they can be best utilized to directly leverage A:M's spline/patch resources.

More broadly however, Blender signifies a considerable set of tools that can be used to interface with all manner of external tools, both those now present and those that will be developed in the future. Of those tools the ones of most interest to me personally are the same ones that practically everyone needs to use (regardless of their personal interests). Examples include:

 

- Project and Asset Management

- Storytelling Tools

- Video Editing

 

Each of these is a very complex area of concern and A:M has some considerable approaches to them that the current release supports but where full development is viewed as outside of the core developmental areas. There is little need for development of tools within A:M that are already available (for free) elsewhere... that parallel development can be costly in terms of duplicated effort... except where they leverage spline patch tools that build bridges to new and innovative solutions. To return to my list for a moment:

 

- Project and Asset Management. I largely see this as existing in the realm of operating systems where files are moved from place to place and highly searchable

 

- Storytelling Tools. Those of most interest to me personally are the ones that replicate functions used by animators in the heyday of traditional animation production. These include briefs, drafts, scripts, bar sheets, storyboards, animatics, dopesheets, grey sheets, layout and analytic/editorial/collaborative tools. These overlap easily with Project and Asset Mangement tools.

 

- (Video) Editing. My personal view is that editing should take place almost entirely prior to and perhaps even without the need for (final) rendering. We have grown overly fond of final rendering at the risk of jeopardizing entire productions. We lavish laboriously over one single frame when we need to set our efforts toward production of thousands. Better yet with realtime advancement (and spline/patch technology) much of a production can be realized without ever resorting to final rendering. This represents a considerable change of priorities however because we have fallen in love with rendering and will devote exorbitant time to refining aspects of production that have little or no value to the whole. This doesn't mean these efforts are useless but they brush up against the realm where editors must quickly decide what to retain and what to leave on the cutting room floor.

 

Blender is a one size fits all solution for production of animated content and improvements of late have been substantial.

Much of this is due to their approach that links actual production with development of the tools; good on them. The tools that are needed are developed while those of less immediate need are considered for retooling.

 

Can Blender work more closely with A:M?

I believe your current efforts demonstrate it can.

 

I'm not sure I answered the question but there you go. ;)

 

 

Aside: Part of my interest in a Blender build is truly basic... stemming from a general interest in how software (or any product for that matter) is produced.

Share this post


Link to post
Share on other sites

the ones of most interest to me personally are the same ones that practically everyone needs to use (regardless of their personal interests). Examples include:

 

- Project and Asset Management

- Storytelling Tools

- Video Editing

Project and asset management

The design choices for asset management weren't made in favour of files in Blender. The scene database is in a single file, but you can freely transfer and reference stuff across your .blend projects. And yes, they are searchable from within Blender.

Video editing

There's a built-in video editor. Funnily, Blender happens to be one of the best video editors (if not the best) available in open source. Admittedly, that doesn't say much for open source video editing. But you can get by in Blender.

Storytelling tools

Well, you can always put together a storyboard video using the video editor mentioned above. There's also the built-in text editor and painter.

Share this post


Link to post
Share on other sites

It's funny... A:M has at various times (I assume primarily behind the scenes for the developers) had some video editing capability.

We can see some of those vestigial elements in A:M and in some documentation.

I must assume that the solutions available did not represent an ideal solution for integration with A:M.

A similar example would be that of the Decal Editor which for a long time was a 'hidden feature'.

Why was it hidden? Because while it worked... it wasn't (yet) an optimal solution.

 

I'm a bit conflicted with regard to 'video' editing as I see it mostly as moving backward rather than embracing an optimal solution.

At best it's a necessary evil but I cannot help but see the waste produced with each tweak of a final render.

And yet, the results are often spectacular... which is why we still put so much effort into their production.

 

If I understand the optimal workflow for 'rendering' in A:M it would be as follows:

 

1. Begin to collect/create all required assets (starting with proxies/stand-ins where final assets are not yet available)

2. Move assets into proper orientations and positions

3. (and I hesitate to use this word) Render*

 

*Rendering is 'giving back' or 'translating' something that is already there but most people only see the term within the very narrow scope that means 'create a rasterized representation (a bitmap image)'. As much as I love the imagery produced from any moment in time, I cannot help but see significant flaws/flies in that particular orientation/ointment where it comes to animation.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...