Sponsored Adverts

Author Topic: [MD5] EXPORT script for Blender 2.6x (OPEN)  (Read 167144 times)

0 Members and 1 Guest are viewing this topic.

Offline oladitan

  • Newbie
  • Posts: 3
Problems with 2.63 MD5 Anim Only export
« Reply #210 on: August 26, 2014, 12:39:37 AM »
Hello. I am using the Blender 2.63 MD5 export script. Everything seems to work fine when I export my model with the active animation together with the 'Mesh and Anim' option. however when I try to export other animation with the 'Anim Only' option. blender has an error. This error occurs in both blender 2.63 and 2.71

Code: [Select]
location: <unknown location>:-1
Exporting selected objects...
root bone: Bone
Processing mesh: mesh1
created verts at A 80, B 0, C 88
<io_export_md5-263.MD5Animation object at 0x0000000009A026D8>
Traceback (most recent call last):
File "C:\Users\oladitan\AppData\Roaming\Blender Foundation\Blender\2.71\script
s\addons\io_export_md5-263.py", line 904, in execute
save_md5(settings)
File "C:\Users\oladitan\AppData\Roaming\Blender Foundation\Blender\2.71\script
s\addons\io_export_md5-263.py", line 854, in save_md5
generateboundingbox(objects, anim, [rangestart, rangeend])
File "C:\Users\oladitan\AppData\Roaming\Blender Foundation\Blender\2.71\script
s\addons\io_export_md5-263.py", line 559, in generateboundingbox
(min, max) = getminmax(corners)
File "C:\Users\oladitan\AppData\Roaming\Blender Foundation\Blender\2.71\script
s\addons\io_export_md5-263.py", line 514, in getminmax
if len(listofpoints[0]) == 0: return ([0,0,0],[0,0,0])
IndexError: list index out of range

I followed the instructions on the page where I downloaded the ad don.

Do I need to change a line in plugin code or something. Thanks.

Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2348
Re: Problems with 2.63 MD5 Anim Only export
« Reply #211 on: August 26, 2014, 08:34:16 AM »
Which script did you use? The one authored by keless here, or the one by nemyax here? If you used keless' script that looks like a bounding-box issue so make sure you have the mesh selected even though you're only exporting the animation (also make sure its assigned to the Armature before export - it should be the active sequence).

Offline oladitan

  • Newbie
  • Posts: 3
Re: Problems with 2.63 MD5 Anim Only export
« Reply #212 on: August 27, 2014, 09:05:19 AM »
Which script did you use? The one authored by keless here, or the one by nemyax here? If you used keless' script that looks like a bounding-box issue so make sure you have the mesh selected even though you're only exporting the animation (also make sure its assigned to the Armature before export - it should be the active sequence).

Thanks kat. I was using the keles script. I have tried the nemyax script as well. It gives me this error when I try to the mesh or the animation : The

Code: [Select]
The deforming armature has no bones in layer 5.
Add all of the bones you want to export to the armature's layer 5,
or change the reserved bone layer in the scene properties,
and retry export.

All of the bones of the armature are on the first layer of the armature layers. the armature is on layer 1 of the scene. The object, in this case a cube, is parented to the armature and deforms. The animation that I want to export is active int the action editor.


I have attached a file that I made using blender 2.71. Maybe you can reproduce the error.

Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2348
Re: [MD5] EXPORT script for Blender 2.6x (OPEN)
« Reply #213 on: August 27, 2014, 11:37:53 AM »
Hmm problem replicated in 2.71 using keless' script when exporting to "Anim only". Otherwise there are no issues. It looks like Blender can't determine the animations boundingbox area for some reason, not sure why.

The work-around for the moment (obviously aside from the script being fixed) is to just export each sequence with a copy of the mesh at the same time, that works without OK - just delete the unwanted mesh files once done.

Side note: generally speaking MD5 can't make use of animations with scaled/resized bones - if you do that, whilst you'll get data output, unless you specifically allow for it in the game engine you're using, nothing will happen on playback.

P.S. merged topics to keep everything in one place by the way.


Offline Bitterman

  • Newbie
  • Posts: 3
Re: [MD5] EXPORT script for Blender 2.6x (OPEN)
« Reply #214 on: July 16, 2015, 01:31:58 AM »
Long time ago in thread “[MD5] EXPORT script for Blender 2.6x (OPEN)” kat wrote (by answer to Rajveer):

Quote
“Just to check this further the below is the first line from the 'bounds' block exporting the same (original) Bob file from each script corresponding version of Blender - before export MESH objects were reset so their size and origin were relative to Blenders grid-centre (used "Apply" to set Origin points at 0,0,0) - the bounding box values are calculated relative to that position (outwards).

It looks like either there's an error in the script or Blender itself (in terms of what it's doing relative to the script) after the significant change that happened Blender 2.60 onwards - looking at the numbers from 2.62 the bounds do indeed appear to be a flat box compared to prior that.”

Rajveer talk about problem with incorrect values inside “bounds” section into .md5anim.

This is not obvious problem because Blender and modelviewer (imho) don’t show ‘bounds’.

But if anyone try to test exported model in Doom 3 with ‘testmodel <name>/testanim <name>/r_showskel 1’ console commands then we see as md5 bounding box is offset and distorted along one of axis (Y-components in max [X,Y,Z] as I think).

Not sure but it’s may be bad for game physics (see pictures).

Take a look (this is “io_export_md5.py” for Blender 2.59+ but algorithm is same in 2.4x-2.6x):

Code: [Select]
>>> corners.append(point_by_matrix (v, matrix)) <<<
(min, max) = getminmax(corners)
md5animation.bounds.append((min[0]*scale, min[1]*scale, min[2]*scale, max[0]*scale, max[1]*scale, max[2]*scale))

We see that ‘bounds’ based on ‘corners’ and ‘corners’ are mul by ‘matrix’ (few lines above):

Code: [Select]
def generateboundingbox(objects, md5animation, framerange):
  …
        matrix = [[1.0,  0.0, 0.0, 0.0],
          [0.0,  1.0, 0.0, 0.0],
  >>> [0.0,  1.0, 1.0, 0.0], <<< there is two (not one) correction values!
          [0.0,  0.0, 0.0, 1.0],
          ]
     
I belive this row (or column) >>> [0.0,  1.0, 1.0, 0.0] <<< give a distortion by added some value to Y-component (or other) in max[X,Y,Z] because:

Code: [Select]
def point_by_matrix(p, m):

return [p[0] * m[0][0] + p[1] * m[1][0] + p[2] * m[2][0] + m[3][0],
          p[0] * m[0][1] + p[1] * m[1][1] + p[2] * m[2][1] + m[3][1],
          p[0] * m[0][2] + p[1] * m[1][2] + p[2] * m[2][2] + m[3][2]]

Now try to solved (I hope):

1.   Open “io_export_md5.py” in editor (Notepad).
2.   Add “cornersb = []” after “corners = []”.
3.   Add “matrixb = [[1.0,  0.0, 0.0, 0.0],
          [0.0,  1.0, 0.0, 0.0],
          [0.0,  0.0, 1.0, 0.0], 
          [0.0,  0.0, 0.0, 1.0],
          ]”

after “matrix = […]”.

4.   Add “cornersb.append(point_by_matrix (v, matrixb))” after “corners.append(point_by_matrix (v, matrix))”.
5.   Change “(min, max) = getminmax(corners)” to “(min, max) = getminmax(cornersb)”.
6.   Save modified “io_export_md5.py” in same place (blender/…/scripts/addons).

After this I see correct (well… almost correct) values into ‘bounds’ (see pictures).
Not sure about others but it seems work.

Hope this help.

Bitterman.






Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2348
Re: [MD5] EXPORT script for Blender 2.6x (OPEN)
« Reply #215 on: July 16, 2015, 02:04:13 AM »
Ah that makes sense. Will test this ASAP then post an updated version of the script. Thanks for figuring out where the problem seemed to lie so this error can be put to rest ;)

Offline Bitterman

  • Newbie
  • Posts: 3
Re: [MD5] EXPORT script for Blender 2.6x (OPEN)
« Reply #216 on: July 18, 2015, 01:58:40 AM »
Sorry, not so easy.

Almost work for idle anim, but work incorrect for move. Some axis troubles.

Problem is marked correct but solution is somewhere nearby.

Need more complex changes (perhaps with reorient [x,y,z] into 'bounds').

Can you show this guys who wrote script (keless, der_ton or others)?

Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2348
Re: [MD5] EXPORT script for Blender 2.6x (OPEN)
« Reply #217 on: July 18, 2015, 03:10:46 AM »
Not sure how active either keless or der_ton are these days so it may be a case of looking at what other options there are.

Offline Bitterman

  • Newbie
  • Posts: 3
Re: [MD5] EXPORT script for Blender 2.6x (OPEN)
« Reply #218 on: July 19, 2015, 05:34:53 AM »
Well it seems to work with simple anims.

Is there a special rules for origin bone (move, loc/rot/scale)? Perhaps I do it wrong.

Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2348
Re: [MD5] EXPORT script for Blender 2.6x (OPEN)
« Reply #219 on: July 19, 2015, 07:55:27 AM »
Just had a look at an old file and it seems this may be a long standing issue that's not been noticed before because preference was to using simple primitives for collision and AF rather than using bone shapes and boundings. Do you explicitly need to use bone bounding boxes to define something? I should add the the character I checked seemed to interact with the world without any noticeable issues even though the pink boxes were much larger than they should probably be.

Offline Ganataphy

  • Newbie
  • Posts: 3
(md5) HELP! Blender md5 exporter messes up bones!
« Reply #220 on: September 04, 2015, 02:37:13 AM »
Can anyone explain what is going on here?
I keep trying to export md5mesh and md5 anim models using Blender 2.75 with the latest version of the KatsBits md5 exporter, but everytime that happens I just keep getting the mess depicted below, where ALL THE BONES ARE REALIGNED, destroying the entire hierarchy and positioning I had originally specified.

Suggestions to insert a root bone at 0,0,0 (is this EVEN possible?) and to make it non-deformable by unchecking "Deform" have also failed to prevent the problem from recurring.

I am really pressed for time and there is very little information to go around on what exactly is causing this issue. I've tried five different tutorials, redid the armature, apply changes in dimension and so forth, but NOTHING WORKS. Is there something wrong or am I just another stupid noobe as usual?


Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2348
Re: (md5) HELP! Blender md5 exporter messes up bones!
« Reply #221 on: September 04, 2015, 02:55:23 AM »
The script does work for 2.75a so it's not that causing the problem per se. Also when exporting are you exporting BOTH *.md5mesh and *.md5anim at the same time, or just choosing to export one or the other - EITHER *.md5mesh OR *.md5anim (you're exporting only the mesh or only the animation)? Post a screenshot of what your character or object should look like.

Indecently, yes whatever is being animated the rig needs to have a 'root' or 'master' bone to which everything is parented/chained, that bone acts as a positional anchor so if the rig doesn't have one that might explain why it collapses in on itself.

Offline Ganataphy

  • Newbie
  • Posts: 3
Re: [MD5] EXPORT script for Blender 2.6x (OPEN)
« Reply #222 on: September 04, 2015, 04:39:57 AM »
I can't export md5anim, I need an md5mesh first. But attempting to export the following model below resulted in the following faults:
  • Bone structure was broken, all heads of bones were aligned to 0,0,0
  • Bones were distorted out of proportion
The only thing that worked was the md5anim, and even then the md5anim files were useless.

I have no idea what is going on. I rigged it with empty groups connected to bones, I parented the multiple meshes of the scene to the armature, I also set a SINGLE root bone, but to no avail. Are you trying to say that EVERY bone has to be parented to BOTH the root bone as well to whatever other bones they are linked? it does not make sense because some bones such as those controlling eyes were soon relinked by the MD5 exporter to the root bone (or whatever passed for it). Moreover AFAIK you can't have an object have multiple parents under Blender.

Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2348
Re: [MD5] EXPORT script for Blender 2.6x (OPEN)
« Reply #223 on: September 04, 2015, 06:22:30 AM »
The 'root' or 'master' bone is just that, the 'root' of the entire rig, it sits at the very top of the skeletons hierarchy similar to like this;
Code: [Select]
root
> hips
> > legs
> > spine
> > > arms
> > > head

If you try to export a rig without one the result is similar to what you're seeing; output considers the first bone of each chain as a 'root', re-positioning the 'head' end of the bone to "0".

You should be able to export the mesh and rig without a animation but it might be worth creating a single framed Action so something is there export can reference - its possible that exporting without an animation could collapse the rig but that's unlikely as the 'bindpose' (the default position of each bone) is usually baked as reference.

You can export multiple mesh at the same time so long as they are correctly parented/linked to the Armature so that shouldn't be the issue.

If you have any Modifiers assigned to any of the bones try removing them and exporting the raw rig to see if the problem persists.

Offline Ganataphy

  • Newbie
  • Posts: 3
Re: [MD5] EXPORT script for Blender 2.6x (OPEN)
« Reply #224 on: September 04, 2015, 07:55:06 AM »
You will have to give me some time to experiment with it. My skills at Blender are fairly rudimentary, and extend only so far as rigging and texturing is concerned - modelling and unwrapping takes place under 3ds Max 5.1.

All I can say is that I do the following:
  • New armature is established by inserting and extruding bones, then repositioning bones in Edit mode.
  • Meshes are parented to the armature (not bones) with empty vertex groups.
  • Weight paint is then used to dictate which vertex groups are valid for which parts of the mesh.
  • Animations are done using Pose mode.

This is all I do, nothing more, nothing less. Is there something missing from my armature/rigging workflow that is causing the issue of bone heads re-aligning?

 

Sponsored Adverts
RSS Copyright © 2019 KatsBits™. All Rights Reserved. No part of this or associated properties shall be reproduced without prior consent. AdvertisePrivacy PolicyDMCA (about DMCA) • Copyright PolicyCopyright Contact Home Blog Support About Contact Site Search Site Map RSS feed Forum YouTube FaceBook LinkedIn Twitter Instagram IMVU