literature

Blender to XPS(blender 2.7x Internal materials)

Deviation Actions

johnzero7's avatar
By
Published:
142 Comments
50K Views

Literature Text

Things we are gonna need are


For Mac Users
Safari automatically unzips downloaded files and deletes the original ZIP file. 
Try disabling this function (I don't know how, I never used a Mac) or download using another browser like Firefox.

Preparation

UPDATE: Here is a video showing the install process. Thanks a lot!
Install Xps addon to blender

First thing we have to do is to installing the addon.
Go to the provided link and download the latest version of the addon. DO NOT UNZIP IT.
Open Blender and go to File > User Preferences
Select the Addons tab and click the "Install fom File..." button

Screen002 by johnzero7
Find the downloaded addon zip file and click the "Install fom File..." button

The XPS tools addon should be de only addon diplayed on the list, if not type "XPS" in the search dialog.
Now Check the checkbox to the right to enable the addon.
Click the "Save User Settings" button and close the window.

Screen005 by johnzero7

A new tab called XPS should have appeared in the toolshelf
Screen007 by johnzero7


Necessary knowledge

First we need to know how XPS manages material. XPS suppports only one material per Mesh
For XPS to properly display the meshes, the name of each mesh must by like this.
22_suit_0.7_20_5
The undercores are separators. Each part has a diferent function

22: is the Render group. A render group tells XPS how many textures a the material has, how will they be use (diffuse map, bump map, specular map, etc.), in what order the textures are, if the textures have alpha channels, etc.
This particular Render group (22) has 7 textures, they are: Diffuse, Lightmap, Bumpmap, Mask, Bump1, Bump2 and Specular. Always respect the order of the textures.
suit: is the name of the mesh. Can be anything, but can't contain underscores has they are XPS field separators.
0.7: is the specular highlight value.
20: not all render goups have a foth value. But for this Render Group, this values is the repeater for the Bump1 texture. This means that the Bump1 texture will be tilled 20 time horizontally and 20 times vertically
5:  not all render goups have a fifth value. But for this Render Group, this values is the repeater for the Bump2 texture. This means that the Bump1 texture will be tilled 5 time horizontally and 5 times vertically


Here is the official guide for all the Render groups.
xnalara.home-forum.com/t225-le…

I transcribed the Render groups here for readability
docs.google.com/spreadsheets/d…

Preparing the model

So, we have a model in Blender (made from scratch, ripped from a game, etc.) and we want to export it to XPS. We need to do a few things to make our model compatible with XPS.
  1. Only one Material per mesh
  2. The name of each part must follow the structure [render group]_[mesh name]_[value1]_[value2]_[value3]
  3. The order of the textures MUST be the order required by the Render Group
  4. Don't use pure white in your textures (R255, G255, B255). XPS will display it as fully transparent or pure black. Change it to (R254, G254, B254)
  5. The plugin will triangulate any Quad or Ngon.

1.One Material per mesh

If your mesh has more than one material, you must separate them and create one mesh for each material.
Export-001 by johnzero7


Luckily this is easy to do in blender.
Select the mesh with multiple materials and enter edit mode. Select all (Shortcut A, press it a couple of times till everything is selected). Separate (Shortcut P) and select By material. Exit edit mode.
Now the mesh splitted into as many parts as materials where used by the mesh.
Export-002 by johnzero7

2.Name the mesh

As explained previously the name of the mesh will determine how the material is constructed in XPS. So its up to us to select an appropriate Render Group. For example the bikini part, named WGT_body.001 we will rename it to 24_WGT-bikini_0.8

You can make items optional in XPS by adding a plus sign "+" (visible by default) or a minus sign "-" (hidden by default) at the begenning of the name.

For example, to make the glasses an optional item rename the frame mesh to 24_+frame_1.0 and the lense mesh to 24_+lens_1.0 then in XPS you can show or hide this items from 
Options-->Dispay accessories-->Optional Items (hotkey a)
Ungrouped by johnzero7

Some times you will want to group multiple item in a same group, in our example lets create a glasses group that will contain the frame and the lense. All you need to do is rename the meshes to 24_+glasses.frame_1.0 and 24_+glasses.lens_1.0. With this you will see a single option that will hide or show both meshes.
Grouped by johnzero7


Note
In XPS 11.0 you have the new RG 40 and 41 which only required Diffuse, Bumpmap, Specular maps. And the Normal map coordinate system (swizzle coordinates) for 40/41 is RGB X+Y+Z+. But in XPS 11.1 the Normal map coordinate system for 40/41 is back to RGB X+Y-Z+.
For XPS previous to version 11.0 you don't have RG 40/41. The most similar RG are 24/25, so were are gonna use RG 24 for the purposes of this tutorial.

As described in the previously mentioned tables, the render group 24 has 4 textures in this precise order: Diffuse, Lightmap, Bumpmap and Specular, doesn't manage alpha channel and as specular highlight.

Export-003 by johnzero7


For this example our blender material as the Diffuse, Normal and Specular maps but we are missing the lightmap. In this case we can create a solid white texture. Remember you can't use a pure white color R255,G255,B255 so use R254,G254,B254 instead.

If you are missing a Normal map, you can use a solid texture with the color R128,G128,B255.


Remeber use a power of 2 for the dimension of the textures, something like 512x512 or 1024x1024.

Now we have to sort the textures, the order is given by the render group. In this case from top to bottom Diffuse, Lightmap, Bumpmap and Specular. You see we have an extra texture in this material at the end of our list, XPS will ignore this texture as it is not requiered by the render broup. You can leave it there (remember to include the texture file or XPS while create a empty file) or remove it.
Export-004 by johnzero7

You can choose a different UV map for the lighmap and the specular map if you want.
Export-009 by johnzero7



If you don't specify the UV Map to use with a texture, the addon will export the one set as the active render one.
Export-005 by johnzero7


You can have subsurface modifiers or other modifiers, but the addon will export the original geometry.



Finaly exporting

Export-006 by johnzero7


We are ready to export the model.
Select everything you want to export (only meshes and one armature can be exported).
Go to the XPS toolshelf and click the export model button.
Choose the format to export (*.ascii / *.mesh / *.xps)

If you choose a binary format (*.mesh / *.xps) you can protect the model. This means that the addon will not be able to import this model back into Blender but will work normally in XPS.
Export-010 by johnzero7


You are done. Load Your model into XPS, enjoy you master piece and don't forget to share!!

Untitled by johnzero7





Finaly had time to do the Blender to XPS export tutorial. Guess it's better late than never.
© 2014 - 2021 johnzero7
Comments142
Join the community to add your comment. Already a deviant? Log In
ZoraCatone's avatar

Ahhhh. I wondered what I was doing wrong. When I exported a model, I would only get part of it.

Nachtmar999's avatar

Your rendering group spreadsheet saved me from hours of frustration. Thank you SO so much.

Aeoniangel's avatar

Hello! Will this tut help me convert FBX models to MESH for XPS?

Sorry I'm still new to blender so the whole thing feels overwhelming for me so I wanted to ask first ^^;

KakashiHatake9002's avatar

any chance of updating the add on to 2.8?

oksid300's avatar

This is too complicated.

zidanesg1's avatar

i know this is old and all.. but how about a tutorial for xps to blender.. as Im importing a char and dont know how to import meterial/texture properly.. thanks!

I got a question , how to export my fixed meshmod to xps (bone parenting , join meshes , etc) because everytime i export , it always never works
johnzero7's avatar
what kind of errors?
Keybearer001's avatar

Does this work for 2.90.1

theres no errors popped up , but by the time i load it in on xps , the clothes are static and didnt move together
Darkness-Ringo's avatar
I wanna use a XPS model, but I saw this bug:
Bug Arkham Knight by Darkness-Ringo
How can I fix this?
uhuy789's avatar

Se necesita una actualización de este tutorial, hoy en día eestamos en blender 2.81 y este tutorial está desactualizado, mucha gente como yo que somos nuevos y no sabemos necesitamos un tutorial más claro y actualizado, porfavor si lees esto no te olvides de los que no sabemos. En mi caso no se como exportar un modelo de blender al xnalara tengo los 3 archivos xps mesh y ascii en una carpeta pero da problema al cargarlo, solo se carga arrastrandolo y sin texturas, todo una locura..:shakefist:

madcatmaniac's avatar
Will this work with the recent version of Blender?
vanderzee's avatar

and all i can export is a single xps file without textures or anything else : :( :(

thanks bro, it works

wjh5846's avatar
thanks a lot for your guide. I'm able to export single mesh to xnalara. However could you please let me know how to export the whole model (including all mesh parts) to xnalara?  
is there a way this can be put into simple terms or a video maybe? my simple mind cant comprehend any of this.. i still dont know what a Mesh is.. and cant grasp the naming of it.. every bit of this is just confusing to me.. i blame my autism lol 
Martsuia's avatar
do you have any idea why the textures here aren't showing?


Screen Shot 2019-01-31 at 8.15.17 PM by Martsuia  
johnzero7's avatar
Looks like your light source is too strong or too close to the model
Martsuia's avatar
ya, um nevermind. the textures were in alpha 
Thank you for your kind tutorial.

After I modified the model with blender and exported the .mesh and .xps file for Xnalara, I copied all the original texture .tga files to the same folder. The Xnalara successfully loaded everything.

However, not like the original model which can be posed freely, the modified one only has a "root" to adjust. No other parts can not adjusted like before.

Is there anything I missed? Or what should I do so that I could adjust the poses of the modified model? 
Another problem is that when I tried export .ascii file, nothing happened. Could this be due to the fact that I am using english operation system?

Thanks!
johnzero7's avatar
Following the steps in the guide should be enough.
Send me the model and I will take a look
Thank you very much for your kind reply. I managed to do it. It was true that the Unicode for the program should go English.

Thank you again for this tutorial.
Join the community to add your comment. Already a deviant? Log In