Help on Blender about sfm2xps bones

General discussion and questions about XNALara go here.

Moderators: ObscureMemories, Runa, Love2Raid

User avatar
navie
Posts: 8
Joined: Wed Aug 03, 2016 8:02 pm
Custom Rank: IOns

Help on Blender about sfm2xps bones

Post by navie »

Hi
I am working on porting a sfm model to xps. the model was loaded into blender.

when I tried to export it to xps using johnzero7's script(http://johnzero7.deviantart.com/art/Ble ... -490662931)

it basically works. and I can fix the texture in XPS. but the bones does not maintain the hierarchy as expected.

bones in blender
1.jpg
bones in XPS
2.png
I dont know how to fix the bone hierarchy. Please help me...
You do not have the required permissions to view the files attached to this post.
User avatar
Ems
Porter
Posts: 172
Joined: Tue May 19, 2015 11:16 pm
Custom Rank: Stashing stuff I like.

Re: Help on Blender about sfm2xps bones

Post by Ems »

EDIT: Oi, Semory, list bullets don't work?
EDIT2: parenting hierarchy =/= naming hierarchy in XPS. Don't worry, you don't screw parenting by renaming bones.

To maintain alphabetical hierarchy bones need standardized XNALara naming. Exporting scripts can't do that, because every game has its own naming, and scripts can't simply cover every game out there.

In other words, you have to do renaming yourself, there's three ways to do it ((not including renaming within Blender of course)) I'm sure one of us made numerous of such posts on the forums already, but I'm too lazy to search).

1st way (the old way we did it) is to export your model from Blender in mesh.ascii format. It's uncompressed format you can open in any text editor, where you will see the bones table on the beginning of the file (L2R breaks down its contents nicely here). You can rename bones there. You can hide useless bones by adding "unused" on the beginning of the bone name.

2nd way is to rename bones within XPS (via Modify>Rename bone names, then sloooowww double click on a bone on the list to rename). You can also hide unused bones. Remember to save your model after all that.

3d way assures you have a bones list saved for future models from the same game so that XPS will rename them for you on the fly.
  • open your model in XPS and go to Modify>Create Bone Names List (or Ctrl+Shift+S). A window pops up for direction to save your bones list.
  • open the file you created and you'll see name strings separated with ; symbol, the strings on the left are original names, the right ones are renamed by the program (lower case, no underscores, no special symbols, which is general rule for XPS bone naming). In other words the names on the right are the ones you want to change/mark as unused (the same way as in the 1st way).

    An example of renaming from Japanese naming convention:
    koyu1_l;arm left finger 5 a
    koyu2_l;arm left finger 5 b
    koyu3_l;arm left finger 5 c
  • After you're done, open your XPS directory, you will find BoneDict.txt, open it.
  • Paste your renamed bones into this document. You can place numerous lists there (I generally have all lists from every game I converted so far), if you need to comment out something, simply put # symbol on the beginning of the line. Save, launch XPS, open your model.
If all was done right, XPS renamed bones on the model, now you just need to verify for eventual misshaps and save it as .mesh or .xps again. You can always fix the BoneDict, but XPS needs to be restarted after every modification so the change can take effect.

As for the general bones names: download and open few humanoid models from this forum to see examples. I'm adding an absolute basic list below, but many models have adjusting bones or bones for attachments between main joints, many can not have bones listed below, so you have to be flexible here, but it's generally up to you and what you're comfortable with.
root ground
root hips
pelvis

leg left thigh
leg left knee
leg left ankle
leg left toes

leg right thigh
leg right knee
leg right ankle
leg right toes

spine lower
spine upper
head neck lower
head neck upper
head jaw
head tongue 1
head tongue 2

head cheek left 1
head cheek left 2

head cheek right 1
head cheek right 2

head nostril left
head nostril right

head eyeball left
head eyeball right

head eyelid right both
head eyelid right upper
head eyelid right lower

head eyelid left both
head eyelid left upper
head eyelid left lower

head eyebrow right 3
head eyebrow right 2
head eyebrow right 1

head eyebrow left 1
head eyebrow left 2
head eyebrow left 3

head mouth corner right
head mouth corner left

head lip upper right
head lip upper middle
head lip upper left

head lip lower right
head lip lower middle
head lip lower left


arm left shoulder 1
arm left shoulder 2
arm left elbow
arm left wrist
arm left finger 1a
arm left finger 1b
arm left finger 1c
arm left finger 2a
arm left finger 2b
arm left finger 2c
arm left finger 3a
arm left finger 3b
arm left finger 3c
arm left finger 4a
arm left finger 4b
arm left finger 4c
arm left finger 5a
arm left finger 5b
arm left finger 5c

arm right shoulder 1
arm right shoulder 2
arm right elbow
arm right wrist
arm right finger 1a
arm right finger 1b
arm right finger 1c
arm right finger 2a
arm right finger 2b
arm right finger 2c
arm right finger 3a
arm right finger 3b
arm right finger 3c
arm right finger 4a
arm right finger 4b
arm right finger 4c
arm right finger 5a
arm right finger 5b
arm right finger 5c
Last edited by Ems on Sat Dec 03, 2016 1:39 am, edited 1 time in total.
User avatar
navie
Posts: 8
Joined: Wed Aug 03, 2016 8:02 pm
Custom Rank: IOns

Re: Help on Blender about sfm2xps bones

Post by navie »

thank u very much.

I am new to XPS, and not English speaking. So it is difficult for me to find useful info in old posts.

I will try it.
User avatar
Anx
Posts: 146
Joined: Wed Aug 22, 2012 2:52 am
Location: Gravlex Med

Re: Help on Blender about sfm2xps bones

Post by Anx »

Ems wrote:...
As for the general bones names: download and open few humanoid models from this forum to see examples. I'm adding an absolute basic list below, but many models have adjusting bones or bones for attachments between main joints, many can not have bones listed below, so you have to be flexible here, but it's generally up to you and what you're comfortable with.
root ground
root hips
pelvis
...
As for the general bone names:
  • My way is to create an absolute basic list within XPS via

    Code: Select all

    Commands->Run pose script
    (or Alt+P)
  • After you're done, open your XPS directory, you will find

    Code: Select all

    MissingBones.txt
    , open it.
Create the full 'bone names' list, by loading the dummy model
User avatar
navie
Posts: 8
Joined: Wed Aug 03, 2016 8:02 pm
Custom Rank: IOns

Re: Help on Blender about sfm2xps bones

Post by navie »

Thank you all for your advice.
Now I think it is ready for release.
WIP.png
You do not have the required permissions to view the files attached to this post.
User avatar
semory
Site Admin
Posts: 7755
Joined: Sat Aug 04, 2012 7:38 pm
Custom Rank: Kitty pu tu tu lay!
Location: Torrance, CA

Re: Help on Blender about sfm2xps bones

Post by semory »

Ems wrote:EDIT: Oi, Semory, list bullets don't work?
Hi Ems,
I think they do but I forget how they work in phpBB.

Testing...
  • apples
  • oranges
  • pears

Code: Select all

[list]
[*]apples
[*]oranges
[*]pears
[/list]
User avatar
Ems
Porter
Posts: 172
Joined: Tue May 19, 2015 11:16 pm
Custom Rank: Stashing stuff I like.

Re: Help on Blender about sfm2xps bones

Post by Ems »

Awesome, stupid me, thanks.

Also
navie wrote:Thank you all for your advice.
Now I think it is ready for release.
Looking good! Glad I could help.
User avatar
navie
Posts: 8
Joined: Wed Aug 03, 2016 8:02 pm
Custom Rank: IOns

Re: Help on Blender about sfm2xps bones

Post by navie »

Ems wrote:Awesome, stupid me, thanks.

Also
navie wrote:Thank you all for your advice.
Now I think it is ready for release.
Looking good! Glad I could help.
Oh I think I have another question.
When I exported the model from Blender, I did not pay attention to the difference of axis system of XPS and Blender. So it ends up that the model in XPS was not front facing when loaded.

It's not a big problem if you just pose with this model, you only have to rotate the root until it is front facing(about -90 degrees). But if you want to re-use a pose you save for other models, it won't work because the X-Y axis difference.

How can I fix this without starting all over again from exporting from Blender? I mean it really took me a lot of time in fine tuning the material in XPS. I don't want to do it again.
User avatar
Ems
Porter
Posts: 172
Joined: Tue May 19, 2015 11:16 pm
Custom Rank: Stashing stuff I like.

Re: Help on Blender about sfm2xps bones

Post by Ems »

If you plan to use the model only in XPS, you can pose it so that it faces the camera properly then export via Modify>Save Generic_Item with the "modify armature according to the current pose" option checked.
All the poses you've done so far for this model will be probably useless, though you can modify them by hand (.pose files can be edited in text editors) to swap some letters and numbers, I never bothered with that though.

A tip, you can rotate models in Blender pre-export, then select all (A) > ctrl+a > "Location" to save the position.

Importing the model back from XPS to Blender (in case you'd need to do that someday) should not break your materials, unless you start to mess with mesh names. Any lack of a parameter in a mesh header (that is ignored by the Blender exporter btw) will cause an error while importing to XPS and you might need to use the material editor in XPS again. Ah, and total lack of specified render group will cause invisible meshes in XPS, too. Just FYI.
User avatar
Anx
Posts: 146
Joined: Wed Aug 22, 2012 2:52 am
Location: Gravlex Med

Re: Help on Blender about sfm2xps bones

Post by Anx »

navie wrote:Thank you all for your advice.
Now I think it is ready for release.

model in blender
Image

model in XPS
Image
navie wrote:Oh I think I have another question.
When I exported the model from Blender, I did not pay attention to the difference of axis system of XPS and Blender. So it ends up that the model in XPS was not front facing when loaded.

It's not a big problem if you just pose with this model, you only have to rotate the root until it is front facing(about -90 degrees). But if you want to re-use a pose you save for other models, it won't work because the X-Y axis difference.
...
Ems wrote:If you plan to use the model only in XPS, you can pose it so that it faces the camera properly then export via Modify>Save Generic_Item with the "modify armature according to the current pose" option checked.
...
XNA/Directx Handedness orientation! :!:

Right, but the model is not just rotated 90 degree along the Y-axis!
:idea:
The model is also mirrored, because XNA Uses a right-handed coordinate system.
  • Forward is -Z, backward is +Z. Forward points into the screen.
  • Right is +X, left is -X. Right points to the right-side of the screen.
  • Up is +Y, down is -Y. Up points to the top of the screen.
==> Pose it so that it faces to the camera is NOT enough :ohn:
  1. Commands->Mirror Model Z .... (or Commands->Mirror Model X)
  2. Rotate "root ground" bone along Y-axis
  3. Modify>Save Generic_Item with the "modify armature according to the current pose" option checked.
I hope you've renamed the bones properly. :roll: Otherwise, the left leg now has the name "leg right thigh" :o :roll:
Post Reply