Aller au contenu

Photo

Help with assigning texture please


  • Veuillez vous connecter pour répondre
9 réponses à ce sujet

#1
PaulTergeist

PaulTergeist
  • Members
  • 6 messages
Ok, before I start, I cannot model worth squat and Blender is like rocket surgery to me. So please have patience and use simple sentences :)
So I generated a mesh with a Java program, as an .obj file, like I did with the Fallout 3 items. Probably not a sane way, but I'm compensating for what I don't know (using Blender) with what I do (programming and basically describing the object as a curve to extrude.)
It has the U and V coordinates for each node too already.
I import it in Blender. So far so good, I have a nice grey weapon.
I assign it a material with a scratched metal image as a texture, set the input mapping to UV coordinates, output to color, hit F12 (render), it looks... well, I'd be lying if I said "looks good", but the texture is more or less where I expect it to be. This tells me that the UV coordinates are ok, or rather where I wanted them to be.
I export to FBX, strangely it contains no reference to the material. I try to make a .mmh.xml out of it (as per the instructions here: http://social.biowar...72/index/320619 ) and I don't get a .mao generated. The .mmh.xml also doesn't contain a material at all.
I go back into Blender, load my image into the UVTex too, export again. Same result.
The question is, basically: what am I doing wrong?
Alternately, can I just add the material reference to the .mmh.xml with a text editor?

#2
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
You'd be best served addressing such questions direct to the Blender export script's author, NewByPower, via the script's project page. I don't use Blender, so I can't help you with the specifics of his script. However, you can indeed manually edit the MMH.XML.



Open it in your text editor of choice. Down the bottom, look for a section that looks something like this:



<NodeMesh Name="XXXX" ID="_XX" MeshGroupName="XXXX" MaterialLibrary="YYYY" MaterialObject="YYYY" CastRuntimeShadow="1" CastBakedShadow="1" ReceiveBakedShadow="1" CutAway="0" PunchThrough="0">



You want to replace the YYYY with the name of your MAO file.

#3
PaulTergeist

PaulTergeist
  • Members
  • 6 messages
Thanks. It actually didn't have a MaterialLibrary or MaterialObject at all, so I must be doing something awfully wrong. At any rate, thanks, now I at least know what to insert and where.

#4
tmp7704

tmp7704
  • Members
  • 11 156 messages
Note this can be also done by modifying the compiled .mmh file with the Toolset, if for some reason you can't or don't want to touch the .xml version.



The equivalent of "ModelMesh" entries are children nodes marked as type "mshh" -- just open the only children node of the top-level structure, then check its children, the mshh entries are typically the last ones on the list. The name of your .mao file should be put in field MMH_MATERIAL_OBJECT there, without the .mao extension.

#5
PaulTergeist

PaulTergeist
  • Members
  • 6 messages
I think I'm doing something awfully wrong much earlier, in Blender, though. I'm obviously not setting the texture right or something :/

BTW, is there some way to just directly convert the .obj file, please? I mean, it already has the texture coordinates and all...

Modifié par PaulTergeist, 05 juin 2010 - 05:41 .


#6
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
Yes, you can convert it directly using tazpn's tool, but be aware that you may not always get desirable results using this route. Also, it's only feasible for static meshes. If you want to do animated meshes, you're going to have to use either use Blender + NewByPower's script or Max/GMax + ChewyGumball's and/or Eshme's script/s.

#7
PaulTergeist

PaulTergeist
  • Members
  • 6 messages
Thanks. I'll try that route then. I'm guessing a mace counts as a non-animated mesh, right?

#8
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
Yes. Weapons should be fine using tazpn's tool. You'll have to manually edit the XMLs to add in the node crusts though so it can receive FX like fire, etc. Here's a starting point - http://social.biowar...index/1709391/1

#9
PaulTergeist

PaulTergeist
  • Members
  • 6 messages
Hmm... Actually, now that you mention it, I had been wondering how to REMOVE those effects from existing weapons, because, well, carrying a flaming sword on my back looks like it would be uncomfortable and probably ruin my haircut ;) Thanks for the tip.

#10
PaulTergeist

PaulTergeist
  • Members
  • 6 messages
Ok, I eventually figured out that I need to explicitly ask for an UV Unwrap in Blender, although the mesh already had UV coordinates. Now I can run it through tazpan's tools run and get a .mao and all as expected.



I rename my mmh, msh and phy to w_mce_mc01a_0 since I want to replace that ugly mace, and copy them to override.



Now when I try to make a mace number 1 in the toolset I don't see anything at all :/