Poll time! Click here: Are you interested in the chiptune scene? If so, which?. Let's see what our community thinks of the chiptune scene. :) !

Blender- and Python-compatible 3D export format?

Post questions about game models here, or help out others!
Post Reply
Ryusui
n00b
Posts: 13
Joined: Sun Feb 02, 2014 6:43 am
Has thanked: 4 times

Blender- and Python-compatible 3D export format?

Post by Ryusui » Thu Feb 06, 2014 10:52 am

So I've run into a snag with my model ripping experiment that isn't related to the actual format of the files I'm trying to extract models and animations from. I'm having trouble finding a good export format to work with: at first I managed to export models in .OBJ format, but then I discovered .obj doesn't support animation, so I switched to the PyCollada library so I could export them in .DAE format, but PyCollada doesn't actually allow me to export animations, so I'm back to square one.

Does anyone know of a good Blender-friendly format that has animation support and, hopefully, a decent Python library? (I suppose there's nothing stopping me from rewriting my tools in C++ or something if it comes to it, but...)

SergeantJoe
mega-veteran
mega-veteran
Posts: 241
Joined: Fri Aug 30, 2013 5:39 am
Has thanked: 56 times
Been thanked: 20 times

Re: Blender- and Python-compatible 3D export format?

Post by SergeantJoe » Thu Feb 06, 2014 11:02 am

Try Source SMD. I don't know about Python, but it has a ton of existing plugins and such.

Ryusui
n00b
Posts: 13
Joined: Sun Feb 02, 2014 6:43 am
Has thanked: 4 times

Re: Blender- and Python-compatible 3D export format?

Post by Ryusui » Thu Feb 06, 2014 11:29 am

Useful, useful. And plain ASCII to boot; it shouldn't be hard to write a Python exporter. :3

Question, though: it says I can only have one animation per SMD file. I'm fairly certain I'll have to export multiple animations; what should I do? Just string 'em all together in the same file, or export a separate file for each animation?

SergeantJoe
mega-veteran
mega-veteran
Posts: 241
Joined: Fri Aug 30, 2013 5:39 am
Has thanked: 56 times
Been thanked: 20 times

Re: Blender- and Python-compatible 3D export format?

Post by SergeantJoe » Thu Feb 06, 2014 11:32 am

I'm pretty sure a separate file for each one would be the best plan.

User avatar
Bastien
advanced
Posts: 70
Joined: Sun Apr 15, 2012 1:08 am
Has thanked: 26 times
Been thanked: 12 times

Re: Blender- and Python-compatible 3D export format?

Post by Bastien » Fri Feb 07, 2014 7:20 pm

If you're getting the data from the game using python, why not directly create a blender addon/script using its python api? You could do it for Noesis too.

Ryusui
n00b
Posts: 13
Joined: Sun Feb 02, 2014 6:43 am
Has thanked: 4 times

Re: Blender- and Python-compatible 3D export format?

Post by Ryusui » Sat Feb 08, 2014 1:48 am

Would it be possible to import data from multiple files at once that way? 'Cause that's what I have to work with. I've got meshes in one, textures in another, skinning data in yet another, what I suspect is vertex-based animations in a fourth, and finally, a big whopper file that I presume contains bones and animations. Note also that not all the meshes have corresponding files for all these data types.

Also, I know this probably marks me as hyper-noob, but what's Noesis?

SergeantJoe
mega-veteran
mega-veteran
Posts: 241
Joined: Fri Aug 30, 2013 5:39 am
Has thanked: 56 times
Been thanked: 20 times

Re: Blender- and Python-compatible 3D export format?

Post by SergeantJoe » Sat Feb 08, 2014 1:56 am

It's a universal model viewer, can import/export pretty much anything.

viewtopic.php?f=33&t=4582

EDIT: And jeez, you don't need to go around thanking every single post. All I did was give you a link.
I certainly appreciate it, but it seems a little extreme.

User avatar
Bastien
advanced
Posts: 70
Joined: Sun Apr 15, 2012 1:08 am
Has thanked: 26 times
Been thanked: 12 times

Re: Blender- and Python-compatible 3D export format?

Post by Bastien » Sat Feb 08, 2014 7:27 am

Ryusui wrote:Would it be possible to import data from multiple files at once that way? 'Cause that's what I have to work with. I've got meshes in one, textures in another, skinning data in yet another, what I suspect is vertex-based animations in a fourth, and finally, a big whopper file that I presume contains bones and animations. Note also that not all the meshes have corresponding files for all these data types.
Yes you can. There are many ways to do it, like having a function that acceps multiple arguments for different files, taking a folder as an argument and read all files inside, accept only one file and then find the other files automatically, etc.

Blender/Noesis API is only to "build" mesh/meshes, how you get the data and pass it to those APIs is up to you, using any method in python you think is best.
I don't think there are many examples around. If you need help with python/blender ask me.

User avatar
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 501 times

Re: Blender- and Python-compatible 3D export format?

Post by MrAdults » Sat Feb 08, 2014 9:57 pm

The fmt_gamebryo_nif.py script that comes with Noesis is a pretty good example of everything you could want to do in that realm, with handling for multiple geometry types, multi-platform texture handling and decoding/untiling, key framed animations, and lots of other crap. Sadly, meaningful documentation for Noesis still only exists in my head.

Post Reply