Author Topic: Help with meshes?  (Read 1857 times)

Offline Vidathelion

  • Experienced Traveler
  • **
  • Posts: 246
  • Country: 00
  • Floof-O-Meter: 5
    • www.deviantart.com/cynde
    • www.youtube.com/channel/UC90KdyZ
    • http://feebleturtleduck-artz.tum
    • View Profile
Help with meshes?
« on: August 13, 2018, 04:49:08 am »
Thought I'd post a new thread because the original one relating to this went from 'help with textures' to I need help with meshes, plus I had another question about another mesh, so...

I was trying to make a custom cowboy hat with a band around the middle of it, but discovered issues with the mesh
TLDR: After countless experimenting the textures don't work with the model, nigh unusable. The user WolfQueen said "that's because the UV map isn't assigned to the existing mesh, so the game couldn't read it. in order for that UV map to work a new mesh has to be exported."

So how does one do that? Is there a tutorial for me to do that? I'm assuming just dragon the mesh(the mesh is to the "Applejack Low" hat) and export it into a mesh file via blender? Could anyone help with that?:c

My second mesh question is how do I get a item from one side of the head to the other? I want to use the "Devils lock" hair mesh, but where it covers the LEFT eye instead of the right. I know the items notepad file has rotation and such, would I do that through there?

thanks!

Offline Kuri

  • Immortal Legend
  • *****
  • Posts: 8,168
  • Country: nz
  • Floof-O-Meter: 136
  • Foreboding evil harmless kitten.
    • dumbstuff4friends
    • channel/UCo42jgbLvEzkofpOin0_a4A
    • View Profile
Re: Help with meshes?
« Reply #1 on: August 13, 2018, 06:03:51 am »
I"m not cool enough to now how to open the meshes in blender, someone who frequents this forum might admit to knowing how in a PM to you though.

As for the rotation... not all bones have their rotational plane in the normal sense, often they're upside down or in the toes case, tilted 45 degrees in directions i haven't quite discerned.
Here, have some code

[Devil's Lock]
mesh=DevilsLockMane.mesh
material=DevilsLockWhite
bone=forehead
offset_f=0 .5 -.4
rotation_f=0 0 0
offset_c=0 1 -1
rotation_c=20 0 0

Purple is for canines, green for felines. The red, is ... on the main body? i think, was the rotation for swapping the mesh around to face the other way? change it from 180, If' i'm mistaken, which i probably am you can change it back & change one of the other values.
The Japanese concept of wabisabi:
The closest concept in english would be 'rustic'
They might have an old thing, one example is a favourite bowl or dish, it's broken, pieces are missing, why fix it?  With gold and pieces from other dishes?
"Because it was my favourite & I like it"

Offline Vidathelion

  • Experienced Traveler
  • **
  • Posts: 246
  • Country: 00
  • Floof-O-Meter: 5
    • www.deviantart.com/cynde
    • www.youtube.com/channel/UC90KdyZ
    • http://feebleturtleduck-artz.tum
    • View Profile
Re: Help with meshes?
« Reply #2 on: August 13, 2018, 07:15:15 am »
I"m not cool enough to now how to open the meshes in blender, someone who frequents this forum might admit to knowing how in a PM to you though.

As for the rotation... not all bones have their rotational plane in the normal sense, often they're upside down or in the toes case, tilted 45 degrees in directions i haven't quite discerned.
Here, have some code

[Devil's Lock]
mesh=DevilsLockMane.mesh
material=DevilsLockWhite
bone=forehead
offset_f=0 .5 -.4
rotation_f=0 0 0
offset_c=0 1 -1
rotation_c=20 0 0

Purple is for canines, green for felines. The red, is ... on the main body? i think, was the rotation for swapping the mesh around to face the other way? change it from 180, If' i'm mistaken, which i probably am you can change it back & change one of the other values.

I hope so:'o that be nice if someone could help aha

Nothing happened :'D thanks though
I guess there's no way to rotate it to the other side of the head without blender maybe

Offline FlyingGrass

  • ~🛠 The avant-garde doctor of mechanical beings. 🔧 🔬
  • Elder Grey Pelt
  • ****
  • Posts: 2,516
  • Country: 00
  • Floof-O-Meter: 121
  • Avatar=Me|Signature=Me
    • FlyingGrass
    • channel/UCA7RfqQ1KLl4s8JhxIXNs_Q
    • View Profile
    • Mechanicafeles Discord link
Re: Help with meshes?
« Reply #3 on: August 13, 2018, 07:19:29 am »
You could try changing the value to half the number you first changed it to. I've encountered items rotating 360 degrees when I bumped the numbers around, but I don't know what I set the number to for the item to have rotated all the way around.
« Last Edit: August 13, 2018, 07:21:34 am by FlyingGrass »

My presets.

Good things take time, so I'll take an eternity and create something so good that the human brain can't handle the sheer goodness of it.

Offline Vidathelion

  • Experienced Traveler
  • **
  • Posts: 246
  • Country: 00
  • Floof-O-Meter: 5
    • www.deviantart.com/cynde
    • www.youtube.com/channel/UC90KdyZ
    • http://feebleturtleduck-artz.tum
    • View Profile
Re: Help with meshes?
« Reply #4 on: August 13, 2018, 07:34:45 am »
You could try changing the value to half the number you first changed it to. I've encountered items rotating 360 degrees when I bumped the numbers around, but I don't know what I set the number to for the item to have rotated all the way around.

would that cause the hair to move the LEFT side of the face?o:

Offline FlyingGrass

  • ~🛠 The avant-garde doctor of mechanical beings. 🔧 🔬
  • Elder Grey Pelt
  • ****
  • Posts: 2,516
  • Country: 00
  • Floof-O-Meter: 121
  • Avatar=Me|Signature=Me
    • FlyingGrass
    • channel/UCA7RfqQ1KLl4s8JhxIXNs_Q
    • View Profile
    • Mechanicafeles Discord link
Re: Help with meshes?
« Reply #5 on: August 13, 2018, 08:31:24 am »
You could try changing the value to half the number you first changed it to. I've encountered items rotating 360 degrees when I bumped the numbers around, but I don't know what I set the number to for the item to have rotated all the way around.

would that cause the hair to move the LEFT side of the face?o:
Depends on what number you change. Sometimes the item is rotated in such a way where the numbers rotate it different ways than normal.

My presets.

Good things take time, so I'll take an eternity and create something so good that the human brain can't handle the sheer goodness of it.

Lucius

  • Guest
Re: Help with meshes?
« Reply #6 on: August 13, 2018, 08:44:04 am »
It's not that the Applejack hat doesn't have a UV map assigned to it, it's that the current UVs are abhorrent and probably nearly impossible to use for what you want to do.

Now, instead of the usual angry rambling about UVs and meshes that I indulge some of my friends in, I'll do something more productive; I will do my best to teach you how to fix these issues yourself.

Mesh Tutorial


Let's start at the beginning. You will need Blender 2.49b and all of its dependencies. Blender is a free modeling software, and while it's not my favorite, it gets the job done quite adequately.

Since the 2.49b version is a bit dated, I'll link you to where you can download it, along with Python 2.6, the programming language that is required by the software.

   Blender 2.49b
Python 2.6.2



Once you got blender working as it should, we can proceed. The next step is to get Blender to import and export .MESH files, which is OGRE's 3D model file format. To do that, you'll need to download three things.


   First, you'll need the Ogre XML Converter which will allow us to convert files to and from the .MESH.XLM format.

Then, you'll want the Torchlight to Blender Master files. They come with an import and export, but for me personally, only the import worked as it should.

The last thing we need is the Blender Export files if the previous file's exporter didn't work for you either.


For the Ogre XML Converter, you'll want to extract the contents to a new folder that you'll know where to find, as you'll be using it often when dealing with FeralHeart models and will also need to provide the correct file path for your importer to use.

The way I installed the rest of the items was by extracting all the contents from the zip files (except the Ogre XML Converter) into the C:\Program Files (x86)\Blender Foundation\Blender\.blender\scripts folder.



Before we can test the plugins in blender, you'll need to edit your __init__.py file, which will be located in your \Blender Foundation\Blender\.blender\scripts folder. Use notepad to open it up and find this line:

# Path for your OgreXmlConverter
OGRE_XML_CONVERTER = "C:/msys64/mingw64/bin/OgreXmlConverter.exe"

Change the C:/msys64/mingw64/bin/ to the file path where you extracted your Ogre XML Converter.

After that, you should open up Blender and hover over Files > Import and see "OGRE for Torchlight (*.MESH)" as well as hover over Files > Export and see "Ogre XML".



The next step is opening the Applejack hat in Blender. The AppleJackHat and AppleJackHatLow both use the same mesh, so we only need to modify one item.

Open up Blender and import the AppleJackHat.mesh which should be located in your FeralHeart\media\items folder. To do this, go to File > Import > OGRE for Torchlight (*.MESH).

Right click on the hat mesh and then change your Mode from Object Mode to Edit Mode. All of the hat's vertices should be selected by default, but if they get unselected accidentally, just hit A and they'll all be selected again.


Next, change your Window Type from the Buttons Window to the UV/Image Editor. You'll be greeted with a rather horrid UV layout.


Not to worry, we can fix this. Select the UVs button and then click "Unwrap", or alternatively just hit E on your keyboard and then click "Unwrap" again in the little message box.



Now you have workable UVs, you should be proud; it's most certainly good progress.

But we're not out of the woods yet. The exporter (or importer—not sure which), for some reason, rotates the object forwards on the X axis 90 degrees. To counteract this, we're going to rotate the object back 90 degrees on the X axis.

To do this, click on the button called "Object" and then hit "Transform Properties", or alternatively hit N on your keyboard.


This should open up a little window. In that window, set RotX to -90.00 and hit enter.


Once that's done, go back to the Object menu and select the Clear/Apply submenu. From there, select "Apply Scale/Rotation to ObData" or alternatively use the keyboard shortcut Ctrl+A and then select the appropriate option. You should see the RotX turn to 00.00 in the Transformation Properties window.




Next, we need to export this new mesh back out into a .MESH file. To do that, change your Mode back from Edit Mode to Object Mode and go to File > Export > Ogre XML.


Ignore the Scene.material since the hat already comes with a material file by default. Unselect the "Export Armatures" option, since the hat isn't rigged to any joints in the scene.

Input your Export Directory by clicking on the "Select" button to the right and select the folder where you want your object to be exported.

Now we want to rename the newly exported applejackhat.mesh.xml to AppleJackHat.mesh.xml before opening it in notepad. Find where it says material="defaultMat" and change defaultMat to AJH. Once that's done, save the file.

For the last step, open up the folder containing your Ogre XML Converter in a new window. You're going to drag the AppleJackHat.mesh.xml file into the OgreXmlConverter.exe program. That should spit out a new file called AppleJackHat.mesh.

Be careful not to drag your file from a folder that already has the same filename as what your exported file will be called, since that can cause problems.



Congratulations, you should now be able to use these UVs for your hat.

Before copy and pasting your hat mesh back to your FeralHeart\media\items folder, you should make a back up of the old one in case something goes wrong.

Aside from that, you can now use these new UVs



While I highly suggest you try to do this yourself for the sake of learning, I can also understand why you might not want to go through all of this for one object, so here's a packaged version ready to use. Place the .MESH file where it belongs and use the UVs to create a new texture.

AppleJackHat_New.zip
« Last Edit: August 13, 2018, 08:58:35 am by Lucius »

Offline Vidathelion

  • Experienced Traveler
  • **
  • Posts: 246
  • Country: 00
  • Floof-O-Meter: 5
    • www.deviantart.com/cynde
    • www.youtube.com/channel/UC90KdyZ
    • http://feebleturtleduck-artz.tum
    • View Profile
Re: Help with meshes?
« Reply #7 on: August 13, 2018, 09:42:50 am »
It's not that the Applejack hat doesn't have a UV map assigned to it, it's that the current UVs are abhorrent and probably nearly impossible to use for what you want to do.

Now, instead of the usual angry rambling about UVs and meshes that I indulge some of my friends in, I'll do something more productive; I will do my best to teach you how to fix these issues yourself.

Mesh Tutorial


Let's start at the beginning. You will need Blender 2.49b and all of its dependencies. Blender is a free modeling software, and while it's not my favorite, it gets the job done quite adequately.

Since the 2.49b version is a bit dated, I'll link you to where you can download it, along with Python 2.6, the programming language that is required by the software.

   Blender 2.49b
Python 2.6.2



Once you got blender working as it should, we can proceed. The next step is to get Blender to import and export .MESH files, which is OGRE's 3D model file format. To do that, you'll need to download three things.


   First, you'll need the Ogre XML Converter which will allow us to convert files to and from the .MESH.XLM format.

Then, you'll want the Torchlight to Blender Master files. They come with an import and export, but for me personally, only the import worked as it should.

The last thing we need is the Blender Export files if the previous file's exporter didn't work for you either.


For the Ogre XML Converter, you'll want to extract the contents to a new folder that you'll know where to find, as you'll be using it often when dealing with FeralHeart models and will also need to provide the correct file path for your importer to use.

The way I installed the rest of the items was by extracting all the contents from the zip files (except the Ogre XML Converter) into the C:\Program Files (x86)\Blender Foundation\Blender\.blender\scripts folder.



Before we can test the plugins in blender, you'll need to edit your __init__.py file, which will be located in your \Blender Foundation\Blender\.blender\scripts folder. Use notepad to open it up and find this line:

# Path for your OgreXmlConverter
OGRE_XML_CONVERTER = "C:/msys64/mingw64/bin/OgreXmlConverter.exe"

Change the C:/msys64/mingw64/bin/ to the file path where you extracted your Ogre XML Converter.

After that, you should open up Blender and hover over Files > Import and see "OGRE for Torchlight (*.MESH)" as well as hover over Files > Export and see "Ogre XML".



The next step is opening the Applejack hat in Blender. The AppleJackHat and AppleJackHatLow both use the same mesh, so we only need to modify one item.

Open up Blender and import the AppleJackHat.mesh which should be located in your FeralHeart\media\items folder. To do this, go to File > Import > OGRE for Torchlight (*.MESH).

Right click on the hat mesh and then change your Mode from Object Mode to Edit Mode. All of the hat's vertices should be selected by default, but if they get unselected accidentally, just hit A and they'll all be selected again.


Next, change your Window Type from the Buttons Window to the UV/Image Editor. You'll be greeted with a rather horrid UV layout.


Not to worry, we can fix this. Select the UVs button and then click "Unwrap", or alternatively just hit E on your keyboard and then click "Unwrap" again in the little message box.



Now you have workable UVs, you should be proud; it's most certainly good progress.

But we're not out of the woods yet. The exporter (or importer—not sure which), for some reason, rotates the object forwards on the X axis 90 degrees. To counteract this, we're going to rotate the object back 90 degrees on the X axis.

To do this, click on the button called "Object" and then hit "Transform Properties", or alternatively hit N on your keyboard.


This should open up a little window. In that window, set RotX to -90.00 and hit enter.


Once that's done, go back to the Object menu and select the Clear/Apply submenu. From there, select "Apply Scale/Rotation to ObData" or alternatively use the keyboard shortcut Ctrl+A and then select the appropriate option. You should see the RotX turn to 00.00 in the Transformation Properties window.




Next, we need to export this new mesh back out into a .MESH file. To do that, change your Mode back from Edit Mode to Object Mode and go to File > Export > Ogre XML.


Ignore the Scene.material since the hat already comes with a material file by default. Unselect the "Export Armatures" option, since the hat isn't rigged to any joints in the scene.

Input your Export Directory by clicking on the "Select" button to the right and select the folder where you want your object to be exported.

Now we want to rename the newly exported applejackhat.mesh.xml to AppleJackHat.mesh.xml before opening it in notepad. Find where it says material="defaultMat" and change defaultMat to AJH. Once that's done, save the file.

For the last step, open up the folder containing your Ogre XML Converter in a new window. You're going to drag the AppleJackHat.mesh.xml file into the OgreXmlConverter.exe program. That should spit out a new file called AppleJackHat.mesh.

Be careful not to drag your file from a folder that already has the same filename as what your exported file will be called, since that can cause problems.



Congratulations, you should now be able to use these UVs for your hat.

Before copy and pasting your hat mesh back to your FeralHeart\media\items folder, you should make a back up of the old one in case something goes wrong.

Aside from that, you can now use these new UVs



While I highly suggest you try to do this yourself for the sake of learning, I can also understand why you might not want to go through all of this for one object, so here's a packaged version ready to use. Place the .MESH file where it belongs and use the UVs to create a new texture.

AppleJackHat_New.zip

Ahh omg you didn't have to go through all of that ;o; thank you so so much! I'm gonna bookmark this so I can try it sometime(I don't rlly know if my old PC can properly run blender...)
thank you so  much though seriously ah

Do I just replace the old AJ files with the ones you made?o: I noticed the texture file is still 128 x 128, so I resize the UV over that or-?

thank you again so much<33!!!

Lucius

  • Guest
Re: Help with meshes?
« Reply #8 on: August 13, 2018, 11:38:56 am »
Don't use the 128x128, that's way too small of a resolution. The UV image is scaled to 1024x1024, so you could create a new texture with that size and then use the UVs, or scale them down to a standard 512x512 and work with that. I didn't create a new texture, since I don't know what exactly you want the hat to look like, so I'll let you make your own. You can make it as big, or as small as you want.

Either way, you'll be overriding the old texture, so it's best to back that one up.

I suggest backing up the AppleJackHat.mesh file as well, in case you ever want the old one back again. After that, just replace the one in your FeralHeart\media\items with the one I made. Ignore the .MESH.XML file.

Offline Vidathelion

  • Experienced Traveler
  • **
  • Posts: 246
  • Country: 00
  • Floof-O-Meter: 5
    • www.deviantart.com/cynde
    • www.youtube.com/channel/UC90KdyZ
    • http://feebleturtleduck-artz.tum
    • View Profile
Re: Help with meshes?
« Reply #9 on: August 14, 2018, 07:28:45 am »
Don't use the 128x128, that's way too small of a resolution. The UV image is scaled to 1024x1024, so you could create a new texture with that size and then use the UVs, or scale them down to a standard 512x512 and work with that. I didn't create a new texture, since I don't know what exactly you want the hat to look like, so I'll let you make your own. You can make it as big, or as small as you want.

Either way, you'll be overriding the old texture, so it's best to back that one up.

I suggest backing up the AppleJackHat.mesh file as well, in case you ever want the old one back again. After that, just replace the one in your FeralHeart\media\items with the one I made. Ignore the .MESH.XML file.
It worked omg!!! thank you so much<33 I can't thank you enough, and for taking the time to explain how to do it. I'm gonna def try that on some other things when I get a pc that can run blender without crashing lmfao
thank you so much again, I can't thank you enough!!
I can finally make my paw-print banded hat.xD