Page 1 of 2

.mesh.ascii importer updated for Blender 2.6.6

Posted: Thu Feb 21, 2013 7:26 am
by FigureSculptor
There were some changes to the Blender API with today's release of 2.6.6 that caused texture import to no longer work on my mesh importer.

You can find the updated version of the script here:

http://www.mediafire.com/?xx4u3xulht4gso9

Re: .mesh.ascii importer updated for Blender 2.6.6

Posted: Thu Feb 21, 2013 11:26 am
by iheartibuki
Awesome, thanks for sharing! BTW, I'm just curious, is there any reason as to why there aren't any exporters for any version of Blender > 2.49b? Not that I don't know how to find my way in 2.49b, but some folks might be more comfortable in the later versions of Blender.

Re: .mesh.ascii importer updated for Blender 2.6.6

Posted: Thu Feb 21, 2013 11:53 am
by Oyikell
I'll give it a shot.

@iheartibuki AFAIK, there is no exporter for newer versions of blender because is difficult to implement it with python (something related with the API and the newer features of Blender that doesn't allow to make a exporter). I don't know, maybe I'm wrong, is just what I've heard in TRF.

Re: .mesh.ascii importer updated for Blender 2.6.6

Posted: Thu Feb 21, 2013 11:56 am
by semory
an exporter should be possible, but since blender got ngons in 2.63, plugins written pre-2.63 must literally be completely rewritten.

Re: .mesh.ascii importer updated for Blender 2.6.6

Posted: Thu Feb 21, 2013 12:04 pm
by FigureSculptor
semory wrote:an exporter should be possible, but since blender got ngons in 2.63, plugins written pre-2.63 must literally be completely rewritten.
Actually, this isn't true. The API still makes traditional faces (tris and quads) available ever after the n-gon changes using a new property called "tessfaces". Literally, changing all the instances of .faces to .tessfaces will fix 95% of broken pre-2.62 scripts. There are some weird edge cases where you have to tweak a few other things, but most of my scripts were written pre-2.6.2 and were updated in a few minutes each after N-gon support was added.
Oyikell wrote:@iheartibuki AFAIK, there is no exporter for newer versions of blender because is difficult to implement it with python (something related with the API and the newer features of Blender that doesn't allow to make a exporter). I don't know, maybe I'm wrong, is just what I've heard in TRF.
It really isn't any more difficult to write a 2.6.x exporter than it is to write an exporter for the 2.49 script, it's just that the API was rewritten from scratch for 2.5+, isn't compatible with the old API, and wasn't well documented for a very long time. It made people hesitant to adopt the new API because it meant rewriting all their scripts.

The real reason, I'm guessing, is simply that it's a lot of work and the 2.49 script works well enough. That's my excuse, at least. :)

Re: .mesh.ascii importer updated for Blender 2.6.6

Posted: Thu Feb 21, 2013 12:56 pm
by semory
actually by rewritten i meant pre-2.5, i actually enjoy writing scripts moreso for 2.6 than 2.4x using bmesh. one thing I wanted to ask since another blender scripter is here... is there an easy way to compute a bone's roll parameter given a game's joint axis and length to child joint? or should i be more worried about setting the bone's matrix or matrix_local property (do setting these automatically adjust the roll parameter)?

that's also odd about tessfaces... just changing faces to tessfaces doesn't work for me... i had to call calc_tessfaces or something like that as well, if i recall right they aren't computed automatically for you right away.

Re: .mesh.ascii importer updated for Blender 2.6.6

Posted: Thu Feb 21, 2013 1:54 pm
by FigureSculptor
semory wrote:actually by rewritten i meant pre-2.5, i actually enjoy writing scripts moreso for 2.6 than 2.4x using bmesh. one thing I wanted to ask since another blender scripter is here... is there an easy way to compute a bone's roll parameter given a game's joint axis and length to child joint? or should i be more worried about setting the bone's matrix or matrix_local property (do setting these automatically adjust the roll parameter)?
You know, I thought I knew the answer to this, but now that I think about it, I'm not sure I do. :) I had always assumed that a bone matrix would include the roll. A 4x4 matrix is certainly capable of holding what is, in essence, a local-space axis rotation. I think that Blender will do the right thing if you give it a matrix with roll, but I don't know it for sure. I think I essentially "ported" the logic from the 2.49b script into mine and don't really remember much about it.
semory wrote:that's also odd about tessfaces... just changing faces to tessfaces doesn't work for me... i had to call calc_tessfaces or something like that as well, if i recall right they aren't computed automatically for you right away.
I think it depends on how you create your faces to begin with. I had to do this with one of my scripts, but not the remainder. IIRC, it was whether I created the faces individually or passed in arrays of vertices and face indices. I think it was even more complex than that, and I don't honestly remember the specifics.

Sorry I can't help more. I'm a pretty "trial and error" Blender coder.

Re: .mesh.ascii importer updated for Blender 2.6.6

Posted: Thu Feb 21, 2013 2:00 pm
by semory
FigureSculptor wrote:Sorry I can't help more. I'm a pretty "trial and error" Blender coder.
Hahahhahahahaa you and me both then... still, glad to have another programmer on board :). Just don't say you know PHP or else I will twist your arms, stick my foot up your butt, and gagball your mouth until you fix the broken chatbox he he he.

Re: .mesh.ascii importer updated for Blender 2.6.6

Posted: Tue Feb 26, 2013 7:48 am
by ProtocolX27
^ Were you provided the source code for the chat box?

I may or may not be able to assist ... :twisted:

Re: .mesh.ascii importer updated for Blender 2.6.6

Posted: Fri Apr 05, 2013 3:05 am
by Anx
Unfortunately, clicking on the link does nothing.